Merge pull request #1969 from kan-bayashi/fix/support-multiple-tools-in-gemini

fix: fix the issues when using tools in gemini
This commit is contained in:
Krish Dholakia 2024-02-21 11:46:26 -08:00 committed by GitHub
commit d1cd3073c3
2 changed files with 6 additions and 9 deletions

View file

@ -439,8 +439,8 @@ def completion(
tools=tools,
)
if tools is not None and hasattr(
response.candidates[0].content.parts[0], "function_call"
if tools is not None and bool(
getattr(response.candidates[0].content.parts[0], "function_call", None)
):
function_call = response.candidates[0].content.parts[0].function_call
args_dict = {}