Trait AsyncFunctions

Source
pub trait AsyncFunctions: Send + Sync {
    // Required methods
    fn execute<'a, 'async_trait>(
        &'a mut self,
        tasks: &'a mut Task,
        execute: bool,
        browse: bool,
        max_tries: u64,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait;
    fn save_ltm<'a, 'async_trait>(
        &'a mut self,
        communication: Communication,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait;
    fn get_ltm<'a, 'async_trait>(
        &'a self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Communication>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait;
    fn ltm_context<'a, 'async_trait>(
        &'a self,
    ) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait;
    fn generate<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        request: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn imagen<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        request: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn stream<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        request: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<ReqResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait defining special functions for agents.\

Required Methods§

Source

fn execute<'a, 'async_trait>( &'a mut self, tasks: &'a mut Task, execute: bool, browse: bool, max_tries: u64, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Execute special functions for an agent.

§Arguments
  • tasks - The tasks associated with the agent.
  • execute - A boolean indicating whether to execute the generated code by the agent.
  • browse - Whether to open a browser.
  • max_tries - A integer indicating the max number of tries fixing code bugs.
§Returns

A result indicating success or failure.

Source

fn save_ltm<'a, 'async_trait>( &'a mut self, communication: Communication, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Available on crate feature mem only.

Save a communication into long-term memory.

§Arguments
  • communication - The communication to save.
§Returns

A result indicating success or failure.

Source

fn get_ltm<'a, 'async_trait>( &'a self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Communication>>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Available on crate feature mem only.

Get the long-term memory of an agent.

§Returns

A result containing a vector of communications.

Source

fn ltm_context<'a, 'async_trait>( &'a self, ) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Available on crate feature mem only.

Retrieve the long-term memory context as a string.

§Returns

A string containing the concatenated context of the agent’s memory.

Source

fn generate<'life0, 'life1, 'async_trait>( &'life0 mut self, request: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Available on crate features oai or gem or cld or xai only.
Source

fn imagen<'life0, 'life1, 'async_trait>( &'life0 mut self, request: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Available on crate features oai or gem or cld or xai only.
Source

fn stream<'life0, 'life1, 'async_trait>( &'life0 mut self, request: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<ReqResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Available on crate features oai or gem or cld or xai only.

Implementors§

Source§

impl AsyncFunctions for ArchitectGPT

Available on crate feature gpt only.
Source§

impl AsyncFunctions for BackendGPT

Available on crate feature gpt only.
Source§

impl AsyncFunctions for DesignerGPT

Available on crate feature gpt only.
Source§

impl AsyncFunctions for FrontendGPT

Available on crate feature gpt only.
Source§

impl AsyncFunctions for GitGPT

Available on crate features gpt and git only.
Source§

impl AsyncFunctions for MailerGPT

Available on crate features gpt and mail only.

Implementation of the trait AsyncFunctions for MailerGPT. Contains additional methods related to email processing and text generation.

This trait provides methods for:

  • Retrieving the GPT agent associated with MailerGPT.
  • Executing email processing and text generation tasks asynchronously.

§Business Logic

  • Provides access to the GPT agent associated with the MailerGPT instance.
  • Executes email processing and text generation tasks asynchronously based on the current status of the agent.
  • Handles task execution including email retrieval and text generation.
  • Manages retries and error handling during task execution.
Source§

impl AsyncFunctions for OptimizerGPT

Available on crate feature gpt only.