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>;
}
Available on crate feature chatbot only.
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.

Object Safety§

This trait is not object safe.

Implementors§