use streamsse in vertexai

This commit is contained in:
uinstinct 2025-10-16 12:27:38 +05:30
parent 31c7383e92
commit f72199dee2
2 changed files with 4 additions and 4 deletions

View file

@ -1,6 +1,6 @@
import { AuthClient, GoogleAuth, JWT, auth } from "google-auth-library";
import { streamResponse, streamSse } from "@continuedev/fetch";
import { streamSse } from "@continuedev/fetch";
import { ChatMessage, CompletionOptions, LLMOptions } from "../../index.js";
import { renderChatMessage, stripImages } from "../../util/messageContent.js";
import { BaseLLM } from "../index.js";
@ -287,7 +287,7 @@ class VertexAI extends BaseLLM {
body: JSON.stringify(body),
signal,
});
yield* this.geminiInstance.processGeminiResponse(streamResponse(response));
yield* this.geminiInstance.processGeminiResponse(streamSse(response));
}
private async *streamChatBison(

View file

@ -1,4 +1,4 @@
import { streamResponse } from "@continuedev/fetch";
import { streamSse } from "@continuedev/fetch";
import { OpenAI } from "openai/index";
import {
ChatCompletion,
@ -286,7 +286,7 @@ export class GeminiApi implements BaseLlmApi {
async *handleStreamResponse(response: any, model: string) {
let buffer = "";
let usage: UsageInfo | undefined = undefined;
for await (const chunk of streamResponse(response as any)) {
for await (const chunk of streamSse(response as any)) {
buffer += chunk;
const parts = buffer.split("\n,");