pub struct OpenAIClient(/* private fields */);Expand description
A client capable of interacting with Moly Server and other OpenAI-compatible APIs.
Implementations§
Trait Implementations§
Source§impl BotClient for OpenAIClient
impl BotClient for OpenAIClient
Source§fn send(
&mut self,
bot_id: &BotId,
messages: &[Message],
tools: &[Tool],
) -> BoxPlatformSendStream<'static, ClientResult<MessageContent>>
fn send( &mut self, bot_id: &BotId, messages: &[Message], tools: &[Tool], ) -> BoxPlatformSendStream<'static, ClientResult<MessageContent>>
Stream pieces of content back as a ChatDelta instead of just a String.
Source§fn bots(&self) -> BoxPlatformSendFuture<'static, ClientResult<Vec<Bot>>>
fn bots(&self) -> BoxPlatformSendFuture<'static, ClientResult<Vec<Bot>>>
Interrupt the bot’s current operation.
Bots available under this client.
Source§fn clone_box(&self) -> Box<dyn BotClient>
fn clone_box(&self) -> Box<dyn BotClient>
Make a boxed dynamic clone of this client to pass around.
Source§fn content_widget(
&mut self,
_cx: &mut Cx,
_previous_widget: WidgetRef,
_templates: &HashMap<LiveId, LivePtr>,
_content: &MessageContent,
) -> Option<WidgetRef>
fn content_widget( &mut self, _cx: &mut Cx, _previous_widget: WidgetRef, _templates: &HashMap<LiveId, LivePtr>, _content: &MessageContent, ) -> Option<WidgetRef>
Optionally override how the content of a message is rendered by Makepad. Read more
Source§impl Clone for OpenAIClient
impl Clone for OpenAIClient
Auto Trait Implementations§
impl Freeze for OpenAIClient
impl RefUnwindSafe for OpenAIClient
impl Send for OpenAIClient
impl Sync for OpenAIClient
impl Unpin for OpenAIClient
impl UnwindSafe for OpenAIClient
Blanket Implementations§
§impl<T> ActionTrait for T
impl<T> ActionTrait for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more