Skip to main content

ChatCompletionChoice

indexIndex (integer)required
message objectrequired
roleRole (string)required

Possible values: [system, user, assistant, developer, tool, function]

content object
anyOf
string
reasoning_content object
anyOf
string
name object
anyOf
string
tool_calls object
anyOf
  • Array [
  • idId (string)required
    index object
    anyOf
    integer
    typeType (string)
    Constant value: function
    Default value: function
    function objectrequired
    idId (string)
    nameName (string)required
    argumentsArguments (string)required
  • ]
  • tool_call_id object
    anyOf
    string
    function_call object
    anyOf
    object
    logprobs object
    anyOf
    content object
    anyOf
  • Array [
  • tokenToken (string)required
    logprobLogprob (number)required
    bytes object
    anyOf
  • Array [
  • integer
  • ]
  • top_logprobs object[]required
  • Array [
  • tokenToken (string)required
    logprobLogprob (number)required
    bytes object
    anyOf
  • Array [
  • integer
  • ]
  • ]
  • ]
  • finish_reason object
    anyOf
    string

    Possible values: [stop, length, tool_calls, content_filter, function_call, error]

    ChatCompletionChoice
    {
    "index": 0,
    "message": {
    "role": "system",
    "content": "string",
    "reasoning_content": "string",
    "name": "string",
    "tool_calls": [
    {
    "id": "string",
    "index": 0,
    "type": "function",
    "function": {
    "id": "string",
    "name": "string",
    "arguments": "string"
    }
    }
    ],
    "tool_call_id": "string",
    "function_call": {}
    },
    "logprobs": {
    "content": [
    {
    "token": "string",
    "logprob": 0,
    "bytes": [
    0
    ],
    "top_logprobs": [
    {
    "token": "string",
    "logprob": 0,
    "bytes": [
    0
    ]
    }
    ]
    }
    ]
    },
    "finish_reason": "stop"
    }