fix: Integrate smoothStream and enhance chat message display with args handling

This commit is contained in:
dayuan.jiang
2025-04-04 02:10:24 +00:00
parent aeca1adf89
commit 78f2c4f60c
2 changed files with 12 additions and 3 deletions

View File

@@ -1,7 +1,8 @@
import { bedrock } from '@ai-sdk/amazon-bedrock';
import { openai } from '@ai-sdk/openai';
import { google } from '@ai-sdk/google';
import { streamText } from "ai";
import { smoothStream, streamText } from 'ai';
import { z } from "zod";
export const maxDuration = 60
@@ -59,7 +60,6 @@ ${lastMessage.content}
const result = streamText({
// model: google("gemini-2.5-pro-exp-03-25"),
// model: google("gemini-2.0-flash-001"),
// model: openrouter("google/gemini-2.0-flash-exp:free"),
model: bedrock('anthropic.claude-3-5-sonnet-20241022-v2:0'),
// model: openai("gpt-4o"),
toolCallStreaming: true,
@@ -84,5 +84,7 @@ ${lastMessage.content}
},
temperature: 0,
});
return result.toDataStreamResponse();
return result.toDataStreamResponse({
});
}