pub struct LlmConditionalAgentBuilder { /* private fields */ }Implementations§
Source§impl LlmConditionalAgentBuilder
impl LlmConditionalAgentBuilder
Sourcepub fn new(name: impl Into<String>, model: Arc<dyn Llm>) -> Self
pub fn new(name: impl Into<String>, model: Arc<dyn Llm>) -> Self
Create a new builder with the given name and model.
Sourcepub fn description(self, desc: impl Into<String>) -> Self
pub fn description(self, desc: impl Into<String>) -> Self
Set a description for the agent.
Sourcepub fn instruction(self, instruction: impl Into<String>) -> Self
pub fn instruction(self, instruction: impl Into<String>) -> Self
Set the classification instruction.
The instruction should tell the LLM to classify the user’s input and respond with ONLY the category name (matching a route key).
Sourcepub fn route(self, label: impl Into<String>, agent: Arc<dyn Agent>) -> Self
pub fn route(self, label: impl Into<String>, agent: Arc<dyn Agent>) -> Self
Add a route mapping a classification label to an agent.
When the LLM’s response contains this label, execution transfers to the specified agent.
Sourcepub fn default_route(self, agent: Arc<dyn Agent>) -> Self
pub fn default_route(self, agent: Arc<dyn Agent>) -> Self
Set the default agent to use when no route matches.
Sourcepub fn build(self) -> Result<LlmConditionalAgent>
pub fn build(self) -> Result<LlmConditionalAgent>
Build the LlmConditionalAgent.
Auto Trait Implementations§
impl Freeze for LlmConditionalAgentBuilder
impl !RefUnwindSafe for LlmConditionalAgentBuilder
impl Send for LlmConditionalAgentBuilder
impl Sync for LlmConditionalAgentBuilder
impl Unpin for LlmConditionalAgentBuilder
impl !UnwindSafe for LlmConditionalAgentBuilder
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
Mutably borrows from an owned value. Read more
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request