pub struct OpenAICompatibleClient { /* private fields */ }Expand description
Shared HTTP client for OpenAI-compatible providers
Implementations§
Source§impl OpenAICompatibleClient
impl OpenAICompatibleClient
Sourcepub fn with_retry_policy(retry_policy: RetryPolicy) -> Self
pub fn with_retry_policy(retry_policy: RetryPolicy) -> Self
Create a new OpenAI-compatible HTTP client with custom retry policy
Sourcepub async fn execute_chat_request(
&self,
url: &str,
headers: &HeaderMap,
request: &OpenAIRequest,
) -> LlmResult<OpenAIResponse>
pub async fn execute_chat_request( &self, url: &str, headers: &HeaderMap, request: &OpenAIRequest, ) -> LlmResult<OpenAIResponse>
Execute a chat completion request with retry logic
Sourcepub fn build_auth_headers(api_key: &str) -> LlmResult<HeaderMap>
pub fn build_auth_headers(api_key: &str) -> LlmResult<HeaderMap>
Execute authentication header for OpenAI-compatible APIs
Sourcepub async fn set_retry_policy(&self, policy: RetryPolicy)
pub async fn set_retry_policy(&self, policy: RetryPolicy)
Set retry policy for subsequent requests
Sourcepub async fn restore_default_retry_policy(&self, default_policy: &RetryPolicy)
pub async fn restore_default_retry_policy(&self, default_policy: &RetryPolicy)
Restore default retry policy
Trait Implementations§
Source§impl Debug for OpenAICompatibleClient
impl Debug for OpenAICompatibleClient
Auto Trait Implementations§
impl !Freeze for OpenAICompatibleClient
impl !RefUnwindSafe for OpenAICompatibleClient
impl Send for OpenAICompatibleClient
impl Sync for OpenAICompatibleClient
impl Unpin for OpenAICompatibleClient
impl !UnwindSafe for OpenAICompatibleClient
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