We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f9ce14c commit ba3c4eaCopy full SHA for ba3c4ea
src/google/adk/tools/function_tool.py
@@ -134,12 +134,11 @@ def _preprocess_args(
134
try:
135
136
adapter = self._type_adapter_cache[target_type]
137
- except (KeyError, TypeError):
+ except TypeError:
138
adapter = pydantic.TypeAdapter(target_type)
139
- try:
140
- self._type_adapter_cache[target_type] = adapter
141
- except TypeError:
142
- pass
+ except KeyError:
+ adapter = pydantic.TypeAdapter(target_type)
+ self._type_adapter_cache[target_type] = adapter
143
converted_args[param_name] = adapter.validate_python(
144
args[param_name]
145
)
0 commit comments