causa_runtime/executor/
options.rs1use causa_kernel::{ArtifactStore, ToolBatchProcessor};
4use std::sync::Arc;
5use std::time::Duration;
6
7#[derive(Default)]
9#[non_exhaustive]
10pub struct ToolExecutorOptions {
11 pub before: Vec<Arc<dyn ToolBatchProcessor>>,
13 pub after: Vec<Arc<dyn ToolBatchProcessor>>,
15 pub call_timeout: Option<Duration>,
17 pub artifact_store: Option<Arc<dyn ArtifactStore>>,
19}
20
21impl ToolExecutorOptions {
22 pub fn with_before(mut self, before: Vec<Arc<dyn ToolBatchProcessor>>) -> Self {
24 self.before = before;
25 self
26 }
27
28 pub fn with_after(mut self, after: Vec<Arc<dyn ToolBatchProcessor>>) -> Self {
30 self.after = after;
31 self
32 }
33
34 pub fn with_call_timeout(mut self, call_timeout: Duration) -> Self {
36 self.call_timeout = Some(call_timeout);
37 self
38 }
39
40 pub fn with_artifact_store(mut self, artifact_store: Arc<dyn ArtifactStore>) -> Self {
42 self.artifact_store = Some(artifact_store);
43 self
44 }
45}