pub struct CompletionResponse<T> {
pub choice: OneOrMany<AssistantContent>,
pub usage: Usage,
pub raw_response: T,
}
Expand description
General completion response struct that contains the high-level completion choice and the raw response. The completion choice contains one or more assistant content.
Fields§
§choice: OneOrMany<AssistantContent>
The completion choice (represented by one or more assistant message content) returned by the completion model provider
usage: Usage
Tokens used during prompting and responding
raw_response: T
The raw response returned by the completion model provider
Trait Implementations§
Source§impl<T: Debug> Debug for CompletionResponse<T>
impl<T: Debug> Debug for CompletionResponse<T>
Source§impl<R> From<StreamingCompletionResponse<R>> for CompletionResponse<Option<R>>
impl<R> From<StreamingCompletionResponse<R>> for CompletionResponse<Option<R>>
Source§fn from(value: StreamingCompletionResponse<R>) -> CompletionResponse<Option<R>>
fn from(value: StreamingCompletionResponse<R>) -> CompletionResponse<Option<R>>
Converts to this type from the input type.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Source§impl TryFrom<GenerateContentResponse> for CompletionResponse<GenerateContentResponse>
impl TryFrom<GenerateContentResponse> for CompletionResponse<GenerateContentResponse>
Source§type Error = CompletionError
type Error = CompletionError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl<T> Freeze for CompletionResponse<T>where
T: Freeze,
impl<T> RefUnwindSafe for CompletionResponse<T>where
T: RefUnwindSafe,
impl<T> Send for CompletionResponse<T>where
T: Send,
impl<T> Sync for CompletionResponse<T>where
T: Sync,
impl<T> Unpin for CompletionResponse<T>where
T: Unpin,
impl<T> UnwindSafe for CompletionResponse<T>where
T: 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
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>
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