#[non_exhaustive]pub struct TypedPromptResponse<T> {
pub output: T,
pub usage: Usage,
pub completion_calls: Vec<CompletionCall>,
}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.output: T§usage: Usage§completion_calls: Vec<CompletionCall>Successfully completed completion requests made by this agent run.
usage remains the aggregate across the whole run. Use the last
entry’s usage to inspect the final completion request’s prompt/context
length. Zero-valued entry usage means the provider reported no usage
metrics for that request.
Implementations§
Source§impl<T> TypedPromptResponse<T>
impl<T> TypedPromptResponse<T>
pub fn new(output: T, usage: Usage) -> Self
Sourcepub fn with_completion_calls(
self,
completion_calls: Vec<CompletionCall>,
) -> Self
pub fn with_completion_calls( self, completion_calls: Vec<CompletionCall>, ) -> Self
Attach completion call details to this response.
Sourcepub fn completion_calls(&self) -> &[CompletionCall]
pub fn completion_calls(&self) -> &[CompletionCall]
Returns successfully completed completion requests made by this agent run.
Zero-valued entry usage means the provider reported no usage metrics for that request.
Trait Implementations§
Source§impl<T: Clone> Clone for TypedPromptResponse<T>
impl<T: Clone> Clone for TypedPromptResponse<T>
Source§fn clone(&self) -> TypedPromptResponse<T>
fn clone(&self) -> TypedPromptResponse<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for TypedPromptResponse<T>
impl<T: Debug> Debug for TypedPromptResponse<T>
Source§impl<'de, T> Deserialize<'de> for TypedPromptResponse<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for TypedPromptResponse<T>where
T: Deserialize<'de>,
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<T> Freeze for TypedPromptResponse<T>where
T: Freeze,
impl<T> RefUnwindSafe for TypedPromptResponse<T>where
T: RefUnwindSafe,
impl<T> Send for TypedPromptResponse<T>where
T: Send,
impl<T> Sync for TypedPromptResponse<T>where
T: Sync,
impl<T> Unpin for TypedPromptResponse<T>where
T: Unpin,
impl<T> UnsafeUnpin for TypedPromptResponse<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for TypedPromptResponse<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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
fn clone_storage(&self) -> Box<dyn CloneDebuggableStorage>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> CloneableStorage for T
impl<T> CloneableStorage for T
fn clone_storage(&self) -> Box<dyn CloneableStorage>
impl<T> DebuggableStorage for T
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> IntoToolOutput for Twhere
T: Serialize + 'static,
impl<T> IntoToolOutput for Twhere
T: Serialize + 'static,
Source§fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
Convert this value without routing structured data through a string.