What's New in v1.2.0
Added
- Structured Outputs for All LLM Providers: Implemented JSON schema-based structured outputs
- Ollama provider now uses
formatparameter with JSON schema - OpenAI provider now uses
response_formatwith json_schema - Ensures reliable title extraction without prompt engineering
- Auto-truncates titles exceeding 127 characters for Paperless NGX compatibility
- Comprehensive error handling for malformed JSON responses
- 28 new unit tests covering JSON parsing, truncation, and edge cases
- Cross-provider consistency tests ensure identical behavior
- Ollama provider now uses
- Testing Guide: Created TESTING_STRUCTURED_OUTPUTS.md
- Comprehensive guide for verifying structured outputs work correctly
- Troubleshooting steps for common issues
- Alternative format approaches for Ollama if needed
- Manual testing procedures for both providers
Changed
- Improved Response Parsing: Both providers now parse structured JSON responses
- Ollama: Added
_parse_structured_response()method - OpenAI: Added
_parse_structured_response()method - Consistent error messages guide users when models don't support structured outputs
- Ollama: Added
- Updated default Ollama model to gemma3:latest
Fixed
- JSON Schema maxLength: Corrected from 128 to 127 characters
- Now matches Paperless NGX's actual title limit
- Prevents models from generating titles that get truncated post-generation
- Schema properly constrains models to the real limit
Removed
- Simplified Prompts: Removed redundant "Output only the title text, nothing else" instruction
- JSON schema now enforces output format automatically
- Cleaner, more focused prompts
Full Changelog: v1.1.0...v1.2.0