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
Source§impl OpenRouterClient
impl OpenRouterClient
Sourcepub fn build_analysis_prompt(&self, request: &AnalysisRequest) -> String
pub fn build_analysis_prompt(&self, request: &AnalysisRequest) -> String
Build content analysis prompt
Sourcepub fn parse_match_result(&self, response: &str) -> Result<MatchResult>
pub fn parse_match_result(&self, response: &str) -> Result<MatchResult>
Parse matching results from AI response
Sourcepub fn build_verification_prompt(&self, request: &VerificationRequest) -> String
pub fn build_verification_prompt(&self, request: &VerificationRequest) -> String
Build verification prompt
Sourcepub fn parse_confidence_score(&self, response: &str) -> Result<ConfidenceScore>
pub fn parse_confidence_score(&self, response: &str) -> Result<ConfidenceScore>
Parse confidence score from AI response
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
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