diff --git a/crates/language_models/src/provider/google.rs b/crates/language_models/src/provider/google.rs index 4da5f255d20c3484ea2c055547552527081feea5..36a01a30c2b2297434fa2571596a2502ba17cde6 100644 --- a/crates/language_models/src/provider/google.rs +++ b/crates/language_models/src/provider/google.rs @@ -417,17 +417,19 @@ pub fn into_google( top_k: None, }), safety_settings: None, - tools: Some(vec![google_ai::Tool { - function_declarations: request - .tools - .into_iter() - .map(|tool| FunctionDeclaration { - name: tool.name, - description: tool.description, - parameters: tool.input_schema, - }) - .collect(), - }]), + tools: (request.tools.len() > 0).then(|| { + vec![google_ai::Tool { + function_declarations: request + .tools + .into_iter() + .map(|tool| FunctionDeclaration { + name: tool.name, + description: tool.description, + parameters: tool.input_schema, + }) + .collect(), + }] + }), tool_config: None, } }