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§
Sourcefn 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 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.
Sourcefn 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.
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,
mem only.Sourcefn 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.
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,
mem only.Sourcefn 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.
fn ltm_context<'a, 'async_trait>(
&'a self,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
mem only.Retrieve the long-term memory context as a string.
§Returns
A string containing the concatenated context of the agent’s memory.
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.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.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§
impl AsyncFunctions for ArchitectGPT
Available on crate feature
gpt only.impl AsyncFunctions for BackendGPT
Available on crate feature
gpt only.impl AsyncFunctions for DesignerGPT
Available on crate feature
gpt only.impl AsyncFunctions for FrontendGPT
Available on crate feature
gpt only.impl AsyncFunctions for GitGPT
Available on crate features
gpt and git only.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.
impl AsyncFunctions for OptimizerGPT
Available on crate feature
gpt only.