fix function calling mistral large latest

This commit is contained in:
Ishaan Jaff 2024-05-15 16:05:17 -07:00
parent e518b1e6c1
commit f2e8b2500f

View file

@ -105,6 +105,9 @@ def test_parallel_function_call(model):
# Step 4: send the info for each function call and function response to the model
for tool_call in tool_calls:
function_name = tool_call.function.name
if function_name not in available_functions:
# the model called a function that does not exist in available_functions - don't try calling anything
return
function_to_call = available_functions[function_name]
function_args = json.loads(tool_call.function.arguments)
function_response = function_to_call(