From 6277c81ea96cd3bb2e355cfe185abd76750dce59 Mon Sep 17 00:00:00 2001 From: Carson Date: Fri, 2 Jan 2026 19:37:49 -0600 Subject: [PATCH 1/3] Fix MCP tools not working with ChatGoogle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Google provider was using FunctionDeclaration.from_callable() which introspected the wrapper function for MCP tools instead of using the pre-computed schema. This resulted in: - Wrong function name (_call instead of the actual tool name) - Empty/minimal description - No parameters (because **args has no type hints) Changed to use tool.schema["function"] directly to construct FunctionDeclaration with the correct name, description, and parameters. Added _strip_additional_properties() helper to remove additionalProperties from schemas since Google's API rejects this field. Fixes #257 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- CHANGELOG.md | 1 + chatlas/_provider_google.py | 35 +++++++++- .../test_tools_parallel.yaml | 20 +++--- .../test_tools_sequential.yaml | 30 ++++----- .../test_tools_simple.yaml | 67 ++++++++++--------- .../test_tools_simple_stream_content.yaml | 30 +++++---- 6 files changed, 109 insertions(+), 74 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be8db5b4..1511d89f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Fixed structured data extraction with `ChatAnthropic()` failing for Pydantic models containing nested types (e.g., `list[NestedModel]`). The issue was that `$defs` (containing nested type definitions) was incorrectly placed inside the schema, breaking JSON `$ref` pointer references. (#100) * Fixed MCP tools failing with OpenAI providers due to strict mode schema validation. OpenAI's strict mode rejects standard JSON Schema features like `format: "uri"` and requires all properties in the `required` array. MCP tools now set `strict=false` to use standard JSON Schema conventions. (#255) +* Fixed MCP tools not working with `ChatGoogle()`. The provider was using `FunctionDeclaration.from_callable()` which introspected the wrapper function instead of using the pre-computed schema, resulting in incorrect tool names and missing parameters. (#257) * Tool functions parameters that are `typing.Annotated` with a `pydantic.Field` (e.g., `def add(x: Annotated[int, Field(description="First number")])`) are now handled correctly. (#251) ## [0.14.0] - 2025-12-09 diff --git a/chatlas/_provider_google.py b/chatlas/_provider_google.py index 08815ffa..01a289b5 100644 --- a/chatlas/_provider_google.py +++ b/chatlas/_provider_google.py @@ -299,6 +299,7 @@ def _chat_perform_args( from google.genai.types import ( FunctionDeclaration, GenerateContentConfig, + Schema, ToolListUnion, ) from google.genai.types import Tool as GoogleTool @@ -336,11 +337,18 @@ def _chat_perform_args( gtool = GoogleTool.model_validate(tool.definition) google_tools.append(gtool) else: + func = tool.schema["function"] + params = func.get("parameters") gtool = GoogleTool( function_declarations=[ - FunctionDeclaration.from_callable( - client=self._client._api_client, - callable=tool.func, + FunctionDeclaration( + name=func["name"], + description=func.get("description", ""), + parameters=Schema.model_validate( + _strip_additional_properties(params) + ) + if params + else None, ) ] ) @@ -726,3 +734,24 @@ def ChatVertex( ), system_prompt=system_prompt, ) + + +def _strip_additional_properties(params: dict[str, Any]) -> dict[str, Any]: + """ + Recursively remove additionalProperties from JSON schema. + + Google's API doesn't accept additionalProperties in tool schemas, + so we strip it before passing to Schema.model_validate(). + """ + result = {k: v for k, v in params.items() if k != "additionalProperties"} + + if "properties" in result and isinstance(result["properties"], dict): + result["properties"] = { + k: _strip_additional_properties(v) if isinstance(v, dict) else v + for k, v in result["properties"].items() + } + + if "items" in result and isinstance(result["items"], dict): + result["items"] = _strip_additional_properties(result["items"]) + + return result diff --git a/tests/_vcr/test_provider_google/test_tools_parallel.yaml b/tests/_vcr/test_provider_google/test_tools_parallel.yaml index b2807df2..6cf16368 100644 --- a/tests/_vcr/test_provider_google/test_tools_parallel.yaml +++ b/tests/_vcr/test_provider_google/test_tools_parallel.yaml @@ -21,20 +21,20 @@ interactions: Host: - generativelanguage.googleapis.com x-goog-api-client: - - google-genai-sdk/1.56.0 gl-python/3.11.13 + - google-genai-sdk/1.56.0 gl-python/3.12.11 method: POST uri: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse response: body: string: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": {\"name\": \"favorite_color\",\"args\": {\"_person\": \"Joe\"}},\"thoughtSignature\": - \"CiQBcsjafEcxf/2DYJh2KLN0ZyvZXL8qb4eVwpfO1vMCbc+FiI4KdQFyyNp83WPKtw1VCcGDQEHMo5P3ZwwuQVnRgXLHuVpY6pIuISKWq2ahOuhS+R5bmNhTgWLnQZVizSzuoHQvYB+UKBpzHivSACk+/3ev+DdTh/yX3bDryuehMGmfRobrHcHgF14KX9WuMstDN2U8jDu667vWxwrLAQFyyNp8DHJkkPOE6BNUMI5kKtPnOrgc2WbCgjNj4NtwnieDVCXEWRhs8UvvI4bs6T20AHzhyvbVM/iZVcJ3pOWUxTy4vQlrVWQXXpkhMPdHUGNheP3AGhdqQWa7vF8AeR48TUhztTYntyMOwI4ZIkB0C5iqukbIOjGFwM820OpQoy/jfIgGpN0lWzEAek4i/mRiU2xyks5hnaq8OZ1Hb81rIPMFMrkhNp+ubM5H1ba6vpRv7TH3Lt53HsNJDLIqqvFvLxq+JtnjUGLT\"},{\"functionCall\": + \"CiQBcsjafMjxiJn3cWg1h7gi5wrPZplGeMGBGKbMKSrgBmOQ3ToKdQFyyNp8iRQFDsoj4U/xFCCuVdfsNoSR6oJhg9BkrMdgX3fMpRFugrAETa9LVnXWl/Nquk9tpc0s36K4w4enJeGRlWHXCj2xA0irMk3076hl1+cVvPB+AXzl1v+wkkCEKx2DmnmQWqMlEdCri/yhx4fbZB5PiQrLAQFyyNp883zKACGlUvM4xF23wAAyCGnBSfNIKbUa0KjfsoiPDhObJdVrtY1f2Y/eQsOx+Cwgg/Iwr4LyC+JpjYn/bhHDkgVQqHOKB8gpt9CSKQ9d5INULjjX7Ugx3wgg40sJXHDelBzi28F1UN+Fx5aVh7TTd1cMnoFqW7Hxsy4+7N+nabYJZY2pWO+z7WKv7p3YvETy7XdXm3FpNs3VUrBArs1oD+g+2fxOWR47loS9VOpVto5ChqbwSBCqks3B0SyhGuVBZp9E7Rqy\"},{\"functionCall\": {\"name\": \"favorite_color\",\"args\": {\"_person\": \"Hadley\"}}}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0,\"finishMessage\": \"Model generated function call(s).\"}],\"usageMetadata\": {\"promptTokenCount\": 80,\"candidatesTokenCount\": 31,\"totalTokenCount\": 170,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 80}],\"thoughtsTokenCount\": 59},\"modelVersion\": - \"gemini-2.5-flash\",\"responseId\": \"cLBVabe2A8vO_uMP5cWO6As\"}\r\n\r\n" + \"gemini-2.5-flash\",\"responseId\": \"_nBYaYTfOKOi_uMPi9GGwQ8\"}\r\n\r\n" headers: Alt-Svc: - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 @@ -43,11 +43,11 @@ interactions: Content-Type: - text/event-stream Date: - - Wed, 31 Dec 2025 23:23:28 GMT + - Sat, 03 Jan 2026 01:29:35 GMT Server: - scaffolding on HTTPServer2 Server-Timing: - - gfet4t7; dur=692 + - gfet4t7; dur=676 Transfer-Encoding: - chunked Vary: @@ -90,17 +90,17 @@ interactions: Host: - generativelanguage.googleapis.com x-goog-api-client: - - google-genai-sdk/1.56.0 gl-python/3.11.13 + - google-genai-sdk/1.56.0 gl-python/3.12.11 method: POST uri: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse response: body: string: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"Joe: - sage green, Hadley: red\",\"thoughtSignature\": \"CikBcsjafCFKwPhN+Wb7TRnVQm+ElR/oCeo2mzKEHS8+Td1xBPeskYdN9wp4AXLI2nxAYZCYcFksv72VZHK353YTaGKoZfPlEVRaIl7KUdIqjX5Fqp+roMh19jtTWOB9d3xXMjUas0i/gsWY2ViciwJa7btqli/mgp+Zq3Ew71pE9rJTjbI8R0lmZUhlVdNmh/c0WHOZ4Y6iJD1Zh3vJUq18D8M/CsoBAXLI2nwURNZLgw9xpPFG1JpY3HguQ6cf3vxQl+iwZ9bfJi7uCeXwIDUqRx3w7IDyl+Aa/arTIXU92vjedDK+ZstyokFtJ7pmVFaxPdq1LWTR9+/zFRB3sAUuthVUIal2LqILasEavLiWAS7cTKEHhccQ6kbqAi+L+RncuxWROgu2WHiE4ztR8PRIot8L/QWihzpVVrlV1W9iNKvx7hbT+533O8QvGQLYKQw1gpx/iGR6ZFquBIoivI74TROvLjv8PYfNoIcjeSbDZAqWAQFyyNp83amdQAwXMpsoAZYNgIdKqQTPe+mfG9h5uO0r37dTdcP1ThRHiX2Y1zjOHMm+Bmp24DuR07bzqVDjEaA7odnSQ1M8w3tkI3kvdzIMLNlFBZS52eeXiMzX43Z3CyY25K1UE+oYa4/dliVLvE7onCloSzNCN1Tqwvxueh9GiAhNb6H8dP/vKo4uLR7iEItQmFOxOw==\"}],\"role\": + sage green, Hadley: red\",\"thoughtSignature\": \"CikBcsjafEQ5li0668U/qtbZwgJcrUKj0K26qG5trR41aCc2n6OAg8RrCgp4AXLI2nxxfIx0rsAaGp0+hi9VwK3/OhGcod1MDqpE7u9TbArCnl1Tr6XHv6x4AdMFOj5eruifbd3Fp6RKTEsdWBLODM34IwgRcpd+PUv2OtfnZQpFogUi4j51ecgcAKU3BhEjWaAowhudur1P5a3kHOy32cm24XbPCsoBAXLI2nzPG4G4G9Zvjlvy6lVEFR3hFgK45p6TMcbTAQ6V4iUpHO4q7btbSV8nr3Pm52JZKPvbsq29uknE7qAbINQWD7nxW9lBGzSPzbwv0lrEbcNZgv7whdPnjD7cbL1wIVmTyHJVFlMXa0qGgz6ppeymdcjzj7af1pde3fllw+Mp4xyCzGyn22sP5alyPTbPvIAeXPjqSaj+NLYBXrWx6yQFVCi53XnS81DxHK3FzzN0433mj2wAfjMxMBmnNYlyXuVOUKfg40EKXgqWAQFyyNp8qdHQ5FJi7SgLe3qEIo0rY281iv9w2NB5t6iEvIsK/2htK3Zz0rr6g8lqGjcvN7tyXs0RDIwSzJQsjXvGk8KSEiUGxOIjnim2YG0eZkffJ1KImOf58eSwPaz6eK6f7ZtifJtb5yl1vHJJzmqE3zw5RCdQIZmSPwFRM+ArhjW38O1Robnap/CK+mragHe8r+b4Ug==\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 140,\"candidatesTokenCount\": 8,\"totalTokenCount\": 254,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 140}],\"thoughtsTokenCount\": 106},\"modelVersion\": - \"gemini-2.5-flash\",\"responseId\": \"cbBVafhco-H-4w_Uvp2JDA\"}\r\n\r\n" + \"gemini-2.5-flash\",\"responseId\": \"_3BYae7dONql_uMPt9e6qAw\"}\r\n\r\n" headers: Alt-Svc: - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 @@ -109,11 +109,11 @@ interactions: Content-Type: - text/event-stream Date: - - Wed, 31 Dec 2025 23:23:29 GMT + - Sat, 03 Jan 2026 01:29:36 GMT Server: - scaffolding on HTTPServer2 Server-Timing: - - gfet4t7; dur=806 + - gfet4t7; dur=813 Transfer-Encoding: - chunked Vary: diff --git a/tests/_vcr/test_provider_google/test_tools_sequential.yaml b/tests/_vcr/test_provider_google/test_tools_sequential.yaml index 11c87b11..d7fa334d 100644 --- a/tests/_vcr/test_provider_google/test_tools_sequential.yaml +++ b/tests/_vcr/test_provider_google/test_tools_sequential.yaml @@ -25,19 +25,19 @@ interactions: Host: - generativelanguage.googleapis.com x-goog-api-client: - - google-genai-sdk/1.56.0 gl-python/3.11.13 + - google-genai-sdk/1.56.0 gl-python/3.12.11 method: POST uri: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse response: body: string: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": {\"name\": \"weather_forecast\",\"args\": {\"city\": \"New York\"}},\"thoughtSignature\": - \"CiQBcsjafLhyUDj0UNUR/Cle08w8Gwk26TZE39p3vyKt16OwRUkKeQFyyNp8KBHPrbClayUb6w5qB/Vr5z4YB6hR1eVzthcXhg+nexjB+21eNjT3QXlDXIzZeEK5rHvh4L+PvoszJLCqsSCufU1ttqY2kV6oBfoRncFHrGXXDqdULOfaFUO7mZLlSWbH2+o2+bKv/XQYchOcVJojiD/iVQcKjAIBcsjafDNI0ijQGMe/V/Z7Gc8stGncDaoRPehWfgBWbr07kpSS2mYD6/S0x1dbcWFOUIiymmK9faP1iPyJAuh326GxuE3XlDDNcNjPkz8RzfvJq3VqKDU2bDqwQOYLdSxmc+/EUyhRF7gB9TI4UTi5uf5hlxsJESjUd7eVRzSxAZfPziu4+9XvKFcmoWSRcEc/mWtymikz2+vYsFmI8Hwxn+1nLBgX5RIOIz99TRCOtSXrWfu12r92oywUWQEq8jiAc3UzdRLUEh3U+v+U+fJhVKAZ0Jf1PM+vcrUZsG6tfnrZfZyO6J4/3m+KkGPkW9KTQHHMA6UR0pA55fVUN6Od1YBX/lrZ7uaUfhtCCl8BcsjafBkxjGNoR7pmBJraAR391rBQqiNlVuXKGKXe/4iRBx4Gd3gXMt6qWVsfebU5aOnPKxnFJOgRT22ER7usCEax7TPQnVh0vWon4VAUdX7DVtlX90tT0NLrCtTSag==\"}],\"role\": + \"CiQBcsjafACpV7G9rvFg/YUqr5jwsRi6YjR7sTD//u+elmtbYfgKbwFyyNp80DDvuelFbpI07IdJJg6JXLe8HyyCT3JxStjPiQ6P5zPGi85/67m0EHDE6+ynjzMGTkiwiUHe01H8Kj+FtopqVp+zMfE9IbuVBH/m0zYejdyEyo97gsgMnMWZGxM7vrCTNl/4KKRkVoNN5Qr9AQFyyNp8UZoxx1q/Fm3u67QEFP6lLXbyiFpDokV6Drcbwh74alJhpU14jqqiAO2/iuMdr+470VrEUpbyyeUS8/3UnahOKmdsfLUf2TNeYa9dncg5QuSe6nFwf5GCs2vTcC2Wmy6Yi9tvd63BEnEdMhJYGkk/62gKKIzGHofZW/Q93mUAIpjEFU9WTAcP4CZfMov91pNHBsJb9OGyzWc1dZKB6OhpIlAVAXmY4wpGzpXtx1wxxPGU7LSvYNNyHwmeI03IPdjUbiLFb96vZGZlb5b4qcffddrT6zHC/benaxpVLOW/gbV3OxQn8OMcjAzL46zI7KrFRbLnDYiQb6AKSgFyyNp8EizpyAaDFRQaEC2Iun1ljFL7UbERZwi4J338Abg5xkFWUZfZIAHfFwkBfQDj+fCGnwt1dCIUzCF0+1b5HUsVSMMWBg58\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0,\"finishMessage\": \"Model generated function call(s).\"}],\"usageMetadata\": {\"promptTokenCount\": - 133,\"candidatesTokenCount\": 16,\"totalTokenCount\": 232,\"promptTokensDetails\": - [{\"modality\": \"TEXT\",\"tokenCount\": 133}],\"thoughtsTokenCount\": 83},\"modelVersion\": - \"gemini-2.5-flash\",\"responseId\": \"crBVab6fBe6p_uMPycCNyAg\"}\r\n\r\n" + 133,\"candidatesTokenCount\": 16,\"totalTokenCount\": 226,\"promptTokensDetails\": + [{\"modality\": \"TEXT\",\"tokenCount\": 133}],\"thoughtsTokenCount\": 77},\"modelVersion\": + \"gemini-2.5-flash\",\"responseId\": \"AXFYaf3jA7qj_uMPuYjYCQ\"}\r\n\r\n" headers: Alt-Svc: - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 @@ -46,11 +46,11 @@ interactions: Content-Type: - text/event-stream Date: - - Wed, 31 Dec 2025 23:23:30 GMT + - Sat, 03 Jan 2026 01:29:37 GMT Server: - scaffolding on HTTPServer2 Server-Timing: - - gfet4t7; dur=781 + - gfet4t7; dur=741 Transfer-Encoding: - chunked Vary: @@ -94,7 +94,7 @@ interactions: Host: - generativelanguage.googleapis.com x-goog-api-client: - - google-genai-sdk/1.56.0 gl-python/3.11.13 + - google-genai-sdk/1.56.0 gl-python/3.12.11 method: POST uri: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse response: @@ -104,7 +104,7 @@ interactions: \"STOP\",\"index\": 0,\"finishMessage\": \"Model generated function call(s).\"}],\"usageMetadata\": {\"promptTokenCount\": 165,\"candidatesTokenCount\": 14,\"totalTokenCount\": 179,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 165}]},\"modelVersion\": - \"gemini-2.5-flash\",\"responseId\": \"dLBVaZqVHs2n_uMPx4K9wAw\"}\r\n\r\n" + \"gemini-2.5-flash\",\"responseId\": \"AnFYab6FA-6p_uMPycCNyAg\"}\r\n\r\n" headers: Alt-Svc: - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 @@ -113,11 +113,11 @@ interactions: Content-Type: - text/event-stream Date: - - Wed, 31 Dec 2025 23:23:32 GMT + - Sat, 03 Jan 2026 01:29:38 GMT Server: - scaffolding on HTTPServer2 Server-Timing: - - gfet4t7; dur=1731 + - gfet4t7; dur=443 Transfer-Encoding: - chunked Vary: @@ -164,7 +164,7 @@ interactions: Host: - generativelanguage.googleapis.com x-goog-api-client: - - google-genai-sdk/1.56.0 gl-python/3.11.13 + - google-genai-sdk/1.56.0 gl-python/3.12.11 method: POST uri: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse response: @@ -173,7 +173,7 @@ interactions: \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 192,\"candidatesTokenCount\": 1,\"totalTokenCount\": 193,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 192}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": - \"dbBVaY62Au6p_uMPycCNyAg\"}\r\n\r\n" + \"AnFYaZCxLt63_uMP172v6Q0\"}\r\n\r\n" headers: Alt-Svc: - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 @@ -182,11 +182,11 @@ interactions: Content-Type: - text/event-stream Date: - - Wed, 31 Dec 2025 23:23:33 GMT + - Sat, 03 Jan 2026 01:29:38 GMT Server: - scaffolding on HTTPServer2 Server-Timing: - - gfet4t7; dur=242 + - gfet4t7; dur=413 Transfer-Encoding: - chunked Vary: diff --git a/tests/_vcr/test_provider_google/test_tools_simple.yaml b/tests/_vcr/test_provider_google/test_tools_simple.yaml index 1d5734df..c2739eb7 100644 --- a/tests/_vcr/test_provider_google/test_tools_simple.yaml +++ b/tests/_vcr/test_provider_google/test_tools_simple.yaml @@ -4,7 +4,8 @@ interactions: format?"}], "role": "user"}], "systemInstruction": {"parts": [{"text": "Always use a tool to help you answer. Reply with ''It is ____.''."}], "role": "user"}, "tools": [{"functionDeclarations": [{"description": "Gets the current date", - "name": "get_date"}]}], "generationConfig": {"temperature": 0}}' + "name": "get_date", "parameters": {"properties": {}, "required": [], "type": + "OBJECT"}}]}], "generationConfig": {"temperature": 0}}' headers: Accept: - '*/*' @@ -13,24 +14,24 @@ interactions: Connection: - keep-alive Content-Length: - - '370' + - '438' Content-Type: - application/json Host: - generativelanguage.googleapis.com x-goog-api-client: - - google-genai-sdk/1.56.0 gl-python/3.11.13 + - google-genai-sdk/1.56.0 gl-python/3.12.11 method: POST uri: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse response: body: string: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": - {\"name\": \"get_date\",\"args\": {}},\"thoughtSignature\": \"CiQBcsjafNzESZdveMDmEjkE4qZnXmMa4sKyx4nyK57kkMnMH0IKZgFyyNp8yapbuMORCnjXYdyDmkV6zHmsIknDw6Fm5Py9MHRx66rHsX0LyMfEo80UU7zKwexioAHVFk0Ktlsk/XjMcoob7NB2ld/vpjlVt/Mzk67cAHm40YRbBHujxD4zNcu1LyYO0wqsAQFyyNp8AwTnk9hjMzfVZqoyplhzZ4Z/BPOLQ/kzpgqi3fJi5iFO095CR/sbBjo777rBECEuThdD7g943BCr0Zu1ygpksPBCbrObFxXFoF+5Py0kx7cPOlFiLzHtdW4XOsrCtfwMbXrd7RJ4dq9HcM5oh0eF9WuEn3fqvL44QXJFVurH+5UD7p8u9CN+/Z874BpfpjE2H6PanXFVEAZBPUyXmLb4HSs20dbKiUw=\"}],\"role\": + {\"name\": \"get_date\",\"args\": {}},\"thoughtSignature\": \"CiQBcsjafE7XPE0RQxyTvgCFswdQFU+EG9GWSChIJlKXLIqiMjUKZgFyyNp8W6kOEPWtocqXw6xuZnGXYc0YNk3Kq9ktgW1PfjBa9MJ4g0/NFec20pA5eX7tyfxjvxhmUfrTQme5rUDlhpccdoywGtu/KOX22VjRLTZ2KpEeeowbiSL2Sot/aUSSOAYBwAqsAQFyyNp8q0dCYfjVC3NY1QOBXVK3DBJHAgbMBqVeQvSWH581gBtcMY4DIIdfeDxADL5aOm/OwsWG5LmbYXRWMnmByOR1+h2kl8A0ZgCZyrAcp7oP+YayMzTZ8FfD7qrGYf4cB9YTwuf74IQHse4jOuU5MjAP0iX6cym0dVqpVOhYhLhVkNmHG2uX9lZWLM71ApS/fABI/IZbqo54Cnd2mzZTgQcFkukBR0XZADw=\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0,\"finishMessage\": \"Model generated function call(s).\"}],\"usageMetadata\": {\"promptTokenCount\": 59,\"candidatesTokenCount\": 10,\"totalTokenCount\": 118,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 59}],\"thoughtsTokenCount\": 49},\"modelVersion\": - \"gemini-2.5-flash\",\"responseId\": \"arBVacjXN4KV_uMP_ZfUmQI\"}\r\n\r\n" + \"gemini-2.5-flash\",\"responseId\": \"-nBYaaf-BZmg_PUP5e-68Qo\"}\r\n\r\n" headers: Alt-Svc: - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 @@ -39,11 +40,11 @@ interactions: Content-Type: - text/event-stream Date: - - Wed, 31 Dec 2025 23:23:23 GMT + - Sat, 03 Jan 2026 01:29:30 GMT Server: - scaffolding on HTTPServer2 Server-Timing: - - gfet4t7; dur=624 + - gfet4t7; dur=604 Transfer-Encoding: - chunked Vary: @@ -66,8 +67,8 @@ interactions: "response": {"result": "2024-01-01"}}}], "role": "user"}], "systemInstruction": {"parts": [{"text": "Always use a tool to help you answer. Reply with ''It is ____.''."}], "role": "user"}, "tools": [{"functionDeclarations": [{"description": - "Gets the current date", "name": "get_date"}]}], "generationConfig": {"temperature": - 0}}' + "Gets the current date", "name": "get_date", "parameters": {"properties": {}, + "required": [], "type": "OBJECT"}}]}], "generationConfig": {"temperature": 0}}' headers: Accept: - '*/*' @@ -76,23 +77,23 @@ interactions: Connection: - keep-alive Content-Length: - - '563' + - '631' Content-Type: - application/json Host: - generativelanguage.googleapis.com x-goog-api-client: - - google-genai-sdk/1.56.0 gl-python/3.11.13 + - google-genai-sdk/1.56.0 gl-python/3.12.11 method: POST uri: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse response: body: string: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"It - is 2024-01-01.\",\"thoughtSignature\": \"CikBcsjafGgEqBjN+08sHu/3MdzQ74/+8Grbvn3eEiXxPWumfFzdlnIpvApWAXLI2nwkO9g646klKXjWrf5cjSHiUn9rAo17DQ6N8cl21Wd/tWO3jsnW+WYysnPKUayN4ASfhVRWromaJ9mcwMZ/g8tevRH2J7rDY6aEoasK2+RYh9AKtwEBcsjafDNQC7HsaSojz3d65iz8dWYnMZpl4I2+J8kbIcHHiOZYVbE+0/nLYL5L8mqRkoABLRWnF04rJlINheb1YjVz0dVTECq1otXAmxrAbFQ/WTPVcXtWZn3Zwvb9hQqdNTe0jCyv2Yf0FWhPL0d39gUhxeRshRildfOtVWzplrW+ABkg5G0VqvbPe0KgkGFgxDWq0tx7s4NjQ4i7fhhIL0cfpbIsGGXFQoXHL6aB6x9CXrSqaBIKqwEBcsjafNgWOpdgULf13wXACOdZoggNPFF8zsuXgtZJ6iIQRx3YP1L88iULEGrZp2jKKAEPLhC9p4H4UNyrTjbRF8KhLlpQrbV+e3XQc9EIfH2V34whtFTfZGvo1QbeYizvWy0MsnbhHPDNQ2Ioq8zuKJCSu2tr0eo+sQEWxwDecm8ZxkffwUUkrsiYCvLJkCOuuEZGitqkkfUn4mXS7959h8XZNJX9UaSscVI=\"}],\"role\": + is 2024-01-01.\",\"thoughtSignature\": \"CikBcsjafCp7ZFHWd9i1Blcv9Lbyfql1wNhD+z8VnVTR7dNpkWRwm0kxZQpWAXLI2nyLvkf3bY4vU9D8AEHXBjsoSNVq0Ub0r1T6/XlX/crjFn9WF97nqspN/zXjWfSgQXWLXGYAcSDZ5zTO0giFsImUOGZOSrQnCdwIZX1NO24BspsKtwEBcsjafGAu6GHMb9zLOF99G3oFcvj/86BuUx3D9rFSDrdJ2k/fXM7La96PhsGCA+xO8gCnZGO7G2+TMQlU9b6n2g4Sxmv555NDdjOV6aBq1cOsZnvp15uDRtzY8IARJZ99duNRfszb/lGkEhTqmDk6hqW/CstTqYabGhCym7KqaotDG6198/KFJe5pJUFHLYcVPi0UBUCFxt37b8VNa93ojQy8q1y1+UKSZLAiqn5LTEnjz7tt6dIKqwEBcsjafNLxM7j3/bzcyD5/ABl94TUZl0TxXk8dukb9U8H0CmvfstpGcpl0geMR4plKjYBXUNYer1P/AiNMjTYOBEEu8ZVIiXkpuEOztWoq0Pn/OJqAj8sCSpx5Q8WHWBYS6GFVfdDsUr2ZOJtl4mK5KUorl/quEtewdMi2eqdTb4a97gzxXsI+fdoMitc4jhk9xueGOJtKJgsX9v2mSnm+R59i4UlbdUaN+8k=\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 93,\"candidatesTokenCount\": 14,\"totalTokenCount\": 207,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 93}],\"thoughtsTokenCount\": 100},\"modelVersion\": - \"gemini-2.5-flash\",\"responseId\": \"a7BVae-nLNql_uMPt9e6qAw\"}\r\n\r\n" + \"gemini-2.5-flash\",\"responseId\": \"-nBYafSNOdCT_uMP8oG9kQk\"}\r\n\r\n" headers: Alt-Svc: - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 @@ -101,11 +102,11 @@ interactions: Content-Type: - text/event-stream Date: - - Wed, 31 Dec 2025 23:23:24 GMT + - Sat, 03 Jan 2026 01:29:31 GMT Server: - scaffolding on HTTPServer2 Server-Timing: - - gfet4t7; dur=881 + - gfet4t7; dur=897 Transfer-Encoding: - chunked Vary: @@ -130,7 +131,8 @@ interactions: it? Provide the full name."}], "role": "user"}], "systemInstruction": {"parts": [{"text": "Always use a tool to help you answer. Reply with ''It is ____.''."}], "role": "user"}, "tools": [{"functionDeclarations": [{"description": "Gets the - current date", "name": "get_date"}]}], "generationConfig": {"temperature": 0}}' + current date", "name": "get_date", "parameters": {"properties": {}, "required": + [], "type": "OBJECT"}}]}], "generationConfig": {"temperature": 0}}' headers: Accept: - '*/*' @@ -139,24 +141,24 @@ interactions: Connection: - keep-alive Content-Length: - - '707' + - '775' Content-Type: - application/json Host: - generativelanguage.googleapis.com x-goog-api-client: - - google-genai-sdk/1.56.0 gl-python/3.11.13 + - google-genai-sdk/1.56.0 gl-python/3.12.11 method: POST uri: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse response: body: string: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": - {\"name\": \"get_date\",\"args\": {}},\"thoughtSignature\": \"CiQBcsjafBsfUuO13AFKM7nfkhjI3trRWF0ulst74WWDkxtV5I0KXQFyyNp8VfB3QCh5gvvMB/Tsru+mX15WurBIciDHwcsN+S4+a62D4ypLIq2jn0bNhKvVukd6IM9Dx7CA7OSYRM5CtS52Z+YWYH9HSL04dTmboSBBwUy4i0qGDQFxQQqiAQFyyNp8IoV85jyHgyxvvJtYUQOSVkK0Ia3gTH/GEIakcsYys1YxbXYHBljcepg/gol6l4MPShsQ+eEXea8/tSZNwSE/XxbDOwj+G/BElf/+et8nq6klSHs1y9G7p227baKh4LbFgmi4CfUHDDYSEtQgSa1cFW8oaEf/1QPhkQeS1scOc2wh3ez1h1/BDPGJ7k/1zJ85rFmKuZtY8y4hFi0r+w==\"}],\"role\": + {\"name\": \"get_date\",\"args\": {}},\"thoughtSignature\": \"CiQBcsjafNPaW/gDVL24E4Svh5E8oWrZj6UKroG4Pihc7FyLtc0KXQFyyNp8b22yjq52P1nFo/gyUMfST90SFFPZCMYjgedCLUguPk5tLhgEdhmITyRXx8F32qZ5/35oCwSCiCLVK+v63+Dpegrv/dRcnaQE7fqt6f3HZ8vCwfdycg8rrAquAQFyyNp84irYpOOL7ITQPAGgkNl+oi/TgZzN7/3A56+4in6mKVH57F0bOXDJPykqpgtphOlSctQ5Q9fxRHDklw8bvMS6/kY7FJ1ySaZtXJpFdB/S4/n+JmRin/V40zRODNRGlZcdl6sOw1967rewNjECyc0Rj2Ltm0UxEuVeHLSUwR6eGO/HYIg0N9/zbQl+WkLsSSmSSzO4CDfly9hGmNBN2ODCjyMk4WHZ9Kbbow==\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0,\"finishMessage\": \"Model generated function call(s).\"}],\"usageMetadata\": {\"promptTokenCount\": 119,\"candidatesTokenCount\": 10,\"totalTokenCount\": 180,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 119}],\"thoughtsTokenCount\": 51},\"modelVersion\": - \"gemini-2.5-flash\",\"responseId\": \"bLBVadftOM26_uMPx_uNmAI\"}\r\n\r\n" + \"gemini-2.5-flash\",\"responseId\": \"-3BYaeuzOfCm_uMPxYvX0AI\"}\r\n\r\n" headers: Alt-Svc: - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 @@ -165,11 +167,11 @@ interactions: Content-Type: - text/event-stream Date: - - Wed, 31 Dec 2025 23:23:25 GMT + - Sat, 03 Jan 2026 01:29:32 GMT Server: - scaffolding on HTTPServer2 Server-Timing: - - gfet4t7; dur=717 + - gfet4t7; dur=556 Transfer-Encoding: - chunked Vary: @@ -196,7 +198,8 @@ interactions: {"name": "get_date", "response": {"result": "2024-01-01"}}}], "role": "user"}], "systemInstruction": {"parts": [{"text": "Always use a tool to help you answer. Reply with ''It is ____.''."}], "role": "user"}, "tools": [{"functionDeclarations": - [{"description": "Gets the current date", "name": "get_date"}]}], "generationConfig": + [{"description": "Gets the current date", "name": "get_date", "parameters": + {"properties": {}, "required": [], "type": "OBJECT"}}]}], "generationConfig": {"temperature": 0}}' headers: Accept: @@ -206,13 +209,13 @@ interactions: Connection: - keep-alive Content-Length: - - '900' + - '968' Content-Type: - application/json Host: - generativelanguage.googleapis.com x-goog-api-client: - - google-genai-sdk/1.56.0 gl-python/3.11.13 + - google-genai-sdk/1.56.0 gl-python/3.12.11 method: POST uri: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse response: @@ -221,11 +224,11 @@ interactions: is January.\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 153,\"candidatesTokenCount\": 4,\"totalTokenCount\": 157,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 153}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": - \"bbBVaejXMpmn_uMP-r6TOA\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"role\": - \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": - 153,\"candidatesTokenCount\": 4,\"totalTokenCount\": 157,\"promptTokensDetails\": - [{\"modality\": \"TEXT\",\"tokenCount\": 153}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": - \"bbBVaejXMpmn_uMP-r6TOA\"}\r\n\r\n" + \"_HBYaZqqK4eU_uMP3LyzuQ4\"}\r\n\r\ndata: {\"candidates\": [{\"content\": + {\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": + {\"promptTokenCount\": 153,\"candidatesTokenCount\": 4,\"totalTokenCount\": + 157,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 153}]},\"modelVersion\": + \"gemini-2.5-flash\",\"responseId\": \"_HBYaZqqK4eU_uMP3LyzuQ4\"}\r\n\r\n" headers: Alt-Svc: - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 @@ -234,11 +237,11 @@ interactions: Content-Type: - text/event-stream Date: - - Wed, 31 Dec 2025 23:23:25 GMT + - Sat, 03 Jan 2026 01:29:32 GMT Server: - scaffolding on HTTPServer2 Server-Timing: - - gfet4t7; dur=314 + - gfet4t7; dur=266 Transfer-Encoding: - chunked Vary: diff --git a/tests/_vcr/test_provider_google/test_tools_simple_stream_content.yaml b/tests/_vcr/test_provider_google/test_tools_simple_stream_content.yaml index 5292a3d0..8aeaa7f8 100644 --- a/tests/_vcr/test_provider_google/test_tools_simple_stream_content.yaml +++ b/tests/_vcr/test_provider_google/test_tools_simple_stream_content.yaml @@ -3,7 +3,8 @@ interactions: body: '{"contents": [{"parts": [{"text": "What''s the current date in YYYY-MM-DD format?"}], "role": "user"}], "systemInstruction": {"parts": [{"text": "Be very terse, not even punctuation."}], "role": "user"}, "tools": [{"functionDeclarations": - [{"description": "Gets the current date", "name": "get_date"}]}], "generationConfig": + [{"description": "Gets the current date", "name": "get_date", "parameters": + {"properties": {}, "required": [], "type": "OBJECT"}}]}], "generationConfig": {"temperature": 0}}' headers: Accept: @@ -13,24 +14,24 @@ interactions: Connection: - keep-alive Content-Length: - - '343' + - '411' Content-Type: - application/json Host: - generativelanguage.googleapis.com x-goog-api-client: - - google-genai-sdk/1.56.0 gl-python/3.11.13 + - google-genai-sdk/1.56.0 gl-python/3.12.11 method: POST uri: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse response: body: string: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": - {\"name\": \"get_date\",\"args\": {}},\"thoughtSignature\": \"CiQBcsjafGO8Vki8czTsW+3rHWzD3QmjMZHM2XZgIyUD/v0bX3cKcAFyyNp87W6OFVaofQs3m8ToIRmOFgEAI4+3NKugRKmrshHhjw0pqRULJ6drwxv3r+99cmrSp5M/13okFO5OAtAQkVH+p64TdUSwj2vlrcSzF/OuK4STE4MEI5O+UP1D5mivyqQ201c1aZd22I/ae4MKlQEBcsjafNDEYEm5Qw7BdmO1vxeDQ3i7J4VJNKv5/FSQYhQDW3Z9XHeDWsMRncHYQD724nI2g27rTOoIxw7+L2wI6FQDx4zH7vio5ioaw9NPgYgGhMyFOqZ4j332yxTSK2kkaZMUTr7YybnMI+I/Fpsa8l6WtbHSmyFNR8xHT0PPmeGEMk6L3FBPBqpUTiKwrNeCUqwkgg==\"}],\"role\": + {\"name\": \"get_date\",\"args\": {}},\"thoughtSignature\": \"CiQBcsjafE9eWGiadGJJTJOL/qzQ8PR+U2+tUgjiMrMZ7XHKr9YKcAFyyNp8+AqF+TpTbQOQwoLL0EHvfR1ZTS1toVSmjVsdUIeV7CdQkhtv8aMOpIXLE+FQQy0/Lk7nNZ8CW7Ei5tc0JfS+LApvnXn7PP+8B3r7EJZdRFcFC4YZdqWkrKWTwaz35COYxXuv8taX3nhB2GQKlQEBcsjafDrxMBZDDt/PXsp4UQgCR0yXNu2QDG18urPBwgIDR6a/OHVWGhZUuRYxkk4wjHg+E2ABeGbGgQ/5w90LsrgAylwUVDbUCr7Qzd+c12ZjI44YLXaeIwHsjGZcYcmAfYxFCRswf/NNXP4FewXBVVc/XPQ+q1P/yvLZG4cmf2tk1FXFdpj95+g0fcwOzZ/QlwUEgw==\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0,\"finishMessage\": \"Model generated function call(s).\"}],\"usageMetadata\": {\"promptTokenCount\": 51,\"candidatesTokenCount\": 10,\"totalTokenCount\": 104,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 51}],\"thoughtsTokenCount\": 43},\"modelVersion\": - \"gemini-2.5-flash\",\"responseId\": \"brBVaYO3JfuN_uMP6v24QA\"}\r\n\r\n" + \"gemini-2.5-flash\",\"responseId\": \"_XBYabbFCfrO_uMP34qY-Qw\"}\r\n\r\n" headers: Alt-Svc: - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 @@ -39,11 +40,11 @@ interactions: Content-Type: - text/event-stream Date: - - Wed, 31 Dec 2025 23:23:26 GMT + - Sat, 03 Jan 2026 01:29:33 GMT Server: - scaffolding on HTTPServer2 Server-Timing: - - gfet4t7; dur=656 + - gfet4t7; dur=779 Transfer-Encoding: - chunked Vary: @@ -66,7 +67,8 @@ interactions: "response": {"result": "2024-01-01"}}}], "role": "user"}], "systemInstruction": {"parts": [{"text": "Be very terse, not even punctuation."}], "role": "user"}, "tools": [{"functionDeclarations": [{"description": "Gets the current date", - "name": "get_date"}]}], "generationConfig": {"temperature": 0}}' + "name": "get_date", "parameters": {"properties": {}, "required": [], "type": + "OBJECT"}}]}], "generationConfig": {"temperature": 0}}' headers: Accept: - '*/*' @@ -75,13 +77,13 @@ interactions: Connection: - keep-alive Content-Length: - - '536' + - '604' Content-Type: - application/json Host: - generativelanguage.googleapis.com x-goog-api-client: - - google-genai-sdk/1.56.0 gl-python/3.11.13 + - google-genai-sdk/1.56.0 gl-python/3.12.11 method: POST uri: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse response: @@ -89,12 +91,12 @@ interactions: string: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"2024\"}],\"role\": \"model\"},\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 85,\"candidatesTokenCount\": 4,\"totalTokenCount\": 89,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": - 85}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"b7BVaZP1GvuN_uMP6v24QA\"}\r\n\r\ndata: + 85}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"_nBYabfUGO7X_uMPwtnYgAo\"}\r\n\r\ndata: {\"candidates\": [{\"content\": {\"parts\": [{\"text\": \"-01-01\"}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 85,\"candidatesTokenCount\": 10,\"totalTokenCount\": 95,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 85}]},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": - \"b7BVaZP1GvuN_uMP6v24QA\"}\r\n\r\n" + \"_nBYabfUGO7X_uMPwtnYgAo\"}\r\n\r\n" headers: Alt-Svc: - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 @@ -103,11 +105,11 @@ interactions: Content-Type: - text/event-stream Date: - - Wed, 31 Dec 2025 23:23:27 GMT + - Sat, 03 Jan 2026 01:29:34 GMT Server: - scaffolding on HTTPServer2 Server-Timing: - - gfet4t7; dur=383 + - gfet4t7; dur=330 Transfer-Encoding: - chunked Vary: From ca566eac95d6fa67601c3d5c63bffffa7f5303cb Mon Sep 17 00:00:00 2001 From: Carson Sievert Date: Mon, 5 Jan 2026 11:41:46 -0600 Subject: [PATCH 2/3] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1511d89f..45b5cbc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,7 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Fixed structured data extraction with `ChatAnthropic()` failing for Pydantic models containing nested types (e.g., `list[NestedModel]`). The issue was that `$defs` (containing nested type definitions) was incorrectly placed inside the schema, breaking JSON `$ref` pointer references. (#100) * Fixed MCP tools failing with OpenAI providers due to strict mode schema validation. OpenAI's strict mode rejects standard JSON Schema features like `format: "uri"` and requires all properties in the `required` array. MCP tools now set `strict=false` to use standard JSON Schema conventions. (#255) -* Fixed MCP tools not working with `ChatGoogle()`. The provider was using `FunctionDeclaration.from_callable()` which introspected the wrapper function instead of using the pre-computed schema, resulting in incorrect tool names and missing parameters. (#257) +* Fixed MCP tools not working with `ChatGoogle()`. (#257) * Tool functions parameters that are `typing.Annotated` with a `pydantic.Field` (e.g., `def add(x: Annotated[int, Field(description="First number")])`) are now handled correctly. (#251) ## [0.14.0] - 2025-12-09 From 8671aee9848951fd98ed2d332b4c711a9649fe25 Mon Sep 17 00:00:00 2001 From: Carson Date: Mon, 5 Jan 2026 11:42:28 -0600 Subject: [PATCH 3/3] Allow for None --- chatlas/_provider_google.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chatlas/_provider_google.py b/chatlas/_provider_google.py index 01a289b5..f4b33555 100644 --- a/chatlas/_provider_google.py +++ b/chatlas/_provider_google.py @@ -343,7 +343,7 @@ def _chat_perform_args( function_declarations=[ FunctionDeclaration( name=func["name"], - description=func.get("description", ""), + description=func.get("description"), parameters=Schema.model_validate( _strip_additional_properties(params) )