OpenAI::Response
Inherits JSON::Serializable < Reference < Object
Constructors
new(pull : JSON::PullParser)
Sourcenew(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)
Sourcenew(*, __pull_for_json_serializable pull : JSON::PullParser)
SourceInstance methods
conversation
Sourceconversation=(conversation : ResponseConversation | Nil)
Sourcecreated_at=(created_at : Float64)
Unix timestamp (in seconds) of when this Response was created.
error
Sourceerror=(error : ResponseError)
Sourceincomplete_details
Sourceincomplete_details=(incomplete_details : ResponseIncompleteDetails)
Sourceinstructions
Sourceinstructions=(instructions : ResponseInstructions)
Sourceoutput
An array of content items generated by the model.
- The length and order of items in the
outputarray is dependent on the model's response. - Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs.
An array of content items generated by the model.
- The length and order of items in the
outputarray is dependent on the model's response. - Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs.
output_text
Sourceoutput_text=(output_text : ResponseOutputText | Nil)
Sourceparallel_tool_calls=(parallel_tool_calls : Bool)
Whether to allow the model to run tool calls in parallel.
status
The status of the response generation. One of completed, failed,
in_progress, cancelled, queued, or incomplete.
status=(status : ResponseStatus | Nil)
The status of the response generation. One of completed, failed,
in_progress, cancelled, queued, or incomplete.
usage
Sourceusage=(usage : ResponseUsage | Nil)
Source