Skip to main content

TaskStore

Trait TaskStore 

Source
pub trait TaskStore: Send + Sync {
    // Required methods
    fn create_task<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        context_id: &'life1 str,
        task_id: Option<&'life2 str>,
        task_status: Option<TaskStatus>,
    ) -> Pin<Box<dyn Future<Output = Result<Task>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_task<'life0, 'life1, 'async_trait>(
        &'life0 self,
        task_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Task>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn update_task_status<'life0, 'life1, 'async_trait>(
        &'life0 self,
        task_id: &'life1 str,
        status: TaskStatus,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn add_event_to_task<'life0, 'life1, 'async_trait>(
        &'life0 self,
        task_id: &'life1 str,
        event: AgentEvent,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn add_message_to_task<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        task_id: &'life1 str,
        message: &'life2 Message,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn cancel_task<'life0, 'life1, 'async_trait>(
        &'life0 self,
        task_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Task>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_tasks<'life0, 'life1, 'async_trait>(
        &'life0 self,
        thread_id: Option<&'life1 str>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Task>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_history<'life0, 'life1, 'async_trait>(
        &'life0 self,
        thread_id: &'life1 str,
        filter: Option<MessageFilter>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(Task, Vec<TaskMessage>)>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn update_parent_task<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        task_id: &'life1 str,
        parent_task_id: Option<&'life2 str>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided methods
    fn init_task(
        &self,
        context_id: &str,
        task_id: Option<&str>,
        status: Option<TaskStatus>,
    ) -> Task { ... }
    fn get_or_create_task<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        thread_id: &'life1 str,
        task_id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}

Required Methods§

Source

fn create_task<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, context_id: &'life1 str, task_id: Option<&'life2 str>, task_status: Option<TaskStatus>, ) -> Pin<Box<dyn Future<Output = Result<Task>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn get_task<'life0, 'life1, 'async_trait>( &'life0 self, task_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Task>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn update_task_status<'life0, 'life1, 'async_trait>( &'life0 self, task_id: &'life1 str, status: TaskStatus, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn add_event_to_task<'life0, 'life1, 'async_trait>( &'life0 self, task_id: &'life1 str, event: AgentEvent, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn add_message_to_task<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, task_id: &'life1 str, message: &'life2 Message, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn cancel_task<'life0, 'life1, 'async_trait>( &'life0 self, task_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Task>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn list_tasks<'life0, 'life1, 'async_trait>( &'life0 self, thread_id: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Task>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_history<'life0, 'life1, 'async_trait>( &'life0 self, thread_id: &'life1 str, filter: Option<MessageFilter>, ) -> Pin<Box<dyn Future<Output = Result<Vec<(Task, Vec<TaskMessage>)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn update_parent_task<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, task_id: &'life1 str, parent_task_id: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Provided Methods§

Source

fn init_task( &self, context_id: &str, task_id: Option<&str>, status: Option<TaskStatus>, ) -> Task

Source

fn get_or_create_task<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, thread_id: &'life1 str, task_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Implementors§