From 0f5be8ba5fd8f4564486daac56966b05bad2d86e Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 29 Nov 2024 21:57:57 -0800 Subject: [PATCH] hotfix: openai displaying as undefinedundefinedundefined --- core/llm/llms/Cloudflare.ts | 5 ++++- core/llm/llms/OpenAI.ts | 7 +++++-- extensions/vscode/package.json | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/core/llm/llms/Cloudflare.ts b/core/llm/llms/Cloudflare.ts index 215e97b37c..3c47663653 100644 --- a/core/llm/llms/Cloudflare.ts +++ b/core/llm/llms/Cloudflare.ts @@ -41,7 +41,10 @@ export default class Cloudflare extends BaseLLM { for await (const value of streamSse(resp)) { if (value.choices?.[0]?.delta?.content) { - yield value.choices[0].delta; + yield { + role: "assistant", + content: value.choices[0].delta, + }; } } } diff --git a/core/llm/llms/OpenAI.ts b/core/llm/llms/OpenAI.ts index 35d05a62d3..ed9810932d 100644 --- a/core/llm/llms/OpenAI.ts +++ b/core/llm/llms/OpenAI.ts @@ -310,7 +310,10 @@ class OpenAI extends BaseLLM { for await (const value of streamSse(response)) { if (value.choices?.[0]?.delta?.content) { - yield value.choices[0].delta; + yield { + role: "assistant", + content: value.choices[0].delta.content, + }; } else if (value.choices?.[0]?.delta?.tool_calls) { yield { role: "assistant", @@ -375,4 +378,4 @@ class OpenAI extends BaseLLM { } } -export default OpenAI; \ No newline at end of file +export default OpenAI; diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index a88bffe519..a1b19a226a 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -2,7 +2,7 @@ "name": "continue", "icon": "media/icon.png", "author": "Continue Dev, Inc", - "version": "0.9.238", + "version": "0.9.239", "repository": { "type": "git", "url": "https://github.com/continuedev/continue"