Fix codestral

This commit is contained in:
Luke 2025-02-20 11:28:26 -05:00
parent 2eeb60ffb3
commit 3e85ea05e9

View file

@ -263,7 +263,9 @@ class VertexAI extends BaseLLM {
});
for await (const chunk of streamSse(response)) {
yield chunk.choices[0].delta.content;
if (chunk.choices?.[0].delta) {
yield chunk.choices[0].delta.content;
}
}
}
@ -358,7 +360,7 @@ class VertexAI extends BaseLLM {
}
supportsFim(): boolean {
return ["code-gecko", "codestral-latest"].includes(this.model);
return this.model.includes("code-gecko") || this.model.includes("codestral");
}
protected async _embed(chunks: string[]): Promise<number[][]> {