pub struct CompletionResponse {Show 16 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 provider_reasoning: Option<String>,
pub reasoning_metadata: Option<Map<String, Value>>,
pub reasoning_context: Option<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: StringThe ID of a completion response.
object: ResponseObjectThe type of the object.
created_at: u64The time at which a given response has been created, in seconds from the UNIX epoch (01/01/1970 00:00:00).
status: ResponseStatusThe 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: StringThe model name
provider_reasoning: Option<String>Provider-specific top-level reasoning content returned by some OpenAI-compatible Responses implementations.
reasoning_metadata: Option<Map<String, Value>>The complete object-shaped top-level reasoning metadata returned by the provider.
Unknown fields, unknown values, and null-valued members inside the object
are preserved value-equivalently. A top-level null, missing field, or
unsupported non-object shape is normalized to no reasoning metadata.
When serializing manually constructed responses, Self::provider_reasoning
takes precedence over this field, and this field takes precedence over
Self::reasoning_context.
reasoning_context: Option<String>The effective reasoning context returned by OpenAI.
This is populated as a convenience projection of
Self::reasoning_metadata. String-shaped reasoning returned by compatible
providers remains available through Self::provider_reasoning.
usage: Option<ResponsesUsage>Token usage
output: Vec<Output>The model output (messages, etc will go here)
tools: Vec<ResponsesToolDefinition>Tools
additional_parameters: AdditionalParametersAdditional parameters
Trait Implementations§
Source§impl Clone for CompletionResponse
impl Clone for CompletionResponse
Source§fn clone(&self) -> CompletionResponse
fn clone(&self) -> CompletionResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
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
Auto Trait Implementations§
impl Freeze for CompletionResponse
impl RefUnwindSafe for CompletionResponse
impl Send for CompletionResponse
impl Sync for CompletionResponse
impl Unpin for CompletionResponse
impl UnsafeUnpin 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
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> 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> 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>
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>
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