LibreChat/api/server/services/Files
Dustin Healy 89843262b2 📑 feat: Anthropic Direct Provider Upload (#9072)
* feat: implement Anthropic native PDF support with document preservation

- Add comprehensive debug logging throughout PDF processing pipeline
- Refactor attachment processing to separate image and document handling
- Create distinct addImageURLs(), addDocuments(), and processAttachments() methods
- Fix critical bugs in stream handling and parameter passing
- Add streamToBuffer utility for proper stream-to-buffer conversion
- Remove api/agents submodule from repository

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

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

* chore: remove out of scope formatting changes

* fix: stop duplication of file in chat on end of response stream

* chore: bring back file search and ocr options

* chore: localize upload to provider string in file menu

* refactor: change createMenuItems args to fit new pattern introduced by anthropic-native-pdf-support

* feat: add cache point for pdfs processed by anthropic endpoint since they are unlikely to change and should benefit from caching

* feat: combine Upload Image into Upload to Provider since they both perform direct upload and change provider upload icon to reflect multimodal upload

* feat: add citations support according to docs

* refactor: remove redundant 'document' check since documents are handled properly by formatMessage in the agents repo now

* refactor: change upload logic so anthropic endpoint isn't exempted from normal upload path using Agents for consistency with the rest of the upload logic

* fix: include width and height in return from uploadLocalFile so images are correctly identified when going through an AgentUpload in addImageURLs

* chore: remove client specific handling since the direct provider stuff is handled by the agent client

* feat: handle documents in AgentClient so no need for change to agents repo

* chore: removed unused changes

* chore: remove auto generated comments from OG commit

* feat: add logic for agents to use direct to provider uploads if supported (currently just anthropic)

* fix: reintroduce role check to fix render error because of undefined value for Content Part

* fix: actually fix render bug by using proper isCreatedByUser check and making sure our mutation of formattedMessage.content is consistent

---------

Co-authored-by: Andres Restrepo <andres@thelinuxkid.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-08-27 09:18:11 -07:00
..
Audio 📎 feat: Upload as Text Support for Plaintext, STT, RAG, and Token Limits (#8868) 2025-08-27 03:44:39 -04:00
Azure 🛜 refactor: Streamline App Config Usage (#9234) 2025-08-26 12:10:18 -04:00
Citations 🛜 refactor: Streamline App Config Usage (#9234) 2025-08-26 12:10:18 -04:00
Code 🛜 refactor: Streamline App Config Usage (#9234) 2025-08-26 12:10:18 -04:00
documents 📑 feat: Anthropic Direct Provider Upload (#9072) 2025-08-27 09:18:11 -07:00
Firebase 🛜 refactor: Streamline App Config Usage (#9234) 2025-08-26 12:10:18 -04:00
images 📎 feat: Upload as Text Support for Plaintext, STT, RAG, and Token Limits (#8868) 2025-08-27 03:44:39 -04:00
Local 📑 feat: Anthropic Direct Provider Upload (#9072) 2025-08-27 09:18:11 -07:00
OpenAI 🛜 refactor: Streamline App Config Usage (#9234) 2025-08-26 12:10:18 -04:00
S3 🛜 refactor: Streamline App Config Usage (#9234) 2025-08-26 12:10:18 -04:00
validation 📑 feat: Anthropic Direct Provider Upload (#9072) 2025-08-27 09:18:11 -07:00
VectorDB 📎 feat: Upload as Text Support for Plaintext, STT, RAG, and Token Limits (#8868) 2025-08-27 03:44:39 -04:00
index.js 🏪 feat: Agent Marketplace 2025-08-13 16:24:18 -04:00
permissions.js 🛂 feat: Role as Permission Principal Type 2025-08-13 16:24:23 -04:00
process.js 📑 feat: Anthropic Direct Provider Upload (#9072) 2025-08-27 09:18:11 -07:00
processFiles.test.js 📎 feat: Upload as Text Support for Plaintext, STT, RAG, and Token Limits (#8868) 2025-08-27 03:44:39 -04:00
strategies.js 🔒 feat: Implement Granular File Storage Strategies and Access Control Middleware 2025-08-13 16:24:19 -04:00