From a66c4e8b2f17db0d5c23d74424879f7e7f4ae4a6 Mon Sep 17 00:00:00 2001 From: aboutphilippe Date: Fri, 6 Sep 2024 13:54:29 +0200 Subject: [PATCH] chunkContent --- openai/functions/chat/completionsStream.ts | 3 ++- openai/package.json | 2 +- openai/types/events.ts | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/openai/functions/chat/completionsStream.ts b/openai/functions/chat/completionsStream.ts index cf13fad..559d2a9 100644 --- a/openai/functions/chat/completionsStream.ts +++ b/openai/functions/chat/completionsStream.ts @@ -140,8 +140,9 @@ export async function openaiChatCompletionsStream({ if (response.length) { const input: StreamEvent = { chunkId: chunk.id, - assistantName, + chunkContent: content, response, + assistantName, isLast: finishReason === "stop", }; if (streamEvent) { diff --git a/openai/package.json b/openai/package.json index 35dcbc4..8bcae98 100644 --- a/openai/package.json +++ b/openai/package.json @@ -1,6 +1,6 @@ { "name": "@restackio/integrations-openai", - "version": "0.0.14", + "version": "0.0.15", "main": "dist/service.js", "types": "dist/service.d.ts", "scripts": { diff --git a/openai/types/events.ts b/openai/types/events.ts index 89e2017..22b6408 100644 --- a/openai/types/events.ts +++ b/openai/types/events.ts @@ -1,7 +1,8 @@ import OpenAI from "openai/index"; export type StreamEvent = { - chunkId: string; + chunkId?: string; + chunkContent?: string; response: string; assistantName?: string; isLast: boolean;