@langchain/google@0.2.4
Patch Changes
-
#11426
2e865eaThanks @thushanth-bengre-langchain! - fix: keep image/audio/video content in ToolMessages as sibling Gemini parts instead of losing it inside functionResponse.response.result JSON, and stop double-stringifying non-string tool results (#10297, #10439) -
#11477
9a0f244Thanks @hntrl! - FixconvertMessagesToGeminiContentsmerging aToolMessage(functionResponse)
with a followingHumanMessage(text) into oneusercontent. Both map to the
userrole, and Vertex/Gemini rejects a singleusercontent that mixes a
functionResponsewith text, so a tool result followed by a user message would
fail with a 400. Merging is now limited to runs of adjacent tool results
(parallel tool calls), which the API requires to be grouped into one content;
all other same-role contents stay separate.Also fixes the v1 standard-content path, where a single
ToolMessagecould emit
ausercontent mixing itsfunctionResponsepart with text parts; tool turns
now carry only their functionResponse part(s), mirroring the legacy path.