From cd365b0cf5cb432472b293bcbd7dc9d166a188a0 Mon Sep 17 00:00:00 2001 From: Bennet Bo Fenner Date: Thu, 24 Apr 2025 20:19:05 +0200 Subject: [PATCH] gemini: Fix issue when deserializing tool call (#29363) Fixes a regression introduced in #29322 Release Notes: - N/A Co-authored-by: Agus Zubiaga --- crates/google_ai/src/google_ai.rs | 1 - crates/language_models/src/provider/google.rs | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/google_ai/src/google_ai.rs b/crates/google_ai/src/google_ai.rs index 0772dab2f1..a20bedd890 100644 --- a/crates/google_ai/src/google_ai.rs +++ b/crates/google_ai/src/google_ai.rs @@ -334,7 +334,6 @@ pub struct CountTokensResponse { #[derive(Debug, Serialize, Deserialize)] pub struct FunctionCall { pub name: String, - pub raw_args: String, pub args: serde_json::Value, } diff --git a/crates/language_models/src/provider/google.rs b/crates/language_models/src/provider/google.rs index c3aeb0a36c..04da5d6c03 100644 --- a/crates/language_models/src/provider/google.rs +++ b/crates/language_models/src/provider/google.rs @@ -396,7 +396,6 @@ pub fn into_google( Some(Part::FunctionCallPart(google_ai::FunctionCallPart { function_call: google_ai::FunctionCall { name: tool_use.name.to_string(), - raw_args: tool_use.raw_input, args: tool_use.input, }, })) @@ -540,8 +539,8 @@ pub fn map_to_language_model_completion_events( is_input_complete: true, raw_input: function_call_part .function_call - .raw_args - .clone(), + .args + .to_string(), input: function_call_part.function_call.args, }, )));