Responses
Read the answer through the model API’s familiar response format.
Text answers
For an OpenAI-compatible text completion, read choices[0].message.content. The following response is illustrative:
{
"id": "example-completion",
"object": "chat.completion",
"model": "YOUR_MODEL",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "It returns the sum of a and b."
},
"finish_reason": "stop"
}
]
}Tool calls
A response may ask your application to call a tool. Execute approved tools through your existing tool loop, then send their results in the next normal request. A tool-call response may have no text content.
Completion and usage
Check the finish reason and handle an answer that stops at an output limit. Usage fields are supplied by the model API and vary by provider. See Usage and cost for what those fields do and do not measure.
The Transductor is in early access. Join the waitlist.