fix assistant tool result streaming
This commit is contained in:
1 parent
414f5dfe53
commit
c7fd5eceae
6 files changed
+141
-12
No files matched your search
@@ -0,0 +1,9 @@
|
||||
import { convertToModelMessages } from "ai";
|
||||
import type { UIMessage } from "ai";
|
||||
|
||||
export const convertAssistantMessagesToModelMessages = (messages: UIMessage[]) =>
|
||||
convertToModelMessages(messages, {
|
||||
// An aborted response can leave a streamed tool call in conversation history without a
|
||||
// result. Replaying it makes several OpenAI-compatible providers reject the whole prompt.
|
||||
ignoreIncompleteToolCalls: true,
|
||||
});
|
||||
Reference in new issue
Block a user