LibreChat/api/server/services/Files
Danny Avila 81139046e5
🔄 refactor: Convert OCR Tool Resource to Context (#9699)
* WIP: conversion of `ocr` to `context`

* refactor: make `primeResources` backwards-compatible for `ocr` tool_resources

* refactor: Convert legacy `ocr` tool resource to `context` in agent updates

- Implemented conversion logic to replace `ocr` with `context` in both incoming updates and existing agent data.
- Merged file IDs and files from `ocr` into `context` while ensuring deduplication.
- Updated tools array to reflect the change from `ocr` to `context`.

* refactor: Enhance context file handling in agent processing

- Updated the logic for managing context files by consolidating file IDs from both `ocr` and `context` resources.
- Improved backwards compatibility by ensuring that context files are correctly populated and handled.
- Simplified the iteration over context files for better readability and maintainability.

* refactor: Enhance tool_resources handling in primeResources

- Added tests to verify the deletion behavior of tool_resources fields, ensuring original objects remain unchanged.
- Implemented logic to delete `ocr` and `context` fields after fetching and re-categorizing files.
- Preserved context field when the context capability is disabled, ensuring correct behavior in various scenarios.

* refactor: Replace `ocrEnabled` with `contextEnabled` in AgentConfig

* refactor: Adjust legacy tool handling order for improved clarity

* refactor: Implement OCR to context conversion functions and remove original conversion logic in update agent handling

* refactor: Move contextEnabled declaration to maintain consistent order in capabilities

* refactor: Update localization keys for file context to improve clarity and accuracy

* chore: Update localization key for file context information to improve clarity
2025-09-18 20:06:59 -04:00
..
Audio 🗣️ feat: Language Support for OpenAI Speech-to-Text (#9470) 2025-09-05 12:01:00 -04:00
Azure 🛜 refactor: Streamline App Config Usage (#9234) 2025-08-26 12:10:18 -04:00
Citations 🔍 fix: Display File Search Citations Based on Permissions (#9454) 2025-09-05 09:14:55 -04:00
Code 🛜 refactor: Streamline App Config Usage (#9234) 2025-08-26 12:10:18 -04: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: Upload as Text Support for Plaintext, STT, RAG, and Token Limits (#8868) 2025-08-27 03:44:39 -04: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
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 🗃️ refactor: File Access via Agent; Deny Deletion if not Editor, Allow Viewer (#9357) 2025-08-28 21:16:23 -04:00
process.js 🔄 refactor: Convert OCR Tool Resource to Context (#9699) 2025-09-18 20:06:59 -04: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