pub struct CompletionResponse {Show 13 fields
pub id: String,
pub object: ResponseObject,
pub created_at: u64,
pub status: ResponseStatus,
pub error: Option<ResponseError>,
pub incomplete_details: Option<IncompleteDetailsReason>,
pub instructions: Option<String>,
pub max_output_tokens: Option<u64>,
pub model: String,
pub usage: Option<ResponsesUsage>,
pub output: Vec<Output>,
pub tools: Vec<ResponsesToolDefinition>,
pub additional_parameters: AdditionalParameters,
}
Expand description
The standard response format from OpenAI’s Responses API.
Fields§
§id: String
The ID of a completion response.
object: ResponseObject
The type of the object.
created_at: u64
The time at which a given response has been created, in seconds from the UNIX epoch (01/01/1970 00:00:00).
status: ResponseStatus
The status of the response.
error: Option<ResponseError>
Response error (optional)
incomplete_details: Option<IncompleteDetailsReason>
Incomplete response details (optional)
instructions: Option<String>
System prompt/preamble
max_output_tokens: Option<u64>
The maximum number of tokens the model should output
model: String
The model name
usage: Option<ResponsesUsage>
Token usage
output: Vec<Output>
The model output (messages, etc will go here)
tools: Vec<ResponsesToolDefinition>
Tools
additional_parameters: AdditionalParameters
Additional parameters
Trait Implementations§
Source§impl Clone for CompletionResponse
impl Clone for CompletionResponse
Source§fn clone(&self) -> CompletionResponse
fn clone(&self) -> CompletionResponse
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CompletionResponse
impl Debug for CompletionResponse
Source§impl<'de> Deserialize<'de> for CompletionResponse
impl<'de> Deserialize<'de> for CompletionResponse
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
Source§impl Serialize for CompletionResponse
impl Serialize for CompletionResponse
Source§impl TryFrom<CompletionResponse> for CompletionResponse<CompletionResponse>
impl TryFrom<CompletionResponse> for CompletionResponse<CompletionResponse>
Source§type Error = CompletionError
type Error = CompletionError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for CompletionResponse
impl RefUnwindSafe for CompletionResponse
impl Send for CompletionResponse
impl Sync for CompletionResponse
impl Unpin for CompletionResponse
impl UnwindSafe for CompletionResponse
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more