LibreChat/packages/api/src/files
papasaidfine 4fe223eedd
Some checks are pending
Docker Dev Branch Images Build / build (Dockerfile, lc-dev, node) (push) Waiting to run
Docker Dev Branch Images Build / build (Dockerfile.multi, lc-dev-api, api-build) (push) Waiting to run
🎞️ feat: OpenRouter Audio/Video File Upload Support (#11070)
* Added video upload support for OpenRouter

- Added VIDEO_URL content type to support video_url message format
- Implemented OpenRouter video encoding using base64 data URLs
- Extended encodeAndFormatVideos() to handle OpenRouter provider
- Updated UI to accept video uploads for OpenRouter (mp4, webm, mpeg, mov)
- Fixed case-sensitivity in provider detection for agents
- Made isDocumentSupportedProvider() and isOpenAILikeProvider() case-insensitive

Videos are now converted to data:video/mp4;base64,... format compatible
with OpenRouter's API requirements per their documentation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* refactor: change multimodal and google_multimodal to more transparent variable names of image_document and image_document_video_audio

(also google_multimodal doesn't apply as much since we are adding support for video and audio uploads for open router)

* fix: revert .toLowerCase change to isOpenAILikeProvider and isDocumentSupportedProvider which broke upload to provider detection for openAI endpoints

* wip: add audio support to openrouter

* fix: filetypes now properly parsed and sent rather than destructured mimetypes for openrouter

* refactor: Omit to Exclude for ESLint

* feat: update DragDropModal for new openrouter support

* fix: special case openrouter for lower case provider

(currently getting issues with the provider coming in as 'OpenRouter' and our enum being 'openrouter') This will probably require a larger refactor later to handle case insensitivity for all providers, but that will have to be thoroughly tested in its own isolated PR

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: Dustin Healy <54083382+dustinhealy@users.noreply.github.com>
2025-12-25 13:23:29 -05:00
..
encode 🎞️ feat: OpenRouter Audio/Video File Upload Support (#11070) 2025-12-25 13:23:29 -05:00
mistral 🔍 refactor: OCR Fully Optional with Defaults for "Upload as Text" (#9856) 2025-09-26 11:56:11 -04:00
audio.ts 🔧 fix: Upload Audio as Text missing Param (#9356) 2025-08-28 21:07:30 -04:00
context.ts ⚗️ refactor: Provider File Validation with Configurable Size Limits (#10405) 2025-11-07 10:57:15 -05:00
filter.spec.ts 🖼️ feat: File Size and MIME Type Filtering at Agent level (#10446) 2025-11-10 21:36:48 -05:00
filter.ts 🖼️ feat: File Size and MIME Type Filtering at Agent level (#10446) 2025-11-10 21:36:48 -05:00
index.ts 📂 refactor: Cleanup File Filtering Logic, Improve Validation (#10414) 2025-11-10 19:05:30 -05:00
ocr.ts 🔍 refactor: OCR Fully Optional with Defaults for "Upload as Text" (#9856) 2025-09-26 11:56:11 -04:00
parse.ts 🛜 refactor: Streamline App Config Usage (#9234) 2025-08-26 12:10:18 -04:00
text.spec.ts ⏱️ fix: Increase RAG API Text Parsing Timeout (#10562) 2025-11-25 14:54:53 -05:00
text.ts ⏱️ fix: Increase RAG API Text Parsing Timeout (#10562) 2025-11-25 14:54:53 -05:00
validation.spec.ts ⚗️ refactor: Provider File Validation with Configurable Size Limits (#10405) 2025-11-07 10:57:15 -05:00
validation.ts 🖼️ feat: File Size and MIME Type Filtering at Agent level (#10446) 2025-11-10 21:36:48 -05:00