feat(07-02): singleton OpenAIProvider + GenericOpenAIProvider + MAX_AI_CHARS removal

- openai_provider.py: singleton self._client=AsyncOpenAI(...) in __init__ (D-07),
  _truncate() 60/40 smart truncation (D-13), removed MAX_AI_CHARS constant,
  changed __init__ signature to include context_chars, removed _client() method
- generic_openai_provider.py: new class, subclasses OpenAIProvider, conditional
  response_format={"type":"json_object"} on supports_json_mode flag (D-01/D-02),
  imports parse_classification + parse_suggestions from ai.utils (D-02 contract)
- ollama_provider.py: added context_chars kwarg with default 8000, passes through
- lmstudio_provider.py: added context_chars kwarg with default 8000, passes through
- classifier.py: removed MAX_AI_CHARS constant and text[:MAX_AI_CHARS] slices;
  truncation now handled inside each provider via _truncate()
- requirements.txt: bumped anthropic floor to >=0.95.0 (D-03 output_config support)
This commit is contained in:
curo1305
2026-06-04 18:58:19 +02:00
parent beb5b5e49d
commit 02bcbb9143
6 changed files with 152 additions and 20 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ uvicorn[standard]>=0.29
python-multipart>=0.0.27
pydantic-settings>=2.2
pydantic[email]>=2.0
anthropic>=0.26
anthropic>=0.95.0
openai>=1.30
PyMuPDF>=1.26.7
python-docx>=1.1