Trait BotClient
pub trait BotClient: Send {
// Required methods
fn send(
&mut self,
bot_id: &BotId,
messages: &[Message],
tools: &[Tool],
) -> Pin<Box<dyn PlatformSendStream<Item = ClientResult<MessageContent>>>>;
fn bots(
&mut self,
) -> Pin<Box<dyn PlatformSendFuture<Output = ClientResult<Vec<Bot>>>>>;
fn clone_box(&self) -> Box<dyn BotClient>;
}Expand description
Required Methods§
fn send(
&mut self,
bot_id: &BotId,
messages: &[Message],
tools: &[Tool],
) -> Pin<Box<dyn PlatformSendStream<Item = ClientResult<MessageContent>>>>
fn send( &mut self, bot_id: &BotId, messages: &[Message], tools: &[Tool], ) -> Pin<Box<dyn PlatformSendStream<Item = ClientResult<MessageContent>>>>
Send a message to a bot with support for streamed response.
Each message yielded by the stream should be a snapshot of the full message as it is being built.
You are free to add, modify or remove content on-the-go.