use crate::api::{ContextView, NodeContext};
use crate::context::frame::Frame;
use crate::context::queue::Priority;
use crate::error::ApiError;
use crate::types::{FrameID, NodeID};
use async_trait::async_trait;
use std::time::Duration;
#[async_trait]
pub trait AgentAdapter: Send + Sync {
fn read_context(&self, node_id: NodeID, view: ContextView) -> Result<NodeContext, ApiError>;
fn write_context(
&self,
node_id: NodeID,
frame: Frame,
agent_id: String,
) -> Result<FrameID, ApiError>;
async fn generate_frame(
&self,
node_id: NodeID,
prompt: String,
frame_type: String,
agent_id: String,
provider_name: String,
) -> Result<FrameID, ApiError>;
}
pub const GENERATE_FRAME_TIMEOUT: Duration = Duration::from_secs(300);
pub const GENERATE_FRAME_PRIORITY: Priority = Priority::Urgent;