mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-05-20 15:43:44 +00:00
Fix type check for 'thinking' in message content (#2964)
* Fix type check for 'thinking' in message content When Gemini via Vertex AI returns content as a string inside an array, the in operator throws TypeError because it can't be used on primitives. * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Zil6n <136249885+Zil6n@users.noreply.github.com> Co-authored-by: Willem Jiang <willem.jiang@gmail.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
6d611c2bf6
commit
4538c32298
@ -251,7 +251,7 @@ export function extractReasoningContentFromMessage(message: Message) {
|
||||
}
|
||||
if (Array.isArray(message.content)) {
|
||||
const part = message.content[0];
|
||||
if (part && "thinking" in part) {
|
||||
if (part && typeof part === "object" && "thinking" in part) {
|
||||
return part.thinking as string;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user