File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
vertexai/generative_models Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -2378,7 +2378,13 @@ def respond_to_model_response(
2378
2378
)
2379
2379
callable_function = None
2380
2380
for tool in tools :
2381
- callable_function = tool ._callable_functions .get (function_call .name )
2381
+ new_callable_function = tool ._callable_functions .get (function_call .name )
2382
+ if new_callable_function and callable_function :
2383
+ raise ValueError (
2384
+ "Multiple functions with the same name are not supported."
2385
+ f" Found { callable_function } and { new_callable_function } ."
2386
+ )
2387
+ callable_function = new_callable_function
2382
2388
if not callable_function :
2383
2389
raise RuntimeError (
2384
2390
f"""Model has asked to call function "{ function_call .name } " which was not found."""
You can’t perform that action at this time.
0 commit comments