Content-Length: 270478 | pFad | https://github.com/googleapis/python-aiplatform/commit/58e6ac9b14daa42dc64d787156070c22bd7a1655

12 fix: GenAI - Fixed handling of multiple tools in `AutomaticFunctionCa… · googleapis/python-aiplatform@58e6ac9 · GitHub
Skip to content

Commit 58e6ac9

Browse files
Ark-kuncopybara-github
authored andcommitted
fix: GenAI - Fixed handling of multiple tools in AutomaticFunctionCallingResponder
PiperOrigin-RevId: 632316936
1 parent 5a300c1 commit 58e6ac9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

vertexai/generative_models/_generative_models.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2378,7 +2378,13 @@ def respond_to_model_response(
23782378
)
23792379
callable_function = None
23802380
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
23822388
if not callable_function:
23832389
raise RuntimeError(
23842390
f"""Model has asked to call function "{function_call.name}" which was not found."""

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/googleapis/python-aiplatform/commit/58e6ac9b14daa42dc64d787156070c22bd7a1655

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy