diff --git a/web/core/lib/editor/action/AiActionExecutor.ts b/web/core/lib/editor/action/AiActionExecutor.ts index 20be4cd..de07b1c 100644 --- a/web/core/lib/editor/action/AiActionExecutor.ts +++ b/web/core/lib/editor/action/AiActionExecutor.ts @@ -6,7 +6,7 @@ import { BuiltinFunctionExecutor } from '@/editor/action/BuiltinFunctionExecutor export class AiActionExecutor { editor: Editor; - endpointUrl: string = '/api/completion/mock'; + endpointUrl: string = '/api/completion'; constructor() { } @@ -38,11 +38,13 @@ export class AiActionExecutor { const response = await fetch(this.endpoint(action), { method: 'POST', - body: JSON.stringify({ prompt: prompt }) + body: JSON.stringify({ prompt: prompt }), + headers: { Accept: 'text/event-stream' } }); let allText = ''; let buffer = ''; + console.info(response.body) await response.body?.pipeThrough(new TextDecoderStream()).pipeTo( new WritableStream({ write: (chunk) => { diff --git a/web/core/package.json b/web/core/package.json index dc5a3cc..64bf48e 100644 --- a/web/core/package.json +++ b/web/core/package.json @@ -1,6 +1,6 @@ { "name": "@studio-b3/web-core", - "version": "0.2.8", + "version": "0.2.10", "type": "module", "main": "dist/main.js", "types": "dist-types/main.d.ts",