pub struct Response {
pub object: String,
pub created_at: u64,
pub completed_at: Option<u64>,
pub status: ResponseStatus,
pub incomplete_details: Option<IncompleteDetails>,
pub model: String,
pub output: Vec<OutputItem>,
/* private fields */
}Expand description
The main response object per the Open Responses specification.
This is the top-level object returned by the API, containing all output items, usage statistics, and metadata about the response.
Fields§
§object: StringObject type, always “response”.
created_at: u64Unix timestamp (seconds) when the response was created.
completed_at: Option<u64>Unix timestamp (seconds) when the response was completed, if applicable.
status: ResponseStatusCurrent status of the response.
incomplete_details: Option<IncompleteDetails>Details about why the response was incomplete, if applicable.
model: StringThe model that generated this response.
output: Vec<OutputItem>Output items generated by the model.
Implementations§
Source§impl Response
impl Response
Sourcepub fn new(id: impl Into<ResponseId>, model: impl Into<String>) -> Self
pub fn new(id: impl Into<ResponseId>, model: impl Into<String>) -> Self
Creates a new response with the given ID and model.
Sourcepub fn incomplete(&mut self, reason: IncompleteReason)
pub fn incomplete(&mut self, reason: IncompleteReason)
Marks the response as incomplete with the given reason.
Sourcepub fn with_usage(self, usage: OpenUsage) -> Self
pub fn with_usage(self, usage: OpenUsage) -> Self
Sets the usage statistics.
Sourcepub fn with_tools(self, tools: Vec<ToolDefinition>) -> Self
pub fn with_tools(self, tools: Vec<ToolDefinition>) -> Self
Sets the available tools.
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
impl StructuralPartialEq for Response
Auto Trait Implementations§
impl Forget for Response
impl Freeze for Responsewhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<OutputItem>: Freeze,
*const OpenResponseError is !null: Freeze,
PhantomData<OpenResponseError>: Freeze,
PhantomData<ToolDefinition>: Freeze,
*const OpenUsage is !null: Freeze,
PhantomData<OpenUsage>: Freeze,
PhantomData<Value>: Freeze,
PhantomData<usize>: Freeze,
PhantomData<Bucket<String, Value>>: Freeze,
impl Move for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnsafeUnpin for Responsewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<OutputItem>: UnsafeUnpin,
*const OpenResponseError is !null: UnsafeUnpin,
PhantomData<OpenResponseError>: UnsafeUnpin,
PhantomData<ToolDefinition>: UnsafeUnpin,
*const OpenUsage is !null: UnsafeUnpin,
PhantomData<OpenUsage>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<Bucket<String, Value>>: UnsafeUnpin,
impl UnwindSafe for Responsewhere
RawVecInner: UnwindSafe,
NonNull<u8>: UnwindSafe,
BoxRaw<OpenResponseError>: UnwindSafe,
BoxRaw<OpenUsage>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.