fix(AgentMessageComponent): 修复部分场景下未返回 reasoning_content 的问题 #261

This commit is contained in:
Wenjie Zhang 2025-09-11 02:11:06 +08:00
parent 04f49f48d5
commit e7137b883b

View File

@ -148,6 +148,13 @@ const parsedData = computed(() => {
let content = props.message.content.trim() || '';
let reasoning_content = props.message.additional_kwargs?.reasoning_content || '';
if (reasoning_content) {
return {
content,
reasoning_content,
}
}
// Regex to find <think>...</think> or an unclosed <think>... at the end of the string.
const thinkRegex = /<think>(.*?)<\/think>|<think>(.*?)$/s;
const thinkMatch = content.match(thinkRegex);