Unverified Commit b9587750 authored by cronoik-inceptionai's avatar cronoik-inceptionai Committed by GitHub
Browse files

Documentation update tool_calling: mapping back to function from response (#20373)

parent 706ff132
...@@ -53,7 +53,7 @@ Next, make a request to the model that should result in it using the available t ...@@ -53,7 +53,7 @@ Next, make a request to the model that should result in it using the available t
tool_call = response.choices[0].message.tool_calls[0].function tool_call = response.choices[0].message.tool_calls[0].function
print(f"Function called: {tool_call.name}") print(f"Function called: {tool_call.name}")
print(f"Arguments: {tool_call.arguments}") print(f"Arguments: {tool_call.arguments}")
print(f"Result: {get_weather(**json.loads(tool_call.arguments))}") print(f"Result: {tool_functions[tool_call.name](**json.loads(tool_call.arguments))}")
``` ```
Example output: Example output:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment