fix(extractor): streaming with guardrails + catalyst_type normalization
- Switch Ollama calls from non-streaming to streaming with early termination - Add loop detection, max token limit, and stall timeout guards - Add catalyst_type alias normalizer to handle model hallucinations - Add explicit enum values in extraction prompt for catalyst_type - Add streaming config knobs to OllamaConfig
This commit is contained in:
@@ -114,6 +114,8 @@ Fill these fields:
|
||||
|
||||
For each company entry fill: ticker, company_name, relevance (0-1), sentiment, impact_score (0-1), impact_horizon, catalyst_type, key_facts (list), risks (list), evidence_spans (verbatim quotes from text).
|
||||
|
||||
catalyst_type MUST be exactly one of: earnings, product, legal, macro, supply_chain, m_and_a, rating_change, other. Use "other" if none of the specific categories fit.
|
||||
|
||||
--- DOCUMENT TEXT ---
|
||||
{document_text}
|
||||
--- END DOCUMENT TEXT ---"""
|
||||
|
||||
Reference in New Issue
Block a user