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

This commit is contained in:
cronoik-inceptionai
2025-07-02 05:55:49 -07:00
committed by GitHub
parent 706ff13224
commit b95877509b
+1 -1
View File
@@ -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
print(f"Function called: {tool_call.name}")
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: