pub struct Chat { /* private fields */ }Expand description
The LM Studio chat
Implementations§
Source§impl Chat
impl Chat
Sourcepub async fn new<M: Into<Model>, C: Into<Context>>(
model: M,
context: C,
port: u16,
) -> Result<Self>
pub async fn new<M: Into<Model>, C: Into<Context>>( model: M, context: C, port: u16, ) -> Result<Self>
Creates a new simple chat
Sourcepub async fn load_model<M: Into<Model>>(&mut self, model: M) -> Result<()>
pub async fn load_model<M: Into<Model>>(&mut self, model: M) -> Result<()>
Loads AI model to memory
Sourcepub async fn send(&mut self, request: Request) -> Result<Option<Response>>
pub async fn send(&mut self, request: Request) -> Result<Option<Response>>
Send request to chat
Sourcepub async fn next(&mut self) -> Option<Result<StreamChoice>>
pub async fn next(&mut self) -> Option<Result<StreamChoice>>
Read next stream choice
Auto Trait Implementations§
impl Freeze for Chat
impl !RefUnwindSafe for Chat
impl !Send for Chat
impl !Sync for Chat
impl Unpin for Chat
impl !UnwindSafe for Chat
Blanket Implementations§
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