diff --git a/examples/studio/chat/chat_function_calling_multiple_tools.py b/examples/studio/chat/chat_function_calling_multiple_tools.py index 34b3c130..b61deeb2 100644 --- a/examples/studio/chat/chat_function_calling_multiple_tools.py +++ b/examples/studio/chat/chat_function_calling_multiple_tools.py @@ -78,7 +78,7 @@ def get_sunset_hour(place: str, date: str) -> str: """ AI models can be error-prone, it's crucial to ensure that the tool calls align with the expectations. The below code snippet demonstrates how to handle tool calls in the response and invoke the tool function -to get the delivery date for the user's order. After retrieving the delivery date, we pass the response back +to get the weather forcast and expected sunset hour. After retrieving them, we pass the responses back to the AI model to continue the conversation, using the ToolMessage object. """ assistant_message = response.choices[0].message @@ -100,7 +100,7 @@ def get_sunset_hour(place: str, date: str) -> str: print(f"Got unexpected arguments in function call - {args}") elif tool_call.function.name == "get_sunset_hour": - """Verify get_sunset_hour tool call arguments and invoke the function to get the weather forecast:""" + """Verify get_sunset_hour tool call arguments and invoke the function to get the sunset hour:""" func_arguments = tool_call.function.arguments args = json.loads(func_arguments) @@ -116,7 +116,7 @@ def get_sunset_hour(place: str, date: str) -> str: print("No tool calls found") if too_call_id_to_result: - """Continue the conversation by passing the sunset and weather back to the AI model:""" + """Continue the conversation by passing the sunset and weather info back to the AI model:""" for tool_id_called, result in too_call_id_to_result.items(): tool_message = ToolMessage(role="tool", tool_call_id=tool_id_called, content=str(result))