Fix TypeScript build error (#3535)
This commit is contained in:
@@ -39,7 +39,12 @@ export class AnthropicLLM implements LLM {
|
|||||||
max_tokens: 4096,
|
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> {
|
async generateChat(messages: Message[]): Promise<LLMResponse> {
|
||||||
|
|||||||
Reference in New Issue
Block a user