Extract message content from direct_response tool call args and display it as the message content when tool call completes. Note: This is a workaround. The message is not streamed because direct_response uses tool calling mechanism where args are JSON, not natural language text that can be streamed directly.
This commit is contained in:
parent
d1ce339090
commit
2c90cd0378
|
|
@ -62,6 +62,11 @@ export function mergeMessage(message: Message, event: ChatEvent) {
|
||||||
toolCall.args = safeParseToolArgs(toolCall.argsChunks.join(""));
|
toolCall.args = safeParseToolArgs(toolCall.argsChunks.join(""));
|
||||||
delete toolCall.argsChunks;
|
delete toolCall.argsChunks;
|
||||||
}
|
}
|
||||||
|
// Handle direct_response tool: extract message content for display
|
||||||
|
if (toolCall.name === "direct_response" && toolCall.args?.message) {
|
||||||
|
message.content = toolCall.args.message as string;
|
||||||
|
message.contentChunks = [message.content];
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue