#[non_exhaustive]pub struct PromptResponse {
pub stop_reason: StopReason,
pub usage: Option<Usage>,
pub meta: Option<Meta>,
}unstable_protocol_v2 only.Expand description
Response from processing a user prompt.
See protocol docs: Check for Completion
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.stop_reason: StopReasonIndicates why the agent stopped processing the turn.
usage: Option<Usage>unstable_end_turn_token_usage only.UNSTABLE
This capability is not part of the spec yet, and may be removed or changed at any point.
Token usage for this turn (optional).
meta: Option<Meta>The _meta property is reserved by ACP to allow clients and agents to attach additional metadata to their interactions. Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
Implementations§
Source§impl PromptResponse
impl PromptResponse
pub fn new(stop_reason: StopReason) -> Self
Sourcepub fn usage(self, usage: impl IntoOption<Usage>) -> Self
Available on crate feature unstable_end_turn_token_usage only.
pub fn usage(self, usage: impl IntoOption<Usage>) -> Self
unstable_end_turn_token_usage only.UNSTABLE
This capability is not part of the spec yet, and may be removed or changed at any point.
Token usage for this turn.
Sourcepub fn meta(self, meta: impl IntoOption<Meta>) -> Self
pub fn meta(self, meta: impl IntoOption<Meta>) -> Self
The _meta property is reserved by ACP to allow clients and agents to attach additional metadata to their interactions. Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
Trait Implementations§
Source§impl Clone for PromptResponse
impl Clone for PromptResponse
Source§fn clone(&self) -> PromptResponse
fn clone(&self) -> PromptResponse
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 PromptResponse
impl Debug for PromptResponse
Source§impl<'de> Deserialize<'de> for PromptResponse
impl<'de> Deserialize<'de> for PromptResponse
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>,
impl Eq for PromptResponse
Source§impl IntoV1 for PromptResponse
impl IntoV1 for PromptResponse
Source§impl JsonSchema for PromptResponse
impl JsonSchema for PromptResponse
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for PromptResponse
impl PartialEq for PromptResponse
Source§fn eq(&self, other: &PromptResponse) -> bool
fn eq(&self, other: &PromptResponse) -> bool
self and other values to be equal, and is used by ==.