use streamsse in vertexai
This commit is contained in:
parent
31c7383e92
commit
f72199dee2
2 changed files with 4 additions and 4 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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,");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue