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:
Celes Renata
2026-04-12 15:28:20 -07:00
parent 527be42f82
commit cd782d1552
4 changed files with 116 additions and 14 deletions
+4
View File
@@ -47,6 +47,10 @@ class OllamaConfig:
retry_base_delay: float = 1.0
retry_max_delay: float = 10.0
retry_backoff_multiplier: float = 2.0
max_tokens: int = 4096
stall_timeout: float = 30.0
loop_window: int = 64
loop_threshold: float = 0.5
@dataclass