pub struct UsageLimits {
pub max_total_tokens: Option<u64>,
pub max_prompt_tokens: Option<u64>,
pub max_completion_tokens: Option<u64>,
pub max_llm_calls: Option<u64>,
pub max_search_calls: Option<u64>,
pub max_fetch_calls: Option<u64>,
pub max_webbrowser_calls: Option<u64>,
pub max_custom_tool_calls: Option<u64>,
pub max_tool_calls: Option<u64>,
}Expand description
Usage limits for controlling agent resource consumption.
Fields§
§max_total_tokens: Option<u64>Maximum total tokens (prompt + completion).
max_prompt_tokens: Option<u64>Maximum prompt tokens.
max_completion_tokens: Option<u64>Maximum completion tokens.
max_llm_calls: Option<u64>Maximum LLM API calls.
max_search_calls: Option<u64>Maximum search API calls.
max_fetch_calls: Option<u64>Maximum HTTP fetch calls.
max_webbrowser_calls: Option<u64>Maximum web browser calls (Chrome/WebDriver combined).
max_custom_tool_calls: Option<u64>Maximum custom tool calls.
max_tool_calls: Option<u64>Maximum generic tool calls.
Implementations§
Source§impl UsageLimits
impl UsageLimits
Sourcepub fn with_max_total_tokens(self, limit: u64) -> Self
pub fn with_max_total_tokens(self, limit: u64) -> Self
Set maximum total tokens.
Sourcepub fn with_max_prompt_tokens(self, limit: u64) -> Self
pub fn with_max_prompt_tokens(self, limit: u64) -> Self
Set maximum prompt tokens.
Sourcepub fn with_max_completion_tokens(self, limit: u64) -> Self
pub fn with_max_completion_tokens(self, limit: u64) -> Self
Set maximum completion tokens.
Sourcepub fn with_max_llm_calls(self, limit: u64) -> Self
pub fn with_max_llm_calls(self, limit: u64) -> Self
Set maximum LLM calls.
Sourcepub fn with_max_search_calls(self, limit: u64) -> Self
pub fn with_max_search_calls(self, limit: u64) -> Self
Set maximum search calls.
Sourcepub fn with_max_fetch_calls(self, limit: u64) -> Self
pub fn with_max_fetch_calls(self, limit: u64) -> Self
Set maximum fetch calls.
Sourcepub fn with_max_webbrowser_calls(self, limit: u64) -> Self
pub fn with_max_webbrowser_calls(self, limit: u64) -> Self
Set maximum web browser calls.
Sourcepub fn with_max_custom_tool_calls(self, limit: u64) -> Self
pub fn with_max_custom_tool_calls(self, limit: u64) -> Self
Set maximum custom tool calls.
Sourcepub fn with_max_tool_calls(self, limit: u64) -> Self
pub fn with_max_tool_calls(self, limit: u64) -> Self
Set maximum tool calls.
Trait Implementations§
Source§impl Clone for UsageLimits
impl Clone for UsageLimits
Source§fn clone(&self) -> UsageLimits
fn clone(&self) -> UsageLimits
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UsageLimits
impl Debug for UsageLimits
Source§impl Default for UsageLimits
impl Default for UsageLimits
Source§fn default() -> UsageLimits
fn default() -> UsageLimits
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for UsageLimits
impl RefUnwindSafe for UsageLimits
impl Send for UsageLimits
impl Sync for UsageLimits
impl Unpin for UsageLimits
impl UnsafeUnpin for UsageLimits
impl UnwindSafe for UsageLimits
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