ragflow/api
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
..
apps feat: Add batch metadata management API endpoints 2025-12-03 12:09:57 +01:00
common Feat:admin api (#10642) 2025-10-18 16:09:48 +08:00
db Feat: RAG evaluation (#11674) 2025-12-03 17:00:58 +08:00
utils feat: Auto-disable Raptor for structured data (Issue #11653) (#11676) 2025-12-03 17:02:29 +08:00
__init__.py Fix: incorrect async chat streamly output (#11679) 2025-12-03 11:15:45 +08:00
constants.py Introduce common/constants.py (#10965) 2025-11-03 16:32:37 +08:00
ragflow_server.py Refa: make RAGFlow more asynchronous (#11601) 2025-12-01 14:24:06 +08:00
settings.py Move api.settings to common.settings (#11036) 2025-11-06 09:36:38 +08:00
validation.py Fix errors detected by Ruff (#3918) 2024-12-08 14:21:12 +08:00