From 6dc2169aa3cec0b4dac904cf647cba88ae96fa4b Mon Sep 17 00:00:00 2001 From: amirk Date: Wed, 21 Aug 2024 18:33:49 +0300 Subject: [PATCH 1/2] fix: example text --- examples/studio/chat/chat_function_calling_multiple_tools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/studio/chat/chat_function_calling_multiple_tools.py b/examples/studio/chat/chat_function_calling_multiple_tools.py index 34b3c130..caf622bf 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 @@ -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)) From 8291e9a9543f29550eb4bf6e5a62c8bfd4debb6e Mon Sep 17 00:00:00 2001 From: amirk Date: Wed, 21 Aug 2024 18:38:44 +0300 Subject: [PATCH 2/2] fix: example text --- examples/studio/chat/chat_function_calling_multiple_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/studio/chat/chat_function_calling_multiple_tools.py b/examples/studio/chat/chat_function_calling_multiple_tools.py index caf622bf..b61deeb2 100644 --- a/examples/studio/chat/chat_function_calling_multiple_tools.py +++ b/examples/studio/chat/chat_function_calling_multiple_tools.py @@ -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)