We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8544ab9 commit 33f3b17Copy full SHA for 33f3b17
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