pub struct TypedPromptResponse<T> {
pub output: T,
pub usage: Usage,
pub completion_calls: Vec<CompletionCall>,
pub memory_append: Option<MemoryAppend>,
}Expand description
A typed run’s response: the deserialized value plus the run’s usage and completion calls.
Fields§
§output: TThe parsed structured output.
usage: UsageUsage accumulated across every attempt, including attempts that received a billed response but failed to produce a parseable value.
completion_calls: Vec<CompletionCall>Successfully completed completion requests made by the accepted attempt.
usage remains the aggregate across the whole run. Use the last
entry’s usage to inspect the final completion request’s prompt/context
length. An entry whose counters are all None means the provider
reported no usage metrics for that request.
memory_append: Option<MemoryAppend>How the accepted attempt’s conversation-memory append settled; see
PromptResponse::memory_append.
Implementations§
Source§impl<T> TypedPromptResponse<T>
impl<T> TypedPromptResponse<T>
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.
An entry whose counters are all None means the provider reported no
usage metrics for that request.