pub struct HttpExtractionProvider { /* private fields */ }Expand description
HTTP-based extraction provider that calls OpenAI, Anthropic, or Ollama APIs.
Implementations§
Source§impl HttpExtractionProvider
impl HttpExtractionProvider
pub fn new(config: ExtractionConfig) -> Result<Self, ExtractionError>
Sourcepub async fn expand_query(
&self,
query: &str,
) -> Result<Vec<String>, ExtractionError>
pub async fn expand_query( &self, query: &str, ) -> Result<Vec<String>, ExtractionError>
Expand a search query into multiple sub-queries via LLM.
Given a natural language question, identifies the expected answer type and extracts 2-3 targeted search queries. The first line of the response is the answer type (PLACE, DATE, NUMBER, NAME, PERSON, BRAND, etc.), followed by the search queries.
For counting/aggregation/comparison queries, also generates comprehensive category synonyms for exhaustive BM25 sweep.
Sourcepub async fn call_with_retry(
&self,
conversation: &str,
system_prompt: &str,
) -> Result<String, ExtractionError>
pub async fn call_with_retry( &self, conversation: &str, system_prompt: &str, ) -> Result<String, ExtractionError>
Execute a request with retry logic for rate limits (HTTP 429). Uses exponential backoff: 1s, 2s, 4s.
Sourcepub async fn call_text_with_retry(
&self,
conversation: &str,
system_prompt: &str,
) -> Result<String, ExtractionError>
pub async fn call_text_with_retry( &self, conversation: &str, system_prompt: &str, ) -> Result<String, ExtractionError>
Like call_with_retry but without forcing JSON response format. Use for prompts that expect plain text output (synthesis, re-ranking, etc).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HttpExtractionProvider
impl !RefUnwindSafe for HttpExtractionProvider
impl Send for HttpExtractionProvider
impl Sync for HttpExtractionProvider
impl Unpin for HttpExtractionProvider
impl UnsafeUnpin for HttpExtractionProvider
impl !UnwindSafe for HttpExtractionProvider
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