Skip to main content

neuron_loop/
config.rs

1//! Configuration types for the agentic loop.
2
3use neuron_types::{SystemPrompt, UsageLimits};
4
5/// Configuration for the agentic loop.
6#[derive(Debug, Clone)]
7pub struct LoopConfig {
8    /// The system prompt for the LLM provider.
9    pub system_prompt: SystemPrompt,
10    /// Maximum number of turns before the loop terminates.
11    /// `None` means no limit.
12    pub max_turns: Option<usize>,
13    /// Whether to execute tool calls in parallel when multiple are returned.
14    pub parallel_tool_execution: bool,
15    /// Optional resource usage limits (token budgets, request/tool call caps).
16    ///
17    /// When set, the loop enforces limits at three check points:
18    /// pre-request (request count), post-response (token totals),
19    /// and pre-tool-call (tool call count).
20    pub usage_limits: Option<UsageLimits>,
21}
22
23impl Default for LoopConfig {
24    fn default() -> Self {
25        Self {
26            system_prompt: SystemPrompt::Text(String::new()),
27            max_turns: None,
28            parallel_tool_execution: false,
29            usage_limits: None,
30        }
31    }
32}