Skip to content

Commit da63ef1

Browse files
committed
fixup! 🚧(back) manage steaming with the ai service
1 parent cc60fad commit da63ef1

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/frontend/apps/e2e/__tests__/app-impress/common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const CONFIG = {
77
},
88
AI_FEATURE_ENABLED: true,
99
AI_MODEL: 'llama',
10+
AI_STREAM: false,
1011
CRISP_WEBSITE_ID: null,
1112
COLLABORATION_WS_URL: 'ws://localhost:4444/collaboration/ws/',
1213
COLLABORATION_WS_NOT_CONNECTED_READY_ONLY: false,

src/frontend/apps/impress/src/core/config/api/useConfig.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export interface ConfigResponse {
1515
AI_BOT: { name: string; color: string };
1616
AI_FEATURE_ENABLED?: boolean;
1717
AI_MODEL?: string;
18+
AI_STREAM: boolean;
1819
COLLABORATION_WS_URL?: string;
1920
COLLABORATION_WS_NOT_CONNECTED_READY_ONLY?: boolean;
2021
CRISP_WEBSITE_ID?: string;

src/frontend/apps/impress/src/features/docs/doc-editor/components/AI/useAI.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const useAI = (doc: Doc) => {
7575
const model = openai.chat(conf.AI_MODEL);
7676

7777
const extension = createAIExtension({
78-
stream: false,
78+
stream: conf.AI_STREAM,
7979
model,
8080
agentCursor: conf.AI_BOT,
8181
// Create a custom promptBuilder that extends the default one
@@ -156,5 +156,5 @@ export const useAI = (doc: Doc) => {
156156
});
157157

158158
return extension;
159-
}, [aiAllowed, conf?.AI_BOT, conf?.AI_MODEL, doc.id, modules]);
159+
}, [aiAllowed, conf, doc.id, modules]);
160160
};

0 commit comments

Comments
 (0)