pub struct LlmrixClient { /* private fields */ }Expand description
Main entry point for the Llmrix Rust SDK.
LlmrixClient is cheap to clone — all instances share the same underlying
connection pool via Arc<Transport>.
§Example
let client = LlmrixClient::builder()
.base_url("http://localhost:8899")
.api_key("sk-xxx")
.build()?;
let conv = client.conversations()
.create(ConversationCreateRequest { title: "My chat".into(), agent_id: None })
.await?;
client.chat(&conv.id).send("Hello!", |event| {
use llmrix_rust_sdk::streaming::event::StreamEvent;
if let StreamEvent::MessageChunk(e) = event {
print!("{}", e.content);
}
Ok(())
}).await?;Implementations§
Source§impl LlmrixClient
impl LlmrixClient
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for configuring and constructing a LlmrixClient.
Sourcepub fn conversations(&self) -> ConversationsResource
pub fn conversations(&self) -> ConversationsResource
Returns the resource for managing conversations and message history.
Sourcepub fn cron(&self) -> CronResource
pub fn cron(&self) -> CronResource
Returns the resource for managing scheduled cron tasks.
Sourcepub fn agents(&self) -> AgentsResource
pub fn agents(&self) -> AgentsResource
Returns the resource for managing agents and their mates. Returns HTTP 503 in native/standalone server mode.
Sourcepub fn chat(&self, conv_id: impl Into<String>) -> ChatResource
pub fn chat(&self, conv_id: impl Into<String>) -> ChatResource
Returns a ChatResource scoped to the given conversation ID.
Trait Implementations§
Source§impl Clone for LlmrixClient
impl Clone for LlmrixClient
Source§fn clone(&self) -> LlmrixClient
fn clone(&self) -> LlmrixClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for LlmrixClient
impl !UnwindSafe for LlmrixClient
impl Freeze for LlmrixClient
impl Send for LlmrixClient
impl Sync for LlmrixClient
impl Unpin for LlmrixClient
impl UnsafeUnpin for LlmrixClient
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