use std::sync::Arc;
use async_trait::async_trait;
use serde_json::Value;
use synaptic_core::{SynapticError, Tool};
pub struct ReturnDirectTool {
inner: Arc<dyn Tool>,
}
impl ReturnDirectTool {
pub fn new(inner: Arc<dyn Tool>) -> Self {
Self { inner }
}
pub fn is_return_direct(&self) -> bool {
true
}
}
#[async_trait]
impl Tool for ReturnDirectTool {
fn name(&self) -> &'static str {
self.inner.name()
}
fn description(&self) -> &'static str {
self.inner.description()
}
async fn call(&self, args: Value) -> Result<Value, SynapticError> {
self.inner.call(args).await
}
}