feat: image content
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
fauxToolCall,
|
||||
type Model,
|
||||
registerFauxProvider,
|
||||
type TextContent,
|
||||
type ToolResultMessage,
|
||||
type UserMessage,
|
||||
} from "@mariozechner/pi-ai";
|
||||
@@ -23,10 +24,8 @@ function createFauxRegistration(options: Parameters<typeof registerFauxProvider>
|
||||
}
|
||||
|
||||
function getTextContent(message: AssistantMessage | ToolResultMessage): string {
|
||||
return message.content
|
||||
.filter((block) => block.type === "text")
|
||||
.map((block) => block.text)
|
||||
.join("\n");
|
||||
const textBlocks = message.content.filter((block): block is TextContent => block.type === "text") as TextContent[];
|
||||
return textBlocks.map((block) => block.text).join("\n");
|
||||
}
|
||||
|
||||
afterEach(() => {
|
||||
|
||||
Reference in New Issue
Block a user