Skip to main content

AgentLoopConfig

Struct AgentLoopConfig 

Source
pub struct AgentLoopConfig {
    pub max_iterations: usize,
    pub max_tokens_per_completion: usize,
    pub temperature: f32,
    pub top_k: i32,
    pub min_p: f32,
    pub repeat_penalty: f32,
    pub auto_compact: bool,
    pub compaction_threshold_pct: f32,
    pub compaction_keep_recent: usize,
    pub n_batch: usize,
    pub stop_sequences: Vec<String>,
}
Expand description

Configuration for the agent loop.

Fields§

§max_iterations: usize

Maximum number of iterations (tool-use rounds). 0 = unlimited.

§max_tokens_per_completion: usize

Maximum tokens to generate per completion.

§temperature: f32

Temperature for sampling.

§top_k: i32

Top-K sampling parameter.

§min_p: f32

Min-P sampling parameter.

§repeat_penalty: f32

Repetition penalty.

§auto_compact: bool

Enable automatic context compaction (default: true).

§compaction_threshold_pct: f32

Percentage of context window that triggers compaction (0.0–1.0).

§compaction_keep_recent: usize

Number of recent messages to keep when compacting.

§n_batch: usize

Maximum tokens per batch during prompt encoding (default: 512).

Large prompts are split into chunks of this size for decoding. Smaller values use less peak GPU memory; larger values may be faster on GPUs with plenty of VRAM.

§stop_sequences: Vec<String>

List of stop sequences. If the model generates one of these, it stops.

Trait Implementations§

Source§

impl Default for AgentLoopConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.