pub struct ClientBuilder { /* private fields */ }Expand description
Builder for LlmrixClient.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn base_url(self, url: impl Into<String>) -> Self
pub fn base_url(self, url: impl Into<String>) -> Self
Base URL of the Llmrix server, e.g. "http://localhost:8899". Required.
Sourcepub fn api_key(self, key: impl Into<String>) -> Self
pub fn api_key(self, key: impl Into<String>) -> Self
API key sent in the Authorization: Bearer header.
Omit if the server has no auth configured.
Sourcepub fn timeout(self, d: Duration) -> Self
pub fn timeout(self, d: Duration) -> Self
HTTP request timeout for non-streaming requests (default: 60 s). SSE streaming calls use no overall timeout.
Sourcepub fn build(self) -> Result<LlmrixClient>
pub fn build(self) -> Result<LlmrixClient>
Construct the LlmrixClient.
§Errors
Returns an error if base_url was not set or if the HTTP client could
not be built (e.g. invalid TLS configuration).
Trait Implementations§
Source§impl Default for ClientBuilder
impl Default for ClientBuilder
Source§fn default() -> ClientBuilder
fn default() -> ClientBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ClientBuilder
impl RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnsafeUnpin for ClientBuilder
impl UnwindSafe for ClientBuilder
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