pub struct AgentRuntime { /* private fields */ }Expand description
Agent runtime for executing agent logic.
Implementations§
Source§impl AgentRuntime
impl AgentRuntime
Sourcepub fn with_model(self, model: impl Into<String>) -> Self
pub fn with_model(self, model: impl Into<String>) -> Self
Set the model to use.
Sourcepub fn with_system_prompt(self, prompt: impl Into<String>) -> Self
pub fn with_system_prompt(self, prompt: impl Into<String>) -> Self
Set the system prompt.
Sourcepub const fn with_max_tokens(self, max_tokens: u32) -> Self
pub const fn with_max_tokens(self, max_tokens: u32) -> Self
Set max tokens.
Sourcepub const fn with_temperature(self, temperature: f32) -> Self
pub const fn with_temperature(self, temperature: f32) -> Self
Set temperature.
Sourcepub fn with_tools(self, tools: Arc<ToolRegistry>) -> Self
pub fn with_tools(self, tools: Arc<ToolRegistry>) -> Self
Set the tool registry.
Sourcepub const fn tools(&self) -> &Arc<ToolRegistry>
pub const fn tools(&self) -> &Arc<ToolRegistry>
Get the tool registry.
Sourcepub fn system_prompt(&self) -> Option<&str>
pub fn system_prompt(&self) -> Option<&str>
Get the system prompt.
Sourcepub const fn max_tokens(&self) -> u32
pub const fn max_tokens(&self) -> u32
Get max tokens.
Sourcepub const fn temperature(&self) -> f32
pub const fn temperature(&self) -> f32
Get temperature.
Sourcepub async fn process_message(
&self,
ctx: &mut AgentContext,
message: &str,
) -> Result<String, AgentRuntimeError>
pub async fn process_message( &self, ctx: &mut AgentContext, message: &str, ) -> Result<String, AgentRuntimeError>
Auto Trait Implementations§
impl Freeze for AgentRuntime
impl !RefUnwindSafe for AgentRuntime
impl Send for AgentRuntime
impl Sync for AgentRuntime
impl Unpin for AgentRuntime
impl !UnwindSafe for AgentRuntime
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