pub struct LLMClient { /* private fields */ }Available on crate feature
client only.Implementations§
Source§impl LLMClient
impl LLMClient
pub async fn proxy( &self, req: ProxyRequest, options: ProxyOptions, ) -> Result<ProxyResponse, Error>
pub async fn proxy_stream( &self, req: ProxyRequest, options: ProxyOptions, ) -> Result<StreamHandle, Error>
Available on crate feature
streaming only.Sourcepub async fn proxy_stream_deltas(
&self,
req: ProxyRequest,
options: ProxyOptions,
) -> Result<Pin<Box<dyn Stream<Item = Result<String, Error>> + Send>>, Error>
Available on crate feature streaming only.
pub async fn proxy_stream_deltas( &self, req: ProxyRequest, options: ProxyOptions, ) -> Result<Pin<Box<dyn Stream<Item = Result<String, Error>> + Send>>, Error>
streaming only.Convenience helper to stream text deltas directly (async).
Sourcepub fn for_customer(
&self,
customer_id: impl Into<String>,
) -> CustomerChatRequestBuilder
pub fn for_customer( &self, customer_id: impl Into<String>, ) -> CustomerChatRequestBuilder
Create a builder for customer-attributed chat requests.
Customer-attributed requests use the customer’s tier to determine which model to use, so no model parameter is required.
Sourcepub async fn proxy_customer(
&self,
customer_id: &str,
body: CustomerProxyRequestBody,
options: ProxyOptions,
) -> Result<ProxyResponse, Error>
pub async fn proxy_customer( &self, customer_id: &str, body: CustomerProxyRequestBody, options: ProxyOptions, ) -> Result<ProxyResponse, Error>
Execute a customer-attributed proxy request (non-streaming).
The customer_id is sent via the X-ModelRelay-Customer-Id header.
Sourcepub async fn proxy_customer_stream(
&self,
customer_id: &str,
body: CustomerProxyRequestBody,
options: ProxyOptions,
) -> Result<StreamHandle, Error>
Available on crate feature streaming only.
pub async fn proxy_customer_stream( &self, customer_id: &str, body: CustomerProxyRequestBody, options: ProxyOptions, ) -> Result<StreamHandle, Error>
streaming only.Execute a customer-attributed proxy request (streaming).
The customer_id is sent via the X-ModelRelay-Customer-Id header.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LLMClient
impl !RefUnwindSafe for LLMClient
impl Send for LLMClient
impl Sync for LLMClient
impl Unpin for LLMClient
impl !UnwindSafe for LLMClient
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