pub struct LlmConditionalAgentBuilder { /* private fields */ }Available on crate feature
agents only.Implementations§
Source§impl LlmConditionalAgentBuilder
impl LlmConditionalAgentBuilder
Sourcepub fn new(
name: impl Into<String>,
model: Arc<dyn Llm>,
) -> LlmConditionalAgentBuilder
pub fn new( name: impl Into<String>, model: Arc<dyn Llm>, ) -> LlmConditionalAgentBuilder
Create a new builder with the given name and model.
Sourcepub fn description(self, desc: impl Into<String>) -> LlmConditionalAgentBuilder
pub fn description(self, desc: impl Into<String>) -> LlmConditionalAgentBuilder
Set a description for the agent.
Sourcepub fn instruction(
self,
instruction: impl Into<String>,
) -> LlmConditionalAgentBuilder
pub fn instruction( self, instruction: impl Into<String>, ) -> LlmConditionalAgentBuilder
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>,
) -> LlmConditionalAgentBuilder
pub fn route( self, label: impl Into<String>, agent: Arc<dyn Agent>, ) -> LlmConditionalAgentBuilder
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>) -> LlmConditionalAgentBuilder
pub fn default_route(self, agent: Arc<dyn Agent>) -> LlmConditionalAgentBuilder
Set the default agent to use when no route matches.
pub fn with_skills(self, index: SkillIndex) -> LlmConditionalAgentBuilder
Available on crate feature
skills only.pub fn with_auto_skills(self) -> Result<LlmConditionalAgentBuilder, AdkError>
Available on crate feature
skills only.pub fn with_skills_from_root( self, root: impl AsRef<Path>, ) -> Result<LlmConditionalAgentBuilder, AdkError>
Available on crate feature
skills only.pub fn with_skill_policy( self, policy: SelectionPolicy, ) -> LlmConditionalAgentBuilder
Available on crate feature
skills only.pub fn with_skill_budget(self, max_chars: usize) -> LlmConditionalAgentBuilder
Available on crate feature
skills only.Sourcepub fn before_callback(
self,
callback: Box<dyn Fn(Arc<dyn CallbackContext>) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AdkError>> + Send>> + Sync + Send>,
) -> LlmConditionalAgentBuilder
pub fn before_callback( self, callback: Box<dyn Fn(Arc<dyn CallbackContext>) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AdkError>> + Send>> + Sync + Send>, ) -> LlmConditionalAgentBuilder
Add a before-agent callback.
Sourcepub fn after_callback(
self,
callback: Box<dyn Fn(Arc<dyn CallbackContext>) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AdkError>> + Send>> + Sync + Send>,
) -> LlmConditionalAgentBuilder
pub fn after_callback( self, callback: Box<dyn Fn(Arc<dyn CallbackContext>) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AdkError>> + Send>> + Sync + Send>, ) -> LlmConditionalAgentBuilder
Add an after-agent callback.
Sourcepub fn build(self) -> Result<LlmConditionalAgent, AdkError>
pub fn build(self) -> Result<LlmConditionalAgent, AdkError>
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 UnsafeUnpin 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