pub struct TypedPromptResponse<T> {
pub output: T,
pub usage: Usage,
pub completion_calls: Vec<CompletionCall>,
pub messages: Vec<Message>,
}Expand description
A typed run’s response: the deserialized value plus the accepted attempt’s transcript, 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.
messages: Vec<Message>The accepted attempt’s transcript; see
PromptResponse::messages.
Append it to caller-owned history to continue the conversation.
Implementations§
Source§impl<T> TypedPromptResponse<T>
impl<T> TypedPromptResponse<T>
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.