ragflow/api/apps
hsparks.codes df871a9137 feat: Add batch metadata management API endpoints
Implements comprehensive batch metadata operations to make metadata
management easier for developers who previously could only edit metadata
one file at a time.

New API Endpoints:
1. POST /api/v1/document/batch_set_meta
   - Update metadata for multiple documents at once
   - Supports partial success (some docs succeed, others fail)
   - Returns detailed per-document results

2. POST /api/v1/document/get_meta
   - Retrieve metadata for a single document
   - Returns doc ID, name, and metadata fields

3. POST /api/v1/document/batch_get_meta
   - Retrieve metadata for multiple documents
   - Returns metadata for all accessible documents
   - Handles authorization and errors per document

4. POST /api/v1/document/list_metadata_fields
   - List all unique metadata field names in a knowledge base
   - Shows field types, example values, and usage count
   - Helps discover existing metadata schema

Features:
- Batch operations reduce API calls and improve UX
- Proper authorization checks for each document
- Type validation (str, int, float only)
- Partial success handling (continues on errors)
- Metadata field discovery for KB-wide analysis
- Comprehensive error handling and reporting

Test Coverage:
 10/10 unit tests passing
- Request validation
- Type checking
- Response structure validation
- Authorization logic
- Partial success handling
- JSON parsing
- Field type tracking

Benefits:
- Batch update 100s of documents in one API call
- Discover metadata schema across entire KB
- Better error handling with per-document results
- Maintains backward compatibility with existing /set_meta

Fixes #11564
2025-12-03 12:09:57 +01:00
..
auth Refa: make RAGFlow more asynchronous (#11601) 2025-12-01 14:24:06 +08:00
sdk Refa: make RAGFlow more asynchronous 2 (#11689) 2025-12-03 14:19:53 +08:00
__init__.py Refa: make RAGFlow more asynchronous (#11601) 2025-12-01 14:24:06 +08:00
api_app.py Refa: make RAGFlow more asynchronous (#11601) 2025-12-01 14:24:06 +08:00
canvas_app.py Refa: make RAGFlow more asynchronous (#11601) 2025-12-01 14:24:06 +08:00
chunk_app.py Refa: make RAGFlow more asynchronous 2 (#11689) 2025-12-03 14:19:53 +08:00
connector_app.py Refa: make RAGFlow more asynchronous 2 (#11689) 2025-12-03 14:19:53 +08:00
conversation_app.py Refa: make RAGFlow more asynchronous 2 (#11689) 2025-12-03 14:19:53 +08:00
dialog_app.py Refa: make RAGFlow more asynchronous (#11601) 2025-12-01 14:24:06 +08:00
document_app.py feat: Add batch metadata management API endpoints 2025-12-03 12:09:57 +01:00
evaluation_app.py Feat: RAG evaluation (#11674) 2025-12-03 17:00:58 +08:00
file2document_app.py Fix: file manager KB link issue. (#11648) 2025-12-02 12:14:27 +08:00
file_app.py Refa: make RAGFlow more asynchronous 2 (#11689) 2025-12-03 14:19:53 +08:00
kb_app.py Refa: make RAGFlow more asynchronous 2 (#11689) 2025-12-03 14:19:53 +08:00
langfuse_app.py Refa: make RAGFlow more asynchronous (#11601) 2025-12-01 14:24:06 +08:00
llm_app.py Refa: make RAGFlow more asynchronous (#11601) 2025-12-01 14:24:06 +08:00
mcp_server_app.py Refa: make RAGFlow more asynchronous (#11601) 2025-12-01 14:24:06 +08:00
plugin_app.py Feat: Alter flask to Quart for async API serving. (#11275) 2025-11-18 17:05:16 +08:00
search_app.py Refa: make RAGFlow more asynchronous (#11601) 2025-12-01 14:24:06 +08:00
system_app.py Feat: Alter flask to Quart for async API serving. (#11275) 2025-11-18 17:05:16 +08:00
tenant_app.py Refa: make RAGFlow more asynchronous (#11601) 2025-12-01 14:24:06 +08:00
user_app.py Refa: make RAGFlow more asynchronous (#11601) 2025-12-01 14:24:06 +08:00