Skip to content

Commit fbba408

Browse files
committed
feat(ai): update AI service streaming methods to support tools integration
1 parent 85164b0 commit fbba408

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/services/service-ai/src/routes/ai-routes.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,10 @@ export function buildAIRoutes(
252252
if (wantStream) {
253253
// UI Message Stream Protocol (SSE with JSON payloads)
254254
try {
255-
if (!aiService.streamChat) {
255+
if (!(aiService as any).streamChatWithTools) {
256256
return { status: 501, body: { error: 'Streaming is not supported by the configured AI service' } };
257257
}
258-
const events = aiService.streamChat(finalMessages, resolvedOptions as any);
258+
const events = (aiService as any).streamChatWithTools(finalMessages, resolvedOptions as any);
259259
return {
260260
status: 200,
261261
stream: true,
@@ -277,7 +277,7 @@ export function buildAIRoutes(
277277

278278
// JSON response (non-streaming)
279279
try {
280-
const result = await aiService.chat(finalMessages, resolvedOptions as any);
280+
const result = await (aiService as any).chatWithTools(finalMessages, resolvedOptions as any);
281281
return { status: 200, body: result };
282282
} catch (err) {
283283
logger.error('[AI Route] /chat error', err instanceof Error ? err : undefined);

0 commit comments

Comments
 (0)