zino_chatbot

Trait ChatbotService

Source
pub trait ChatbotService {
    // Required methods
    fn try_new_chatbot(config: &Table) -> Result<Chatbot, Error>;
    fn model(&self) -> &str;
    async fn try_send(
        &self,
        message: String,
        options: Option<Map>,
    ) -> Result<Vec<String>, Error>;
}
Expand description

Underlying trait of all chatbot services for implementors.

Required Methods§

Source

fn try_new_chatbot(config: &Table) -> Result<Chatbot, Error>

Constructs a new chatbot with the configuration, returning an error if it fails.

Source

fn model(&self) -> &str

Returns the model.

Source

async fn try_send( &self, message: String, options: Option<Map>, ) -> Result<Vec<String>, Error>

Attempts to send a message to generate chat completions.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§