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

This commit is contained in:
cronoik-inceptionai 2025-07-02 16:55:49 +04:00 committed by GitHub
parent 706ff13224
commit b95877509b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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: