codetether_agent/tool/rlm/
mod.rs1mod collect;
7mod ctx;
8mod execute;
9mod fallback;
10mod schema;
11
12use super::{Tool, ToolResult};
13use crate::provider::Provider;
14use crate::rlm::RlmConfig;
15use anyhow::Result;
16use async_trait::async_trait;
17use serde_json::Value;
18use std::sync::Arc;
19
20pub struct RlmTool {
23 pub(super) provider: Arc<dyn Provider>,
24 pub(super) model: String,
25 pub(super) config: RlmConfig,
26}
27
28impl RlmTool {
29 pub fn new(provider: Arc<dyn Provider>, model: String, config: RlmConfig) -> Self {
31 Self {
32 provider,
33 model,
34 config,
35 }
36 }
37}
38
39#[async_trait]
40impl Tool for RlmTool {
41 fn id(&self) -> &str {
42 "rlm"
43 }
44
45 fn name(&self) -> &str {
46 "RLM"
47 }
48
49 fn description(&self) -> &str {
50 schema::DESCRIPTION
51 }
52
53 fn parameters(&self) -> Value {
54 schema::parameters()
55 }
56
57 async fn execute(&self, args: Value) -> Result<ToolResult> {
58 execute::run(self, args).await
59 }
60}