diff --git a/libs/genai/langchain_google_genai/_function_utils.py b/libs/genai/langchain_google_genai/_function_utils.py index 1d683185..e1c245f7 100644 --- a/libs/genai/langchain_google_genai/_function_utils.py +++ b/libs/genai/langchain_google_genai/_function_utils.py @@ -365,7 +365,7 @@ def _get_type_from_schema(schema: Dict[str, Any]) -> int: types = [_get_type_from_schema(sub_schema) for sub_schema in schema["anyOf"]] types = [t for t in types if t is not None] # Remove None values if types: - return types[-1] # TODO: update FunctionDeclaration and pass all types? + return types[0] # TODO: update FunctionDeclaration and pass all types? else: pass elif "type" in schema: