diff --git a/src/features/chat/chat-services/chat-api-data.ts b/src/features/chat/chat-services/chat-api-data.ts index 8cd2481c3..33f3345fe 100644 --- a/src/features/chat/chat-services/chat-api-data.ts +++ b/src/features/chat/chat-services/chat-api-data.ts @@ -95,7 +95,9 @@ export const ChatAPIData = async (props: PromptGPTProps) => { }, }); - return new StreamingTextResponse(stream); + return new StreamingTextResponse(stream, { + headers: {"Content-Type": "text/event-stream"}, + }); } catch (e: unknown) { if (e instanceof Error) { return new Response(e.message, { diff --git a/src/features/chat/chat-services/chat-api-simple.ts b/src/features/chat/chat-services/chat-api-simple.ts index df855a1e3..4a80d628e 100644 --- a/src/features/chat/chat-services/chat-api-simple.ts +++ b/src/features/chat/chat-services/chat-api-simple.ts @@ -49,7 +49,9 @@ export const ChatAPISimple = async (props: PromptGPTProps) => { }); }, }); - return new StreamingTextResponse(stream); + return new StreamingTextResponse(stream, { + headers: {"Content-Type": "text/event-stream"}, + }); } catch (e: unknown) { if (e instanceof Error) { return new Response(e.message, {