openai-tools
Execute Openai Tool
Execute a tool call and return result in OpenAI format.
Accepts the tool_call object from an OpenAI response and returns the result ready to append to the messages array.
Example:
# After getting a tool_call from OpenAI
tool_call = response.choices[0].message.tool_calls[0]
# Execute it
result = requests.post(
"https://api.accurecord.io/tools/openai/execute",
headers={"X-API-Key": "your_key"},
json={
"id": tool_call.id,
"type": tool_call.type,
"function": {
"name": tool_call.function.name,
"arguments": tool_call.function.arguments
}
}
)
# Append to messages for next turn
messages.append(result.json())
post/tools/openai/execute
Request
- Base URL: https://api.accurecord.io (the document declares no server; this is the origin it was published from)
- URL: https://api.accurecord.io/tools/openai/execute
- Auth: none declared
Headers
x-api-keystring nullable
Request body
Response
Successful Response
object required
Changes
No recorded changes to this operation across all 1 revision of this API.