#[non_exhaustive]pub struct Response {Show 13 fields
pub id: String,
pub created_at: f64,
pub object: String,
pub status: Option<ResponseStatus>,
pub model: String,
pub output: Vec<OutputItem>,
pub error: Option<ResponseError>,
pub incomplete_details: Option<IncompleteDetails>,
pub usage: Option<ResponseUsage>,
pub metadata: Option<HashMap<String, String>>,
pub previous_response_id: Option<String>,
pub temperature: Option<f64>,
pub top_p: Option<f64>,
}Expand description
Response from POST /responses, GET /responses/{id}, and the terminal
stream events (Completed/Failed/Incomplete).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: String§created_at: f64§object: String§status: Option<ResponseStatus>§model: String§output: Vec<OutputItem>§error: Option<ResponseError>§incomplete_details: Option<IncompleteDetails>§usage: Option<ResponseUsage>§metadata: Option<HashMap<String, String>>§previous_response_id: Option<String>§temperature: Option<f64>§top_p: Option<f64>Implementations§
Source§impl Response
impl Response
Sourcepub fn output_text(&self) -> String
pub fn output_text(&self) -> String
Concatenated text of every output_text content part across all
output messages — the common case for reading a response’s answer.
Mirrors the Python SDK’s Response.output_text computed property.
Sourcepub fn function_calls(&self) -> Vec<&KnownOutputItem>
pub fn function_calls(&self) -> Vec<&KnownOutputItem>
Function calls the model made in this response, if any.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Response
impl<'de> Deserialize<'de> for Response
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnsafeUnpin for Response
impl UnwindSafe for Response
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more