pub struct OpenRouterClient { /* private fields */ }Expand description
OpenRouter client implementation
Implementations§
Source§impl OpenRouterClient
impl OpenRouterClient
Sourcepub fn new(
api_key: String,
model: String,
temperature: f32,
max_tokens: u32,
retry_attempts: u32,
retry_delay_ms: u64,
) -> Self
pub fn new( api_key: String, model: String, temperature: f32, max_tokens: u32, retry_attempts: u32, retry_delay_ms: u64, ) -> Self
Create new OpenRouterClient with default configuration
Sourcepub fn new_with_base_url_and_timeout(
api_key: String,
model: String,
temperature: f32,
max_tokens: u32,
retry_attempts: u32,
retry_delay_ms: u64,
base_url: String,
request_timeout_seconds: u64,
) -> Self
pub fn new_with_base_url_and_timeout( api_key: String, model: String, temperature: f32, max_tokens: u32, retry_attempts: u32, retry_delay_ms: u64, base_url: String, request_timeout_seconds: u64, ) -> Self
Create new OpenRouterClient with custom base URL and timeout
Sourcepub fn from_config(config: &AIConfig) -> Result<Self>
pub fn from_config(config: &AIConfig) -> Result<Self>
Create client from unified configuration
Trait Implementations§
Source§impl AIProvider for OpenRouterClient
impl AIProvider for OpenRouterClient
Source§fn analyze_content<'life0, 'async_trait>(
&'life0 self,
request: AnalysisRequest,
) -> Pin<Box<dyn Future<Output = Result<MatchResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn analyze_content<'life0, 'async_trait>(
&'life0 self,
request: AnalysisRequest,
) -> Pin<Box<dyn Future<Output = Result<MatchResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Analyze multimedia files and subtitle files for matching results. Read more
Source§fn verify_match<'life0, 'async_trait>(
&'life0 self,
verification: VerificationRequest,
) -> Pin<Box<dyn Future<Output = Result<ConfidenceScore>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn verify_match<'life0, 'async_trait>(
&'life0 self,
verification: VerificationRequest,
) -> Pin<Box<dyn Future<Output = Result<ConfidenceScore>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Verify file matching confidence. Read more
Source§impl Debug for OpenRouterClient
impl Debug for OpenRouterClient
Source§impl HttpRetryClient for OpenRouterClient
impl HttpRetryClient for OpenRouterClient
Source§fn retry_attempts(&self) -> u32
fn retry_attempts(&self) -> u32
Number of retry attempts.
Source§fn retry_delay_ms(&self) -> u64
fn retry_delay_ms(&self) -> u64
Delay between retries in milliseconds.
Source§async fn make_request_with_retry(
&self,
request: RequestBuilder,
) -> Result<Response>
async fn make_request_with_retry( &self, request: RequestBuilder, ) -> Result<Response>
Make an HTTP request with retry logic.
Source§impl PromptBuilder for OpenRouterClient
impl PromptBuilder for OpenRouterClient
Source§fn build_analysis_prompt(&self, request: &AnalysisRequest) -> String
fn build_analysis_prompt(&self, request: &AnalysisRequest) -> String
Build analysis prompt.
Source§fn build_verification_prompt(&self, request: &VerificationRequest) -> String
fn build_verification_prompt(&self, request: &VerificationRequest) -> String
Build verification prompt.
Source§fn get_analysis_system_message() -> &'static str
fn get_analysis_system_message() -> &'static str
System message for analysis prompt.
Source§fn get_verification_system_message() -> &'static str
fn get_verification_system_message() -> &'static str
System message for verification prompt.
Source§impl ResponseParser for OpenRouterClient
impl ResponseParser for OpenRouterClient
Source§fn parse_match_result(&self, response: &str) -> Result<MatchResult>
fn parse_match_result(&self, response: &str) -> Result<MatchResult>
Parse match result.
Source§fn parse_confidence_score(&self, response: &str) -> Result<ConfidenceScore>
fn parse_confidence_score(&self, response: &str) -> Result<ConfidenceScore>
Parse confidence score.
Auto 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