pub struct LlmAgentBuilder { /* private fields */ }Implementations§
Source§impl LlmAgentBuilder
impl LlmAgentBuilder
pub fn new(name: impl Into<String>) -> Self
pub fn description(self, desc: impl Into<String>) -> Self
pub fn model(self, model: Arc<dyn Llm>) -> Self
pub fn instruction(self, instruction: impl Into<String>) -> Self
pub fn instruction_provider(self, provider: InstructionProvider) -> Self
pub fn global_instruction(self, instruction: impl Into<String>) -> Self
pub fn global_instruction_provider( self, provider: GlobalInstructionProvider, ) -> Self
pub fn input_schema(self, schema: Value) -> Self
pub fn output_schema(self, schema: Value) -> Self
pub fn disallow_transfer_to_parent(self, disallow: bool) -> Self
pub fn disallow_transfer_to_peers(self, disallow: bool) -> Self
pub fn include_contents(self, include: IncludeContents) -> Self
pub fn output_key(self, key: impl Into<String>) -> Self
pub fn tool(self, tool: Arc<dyn Tool>) -> Self
pub fn sub_agent(self, agent: Arc<dyn Agent>) -> Self
pub fn before_callback(self, callback: BeforeAgentCallback) -> Self
pub fn after_callback(self, callback: AfterAgentCallback) -> Self
pub fn before_model_callback(self, callback: BeforeModelCallback) -> Self
pub fn after_model_callback(self, callback: AfterModelCallback) -> Self
pub fn before_tool_callback(self, callback: BeforeToolCallback) -> Self
pub fn after_tool_callback(self, callback: AfterToolCallback) -> Self
Sourcepub fn input_guardrails(self, guardrails: GuardrailSet) -> Self
pub fn input_guardrails(self, guardrails: GuardrailSet) -> Self
Set input guardrails to validate user input before processing.
Input guardrails run before the agent processes the request and can:
- Block harmful or off-topic content
- Redact PII from user input
- Enforce input length limits
Requires the guardrails feature.
Sourcepub fn output_guardrails(self, guardrails: GuardrailSet) -> Self
pub fn output_guardrails(self, guardrails: GuardrailSet) -> Self
Set output guardrails to validate agent responses.
Output guardrails run after the agent generates a response and can:
- Enforce JSON schema compliance
- Redact PII from responses
- Block harmful content in responses
Requires the guardrails feature.
pub fn build(self) -> Result<LlmAgent>
Auto Trait Implementations§
impl Freeze for LlmAgentBuilder
impl !RefUnwindSafe for LlmAgentBuilder
impl Send for LlmAgentBuilder
impl Sync for LlmAgentBuilder
impl Unpin for LlmAgentBuilder
impl !UnwindSafe for LlmAgentBuilder
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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