pub struct Response {
pub model_response_properties: ModelResponseProperties,
pub response_properties: ResponseProperties,
pub id: String,
pub status: Option<ResponseStatus>,
pub created_at: u64,
pub error: Option<ResponseError>,
pub incomplete_details: Option<ResponseIncompleteDetails>,
pub output: Vec<OutputItem>,
pub output_text: Option<String>,
pub usage: Option<ResponseUsage>,
pub parallel_tool_calls: bool,
}
Fields§
§model_response_properties: ModelResponseProperties
§response_properties: ResponseProperties
§id: String
Unique identifier for this Response.
status: Option<ResponseStatus>
The status of the response generation. One of completed
, failed
,
in_progress
, cancelled
, queued
, or incomplete
.
created_at: u64
Unix timestamp (in seconds) of when this Response was created.
error: Option<ResponseError>
§incomplete_details: Option<ResponseIncompleteDetails>
Details about why the response is incomplete.
output: Vec<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 anassistant
message with the content generated by the model, you might consider using theoutput_text
property where supported in SDKs.
output_text: Option<String>
SDK-only convenience property that contains the aggregated text output
from all output_text
items in the output
array, if any are present.
Supported in the Python and JavaScript SDKs.
usage: Option<ResponseUsage>
§parallel_tool_calls: bool
Whether to allow the model to run tool calls in parallel.
Implementations§
Source§impl Response
impl Response
Sourcepub fn builder() -> ResponseBuilder<((), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> ResponseBuilder<((), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building Response
.
On the builder, call .model_response_properties(...)
(optional), .response_properties(...)
(optional), .id(...)
, .status(...)
(optional), .created_at(...)
, .error(...)
(optional), .incomplete_details(...)
(optional), .output(...)
, .output_text(...)
(optional), .usage(...)
(optional), .parallel_tool_calls(...)
to set the values of the fields.
Finally, call .build()
to create the instance of Response
.