Skip to content

Commit 63b7268

Browse files
authored
fix(@langchain/google) Duplicate function call (#10493)
1 parent 75e9d56 commit 63b7268

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

.changeset/tough-facts-cough.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@langchain/google": patch
3+
---
4+
5+
Undo regression introduced in #10397 in legacy content processing path.
6+
Fixes issues with a false duplicate functionCall sent in response (#10474).

libs/providers/langchain-google/src/converters/messages.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -736,18 +736,6 @@ function convertLegacyContentMessageToGeminiContent(
736736
}
737737
}
738738

739-
// Convert AIMessage tool_calls to functionCall parts
740-
if (AIMessage.isInstance(message) && message.tool_calls?.length) {
741-
for (const toolCall of message.tool_calls) {
742-
parts.push({
743-
functionCall: {
744-
name: toolCall.name,
745-
args: toolCall.args ?? {},
746-
},
747-
} as Gemini.Part.FunctionCall);
748-
}
749-
}
750-
751739
// Handle tool messages as function responses
752740
if (ToolMessage.isInstance(message) && message.tool_call_id) {
753741
const responseContent =

0 commit comments

Comments
 (0)