Breaking Changes in Files/Batches Module
- Changed JSONL file format requirements for batch processing
- Restricted file extensions to
.jsonl only (removed support for .json, .txt, .ndjson)
- Added stricter validation for file contents and structure
Changed
- Updated Files API validation to properly handle 'batch' purpose
- Added support for additional MIME types: application/x-jsonlines, application/jsonl, application/x-ndjson, application/x-ndjason
- Updated JSONL file format documentation and examples
- Updated tests to use new JSONL format and purpose
- Improved file validation order in FileManager.php
- Fixed JSONL file validation in FileManager to properly check content format
- Enhanced error messages for file type validation
- Improved test coverage for file upload functionality
Added
- New example file: examples/batch-processing.php
- Additional test cases for JSONL file validation
- Improved error messages for file validation
- Test results: 39 tests, 218 assertions (all passing)
- Added more comprehensive validation for JSONL file contents
- Support for audio transcription and translation in batch processing
- Support for chat completions in batch processing
Fixed
- Issue with file type validation in FileManager::validateFile method
- Improved MIME type detection for JSONL files
- Fixed test case for file upload to use correct JSONL format
- Corrected JSONL test file structure to match API requirements
Migration Guide for Files/Batches Module
If you are using the Files/Batches module, you will need to:
- Update your JSONL files to include required fields:
custom_id: Your unique identifier for tracking
method: Must be "POST"
url: One of: /v1/chat/completions, /v1/audio/transcriptions, or /v1/audio/translations
body: Request parameters matching the endpoint format
- Ensure all files use
.jsonl extension
- Update file content to match new validation requirements
- Review the updated documentation for complete format specifications