pub struct LLMVMCore { /* private fields */ }
Expand description
The llmvm core which handles sending generation requests to the backend, managing message threads, model presets, and prompt templates. Frontends request text generation by invoking the core.
Implementations§
Source§impl LLMVMCore
impl LLMVMCore
pub async fn new(config: LLMVMCoreConfig) -> Result<Self>
Sourcepub async fn close_client(&self, backend_name: &str)
pub async fn close_client(&self, backend_name: &str)
Close the active stdio (local child process) or HTTP client (remote process) for a given backend. If the backend client is over stdio, the backend child process will be killed.
Trait Implementations§
Source§impl Core for LLMVMCore
impl Core for LLMVMCore
Source§fn generate<'life0, 'async_trait>(
&'life0 self,
request: GenerationRequest,
) -> Pin<Box<dyn Future<Output = Result<GenerationResponse, ProtocolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate<'life0, 'async_trait>(
&'life0 self,
request: GenerationRequest,
) -> Pin<Box<dyn Future<Output = Result<GenerationResponse, ProtocolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate text and return the whole response.
Source§fn generate_stream<'life0, 'async_trait>(
&'life0 self,
request: GenerationRequest,
) -> Pin<Box<dyn Future<Output = Result<NotificationStream<GenerationResponse>, ProtocolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate_stream<'life0, 'async_trait>(
&'life0 self,
request: GenerationRequest,
) -> Pin<Box<dyn Future<Output = Result<NotificationStream<GenerationResponse>, ProtocolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Request text generation and return an asynchronous stream of generated tokens.
Source§fn get_last_thread_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<ThreadInfo>, ProtocolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_last_thread_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<ThreadInfo>, ProtocolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieve information for the last modified thread in the current project
or user data directory.
Source§fn get_all_thread_infos<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ThreadInfo>, ProtocolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_all_thread_infos<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ThreadInfo>, ProtocolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieve information for all available threads.
Source§fn get_thread_messages<'life0, 'async_trait>(
&'life0 self,
id: String,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, ProtocolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_thread_messages<'life0, 'async_trait>(
&'life0 self,
id: String,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, ProtocolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieve all thread messages for a thread id.
Source§fn init_project(&self) -> Result<(), ProtocolError>
fn init_project(&self) -> Result<(), ProtocolError>
Initialize a new llmvm project in the current directory.
Auto Trait Implementations§
impl !Freeze for LLMVMCore
impl !RefUnwindSafe for LLMVMCore
impl Send for LLMVMCore
impl Sync for LLMVMCore
impl Unpin for LLMVMCore
impl !UnwindSafe for LLMVMCore
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