synaptic_tools/
return_direct.rs1use std::sync::Arc;
2
3use async_trait::async_trait;
4use serde_json::Value;
5use synaptic_core::{SynapticError, Tool};
6
7pub struct ReturnDirectTool {
10 inner: Arc<dyn Tool>,
11}
12
13impl ReturnDirectTool {
14 pub fn new(inner: Arc<dyn Tool>) -> Self {
16 Self { inner }
17 }
18
19 pub fn is_return_direct(&self) -> bool {
21 true
22 }
23}
24
25#[async_trait]
26impl Tool for ReturnDirectTool {
27 fn name(&self) -> &'static str {
28 self.inner.name()
29 }
30
31 fn description(&self) -> &'static str {
32 self.inner.description()
33 }
34
35 async fn call(&self, args: Value) -> Result<Value, SynapticError> {
36 self.inner.call(args).await
37 }
38}