This commit is contained in:
Cristina Poncela Cubeiro
2026-05-04 15:43:45 +02:00
parent 59a89e0c1c
commit cbf3c333ef
14 changed files with 31 additions and 395 deletions

View File

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