pub struct OpenRouterClient {
pub api_key: String,
pub base_url: String,
pub http_referer: Option<String>,
pub x_title: Option<String>,
/* private fields */
}Fields§
§api_key: String§base_url: String§http_referer: Option<String>§x_title: Option<String>Implementations§
Source§impl OpenRouterClient
impl OpenRouterClient
pub fn builder() -> OpenRouterClientBuilder
pub fn build_headers(&self) -> Result<HeaderMap>
Source§impl OpenRouterClient
impl OpenRouterClient
pub async fn chat_completion( &self, request: ChatCompletionRequest, ) -> Result<ChatCompletionResponse>
Source§impl OpenRouterClient
impl OpenRouterClient
pub async fn chat_completion_stream( &self, request: ChatCompletionRequest, ) -> Result<ChatCompletionStream>
Source§impl OpenRouterClient
impl OpenRouterClient
pub async fn list_providers(&self) -> Result<ProvidersResponse>
Source§impl OpenRouterClient
impl OpenRouterClient
pub async fn list_models( &self, params: Option<ListModelsParams>, ) -> Result<ModelsResponse>
pub async fn get_models_count(&self) -> Result<ModelsCountResponse>
pub async fn list_models_user(&self) -> Result<ModelsResponse>
Source§impl OpenRouterClient
impl OpenRouterClient
pub async fn get_generation( &self, generation_id: impl Into<String>, ) -> Result<GenerationResponse>
Trait Implementations§
Source§impl Clone for OpenRouterClient
impl Clone for OpenRouterClient
Source§fn clone(&self) -> OpenRouterClient
fn clone(&self) -> OpenRouterClient
Returns a duplicate of the value. Read more
1.0.0 · 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 Freeze for OpenRouterClient
impl !RefUnwindSafe for OpenRouterClient
impl Send for OpenRouterClient
impl Sync for OpenRouterClient
impl Unpin for OpenRouterClient
impl !UnwindSafe for OpenRouterClient
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