Expand description
LLM extraction service with provider fallback LLM Extraction Service — orchestrator that uses AIProvider to extract structured data
Implements ScrapingService by delegating to one or more AIProviders.
Supports provider fallback: tries providers in order until one succeeds.
§Architecture
ScrapingService ← LlmExtractionService → AIProvider (Claude, GPT, Gemini, …)
↑ ↓
ServiceInput FallbackChain
{ url, params } [primary, secondary, …]The params field of ServiceInput must contain:
schema: JSON schema object defining the expected output shapecontent(optional): If present, used as-is. Otherwisedatafrom a prior pipeline stage should be passed viaurl.
§Example
use stygian_graph::application::extraction::{LlmExtractionService, ExtractionConfig};
use stygian_graph::ports::{ScrapingService, ServiceInput};
use serde_json::json;
// Provider built separately — inject via Arc<dyn AIProvider>
// let service = LlmExtractionService::new(providers, ExtractionConfig::default());
// let output = service.execute(input).await.unwrap();Structs§
- Extraction
Config - Configuration for the LLM extraction service
- LlmExtraction
Service - LLM-based structured data extraction service