Fix TypeScript build error (#3535)

This commit is contained in:
Mrinank Bhowmick
2025-10-09 23:39:31 +05:30
committed by GitHub
parent 64571002f5
commit 335a7d7862
+6 -1
View File
@@ -39,7 +39,12 @@ export class AnthropicLLM implements LLM {
max_tokens: 4096,
});
return response.content[0].text;
const firstBlock = response.content[0];
if (firstBlock.type === "text") {
return firstBlock.text;
} else {
throw new Error("Unexpected response type from Anthropic API");
}
}
async generateChat(messages: Message[]): Promise<LLMResponse> {