#[non_exhaustive]pub struct PromptResponse {
pub stop_reason: StopReason,
pub usage: Option<Usage>,
pub meta: Option<Map<String, Value>>,
}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<Map<String, Value>>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) -> PromptResponse
Sourcepub fn usage(self, usage: impl IntoOption<Usage>) -> PromptResponse
Available on crate feature unstable_end_turn_token_usage only.
pub fn usage(self, usage: impl IntoOption<Usage>) -> PromptResponse
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<Map<String, Value>>) -> PromptResponse
pub fn meta(self, meta: impl IntoOption<Map<String, Value>>) -> PromptResponse
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<PromptResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PromptResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for PromptResponse
Source§impl IntoV2 for PromptResponse
impl IntoV2 for PromptResponse
Source§type Output = PromptResponse
type Output = PromptResponse
Source§fn into_v2(
self,
) -> Result<<PromptResponse as IntoV2>::Output, ProtocolConversionError>
fn into_v2( self, ) -> Result<<PromptResponse as IntoV2>::Output, ProtocolConversionError>
Source§impl JsonRpcResponse for PromptResponse
impl JsonRpcResponse 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 ==.