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