pub mod null_agent;
pub mod text_agent;
use std::{future::Future, pin::Pin, sync::Arc};
use ferrox_actions::{ActionGroup, AgentState, ConfirmHandler, FunctionAction};
pub use null_agent::NullAgent;
pub trait Agent<S: Send + Sync + Clone + 'static = ()>: Clone {
fn add_action(&mut self, action: Arc<FunctionAction<S>>);
fn add_action_group<G: ActionGroup<S>>(&mut self, group: &G) {
for action in group.actions() {
self.add_action(action.clone());
}
}
fn system_prompt(&self) -> &str;
fn state(&self) -> AgentState<S>;
fn process_prompt(
&self,
prompt: &str,
history_id: &str,
send_state: serde_json::Value,
) -> Pin<
Box<
dyn Future<
Output = Result<
(String, Option<(serde_json::Value, ConfirmHandler<S>)>),
String,
>,
> + Send
+ Sync,
>,
>;
}