mirror of
https://github.com/andy-stack/vaultkeeper-ai.git
synced 2026-07-22 06:42:03 +00:00
Fix duplicate function call messages in ChatWindow by removing placeholder message when function call is captured.
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
88901ec927
commit
43c31cf18d
1 changed files with 5 additions and 2 deletions
|
|
@ -116,8 +116,11 @@
|
|||
|
||||
if (chunk.isComplete) {
|
||||
isStreaming = false;
|
||||
// Only save the message if it has content or a function call
|
||||
if (accumulatedContent.trim() !== "" || capturedFunctionCall) {
|
||||
// If there's a function call, remove the placeholder message
|
||||
if (capturedFunctionCall) {
|
||||
conversation.contents = conversation.contents.filter((_, messageIndex) => messageIndex !== aiMessageIndex);
|
||||
} else if (accumulatedContent.trim() !== "") {
|
||||
// Only save the message if it has content and no function call
|
||||
conversation.contents = conversation.contents.map((msg, messageIndex) =>
|
||||
messageIndex === aiMessageIndex
|
||||
? { ...msg, content: accumulatedContent }
|
||||
|
|
|
|||
Loading…
Reference in a new issue