Skip to content
Snippets Groups Projects
Unverified Commit e8c41c5c authored by Thuc Pham's avatar Thuc Pham Committed by GitHub
Browse files

fix: wrong gemini streaming chat response (#791)

parent 051b4ddf
No related branches found
No related tags found
No related merge requests found
---
"llamaindex": patch
---
fix: wrong gemini streaming chat response
......@@ -302,12 +302,10 @@ export class Gemini extends ToolCallLLM<GeminiAdditionalChatOptions> {
): GeminiChatStreamResponse {
const { chat, messageContent } = this.prepareChat(params);
const result = await chat.sendMessageStream(messageContent);
return streamConverter(result.stream, (response) => {
return {
text: response.text(),
raw: response,
};
});
yield* streamConverter(result.stream, (response) => ({
delta: response.text(),
raw: response,
}));
}
chat(params: GeminiChatParamsStreaming): Promise<GeminiChatStreamResponse>;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment