use std::sync::Arc;
use crate::adapter::StorageAdapter;
use crate::tools::web_search::{NoopWebSearchProvider, WebSearchProvider};
#[derive(Clone)]
pub struct ToolContext {
pub storage: Arc<dyn StorageAdapter>,
pub conversation_id: String,
pub web_search: Arc<dyn WebSearchProvider>,
}
impl ToolContext {
#[must_use]
pub fn new(storage: Arc<dyn StorageAdapter>, conversation_id: impl Into<String>) -> Self {
Self {
storage,
conversation_id: conversation_id.into(),
web_search: Arc::new(NoopWebSearchProvider),
}
}
#[must_use]
pub fn with_web_search(mut self, provider: Arc<dyn WebSearchProvider>) -> Self {
self.web_search = provider;
self
}
}