#[non_exhaustive]pub struct InitializeResponse {
pub protocol_version: ProtocolVersion,
pub capabilities: AgentCapabilities,
pub auth_methods: Vec<AuthMethod>,
pub agent_info: Option<Implementation>,
pub meta: Option<Meta>,
}unstable_protocol_v2 only.Expand description
Response to the initialize method.
Contains the negotiated protocol version and agent capabilities.
See protocol docs: Initialization
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.protocol_version: ProtocolVersionThe protocol version the client specified if supported by the agent, or the latest protocol version supported by the agent.
The client should disconnect, if it doesn’t support this version.
capabilities: AgentCapabilitiesCapabilities supported by the agent.
auth_methods: Vec<AuthMethod>Authentication methods supported by the agent.
agent_info: Option<Implementation>Information about the Agent name and version sent to the Client.
Note: in future versions of the protocol, this will be required.
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 InitializeResponse
impl InitializeResponse
Sourcepub fn new(protocol_version: ProtocolVersion) -> Self
pub fn new(protocol_version: ProtocolVersion) -> Self
Builds InitializeResponse with the required response fields set; optional fields start unset or empty.
Sourcepub fn capabilities(self, capabilities: AgentCapabilities) -> Self
pub fn capabilities(self, capabilities: AgentCapabilities) -> Self
Capabilities supported by the agent.
Sourcepub fn auth_methods(self, auth_methods: Vec<AuthMethod>) -> Self
pub fn auth_methods(self, auth_methods: Vec<AuthMethod>) -> Self
Authentication methods supported by the agent.
Sourcepub fn agent_info(self, agent_info: impl IntoOption<Implementation>) -> Self
pub fn agent_info(self, agent_info: impl IntoOption<Implementation>) -> Self
Information about the Agent name and version sent to the Client.
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 InitializeResponse
impl Clone for InitializeResponse
Source§fn clone(&self) -> InitializeResponse
fn clone(&self) -> InitializeResponse
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 InitializeResponse
impl Debug for InitializeResponse
Source§impl<'de> Deserialize<'de> for InitializeResponse
impl<'de> Deserialize<'de> for InitializeResponse
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 InitializeResponse
Source§impl IntoV1 for InitializeResponse
impl IntoV1 for InitializeResponse
Source§impl JsonSchema for InitializeResponse
impl JsonSchema for InitializeResponse
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 InitializeResponse
impl PartialEq for InitializeResponse
Source§fn eq(&self, other: &InitializeResponse) -> bool
fn eq(&self, other: &InitializeResponse) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for InitializeResponse
impl Serialize for InitializeResponse
impl StructuralPartialEq for InitializeResponse
Auto Trait Implementations§
impl Freeze for InitializeResponse
impl RefUnwindSafe for InitializeResponse
impl Send for InitializeResponse
impl Sync for InitializeResponse
impl Unpin for InitializeResponse
impl UnsafeUnpin for InitializeResponse
impl UnwindSafe for InitializeResponse
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.