class

OpenAI::Response

Inherits JSON::Serializable < Reference < Object

Constructors

new(id : String = "", object : ResponseObject = ResponseObject::Response, status : ResponseStatus | Nil = nil, created_at : Float64 = 0.0, error : ResponseError = nil, incomplete_details : ResponseIncompleteDetails = nil, output : Array(OutputItem) = [] of OutputItem, instructions : ResponseInstructions = nil, output_text : ResponseOutputText | Nil = nil, usage : ResponseUsage | Nil = nil, parallel_tool_calls : Bool = false, conversation : ResponseConversation | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

conversation
Source
conversation=(conversation : ResponseConversation | Nil)
Source
created_at

Unix timestamp (in seconds) of when this Response was created.

Source
created_at=(created_at : Float64)

Unix timestamp (in seconds) of when this Response was created.

Source
error
Source
error=(error : ResponseError)
Source
id

Unique identifier for this Response.

Source
id=(id : String)

Unique identifier for this Response.

Source
incomplete_details
Source
incomplete_details=(incomplete_details : ResponseIncompleteDetails)
Source
instructions
Source
instructions=(instructions : ResponseInstructions)
Source
object

The object type of this resource - always set to response.

Source
object=(object : ResponseObject)

The object type of this resource - always set to response.

Source
output

An array of content items generated by the model.

  • The length and order of items in the output array is dependent on the model's response.
  • Rather than accessing the first item in the output array and assuming it's an assistant message with the content generated by the model, you might consider using the output_text property where supported in SDKs.
Source
output=(output : Array(OutputItem))

An array of content items generated by the model.

  • The length and order of items in the output array is dependent on the model's response.
  • Rather than accessing the first item in the output array and assuming it's an assistant message with the content generated by the model, you might consider using the output_text property where supported in SDKs.
Source
output_text
Source
output_text=(output_text : ResponseOutputText | Nil)
Source
parallel_tool_calls

Whether to allow the model to run tool calls in parallel.

Source
parallel_tool_calls=(parallel_tool_calls : Bool)

Whether to allow the model to run tool calls in parallel.

Source
status

The status of the response generation. One of completed, failed, in_progress, cancelled, queued, or incomplete.

Source
status=(status : ResponseStatus | Nil)

The status of the response generation. One of completed, failed, in_progress, cancelled, queued, or incomplete.

Source
usage
Source
usage=(usage : ResponseUsage | Nil)
Source