pub struct Agent;Expand description
The agent role - typically an LLM that responds to prompts.
Agents receive prompts from clients and respond with answers, potentially invoking tools along the way.
Implementations§
Source§impl Agent
impl Agent
Sourcepub fn builder(self) -> Builder<Agent, NullHandler, NullRun>
pub fn builder(self) -> Builder<Agent, NullHandler, NullRun>
Create a connection builder for an agent.
Sourcepub fn v2(self) -> Builder<Agent, NullHandler, NullRun>
Available on crate feature unstable_protocol_v2 only.
pub fn v2(self) -> Builder<Agent, NullHandler, NullRun>
unstable_protocol_v2 only.Create an agent builder that uses the ACP protocol v2 API.
This builder requires clients to negotiate protocol v2 during initialization. Use a v1 builder for v1 clients.
Requires the unstable_protocol_v2 crate feature.
Sourcepub fn protocol_router(self) -> AgentProtocolRouter
Available on crate feature unstable_protocol_v2 only.
pub fn protocol_router(self) -> AgentProtocolRouter
unstable_protocol_v2 only.Create a router that chooses between configured protocol implementations.
Add implementations with AgentProtocolRouter::with_v1 and
AgentProtocolRouter::with_v2.
The resulting router reads the initial
initialize request, selects the highest configured implementation
compatible with the client’s requested protocol version, then forwards
the connection to that implementation. It does not convert traffic
between protocol versions after routing.
Requires the unstable_protocol_v2 crate feature while protocol v2
stabilizes.
Trait Implementations§
impl Copy for Agent
impl Eq for Agent
Source§impl HasPeer<Agent> for Agent
impl HasPeer<Agent> for Agent
Source§fn remote_style(&self, _peer: Agent) -> RemoteStyle
fn remote_style(&self, _peer: Agent) -> RemoteStyle
Source§impl HasPeer<Agent> for Conductor
impl HasPeer<Agent> for Conductor
Source§fn remote_style(&self, _peer: Agent) -> RemoteStyle
fn remote_style(&self, _peer: Agent) -> RemoteStyle
Source§impl Ord for Agent
impl Ord for Agent
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Agent
impl PartialOrd for Agent
Source§impl Role for Agent
impl Role for Agent
Source§type Counterpart = Client
type Counterpart = Client
Source§fn counterpart(&self) -> Self::Counterpart
fn counterpart(&self) -> Self::Counterpart
Source§async fn default_handle_dispatch_from(
&self,
message: Dispatch,
connection: ConnectionTo<Agent>,
) -> Result<Handled<Dispatch>, Error>
async fn default_handle_dispatch_from( &self, message: Dispatch, connection: ConnectionTo<Agent>, ) -> Result<Handled<Dispatch>, Error>
impl StructuralPartialEq for Agent
Auto Trait Implementations§
impl Freeze for Agent
impl RefUnwindSafe for Agent
impl Send for Agent
impl Sync for Agent
impl Unpin for Agent
impl UnsafeUnpin for Agent
impl UnwindSafe for Agent
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.