causa_runtime/config/
options.rs1use crate::RunObserver;
2use causa_kernel::{CacheDirective, ContextPreparer, GenerationOptions, ModelRef};
3use std::sync::Arc;
4
5#[derive(Debug, Clone, Copy)]
7pub struct TurnLimits {
8 pub max_model_rounds: u32,
10 pub max_tool_calls: u32,
12}
13impl Default for TurnLimits {
14 fn default() -> Self {
15 Self {
16 max_model_rounds: 10,
17 max_tool_calls: 64,
18 }
19 }
20}
21
22#[derive(Clone)]
24pub struct TurnRunOptions {
25 pub model: ModelRef,
27 pub generation: GenerationOptions,
29 pub cache: CacheDirective,
31 pub limits: TurnLimits,
33 pub preparer: Option<Arc<dyn ContextPreparer>>,
35 pub observer: Option<Arc<RunObserver>>,
37}
38impl TurnRunOptions {
39 pub fn new(model: ModelRef) -> Self {
41 Self {
42 model,
43 generation: GenerationOptions::default(),
44 cache: CacheDirective::None,
45 limits: TurnLimits::default(),
46 preparer: None,
47 observer: None,
48 }
49 }
50}