mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-06 03:18:36 +08:00
Fix: add /v1/document/upload_info -> /api/v1/documents/upload back (#16264)
This commit is contained in:
@@ -34,6 +34,7 @@ Deprecated APIs and their replacements:
|
||||
- PUT /api/v1/chats/{chat_id}/sessions/{session_id} -> PATCH /api/v1/chats/{chat_id}/sessions/{session_id}
|
||||
- DELETE /api/v1/chats -> DELETE /api/v1/chats/{chat_id} (with body)
|
||||
- POST /api/v1/file/convert -> POST /api/v1/files/link-to-datasets
|
||||
- POST /v1/document/upload_info -> POST /api/v1/documents/upload
|
||||
- GET /api/v1/file/* -> GET /api/v1/files*
|
||||
- POST /api/v1/file/* -> POST /api/v1/files*
|
||||
- GET /api/v1/document/get/{doc_id} -> GET /api/v1/documents/{doc_id}/preview
|
||||
@@ -563,6 +564,25 @@ async def deprecated_file_upload_info():
|
||||
return await document_api.upload_info(tenant_id=tenant_id)
|
||||
|
||||
|
||||
@legacy_v1_manager.route("/document/upload_info", methods=["POST"])
|
||||
@login_required
|
||||
async def deprecated_legacy_document_upload_info():
|
||||
"""
|
||||
Deprecated: Use POST /api/v1/documents/upload instead.
|
||||
|
||||
Old path: POST /v1/document/upload_info
|
||||
New path: POST /api/v1/documents/upload
|
||||
"""
|
||||
from api.apps import current_user
|
||||
|
||||
logging.warning(
|
||||
"API endpoint /v1/document/upload_info is deprecated. "
|
||||
"Please use POST /api/v1/documents/upload instead."
|
||||
)
|
||||
tenant_id = current_user.id
|
||||
return await document_api.upload_info(tenant_id=tenant_id)
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Document APIs
|
||||
# =============================================================================
|
||||
|
||||
@@ -39,6 +39,7 @@ The following v0.24.0 REST API paths are deprecated. They remain available throu
|
||||
| **POST** `/api/v1/sessions/related_questions` | **POST** `/api/v1/chat/recommandation` |
|
||||
| **PUT** `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks/{chunk_id}` | **PATCH** `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks/{chunk_id}` |
|
||||
| **GET** `/v1/system/healthz` | **GET** `/api/v1/system/healthz` |
|
||||
| **POST** `/v1/document/upload_info` | **POST** `/api/v1/documents/upload` |
|
||||
| **POST** `/api/v1/file/upload` | **POST** `/api/v1/files` |
|
||||
| **POST** `/api/v1/file/create` | **POST** `/api/v1/files` |
|
||||
| **GET** `/api/v1/file/list` | **GET** `/api/v1/files` |
|
||||
@@ -6928,14 +6929,18 @@ Failure:
|
||||
- Query:
|
||||
- `url`: URL to crawl and convert to a runtime attachment (mutually exclusive with `file`).
|
||||
|
||||
```bash
|
||||
##### Request example
|
||||
|
||||
Upload a local file:
|
||||
|
||||
```bash
|
||||
curl --request POST \
|
||||
--url http://{address}/api/v1/documents/upload \
|
||||
--header 'Content-Type: multipart/form-data' \
|
||||
--header 'Authorization: Bearer <YOUR_API_KEY>' \
|
||||
--form 'file=@./test1.pdf'
|
||||
```
|
||||
|
||||
|
||||
Crawl a URL:
|
||||
|
||||
```bash
|
||||
@@ -6950,7 +6955,7 @@ Upload a local file:
|
||||
The file to upload. Mutually exclusive with `url`; either `file` or `url` must be provided.
|
||||
- `url`: (*Query parameter*), `string`, *Optional*
|
||||
A URL to crawl and store as an attachment. Mutually exclusive with `file`; either `url` or `file` must be provided.
|
||||
|
||||
|
||||
#### Response
|
||||
|
||||
Success:
|
||||
@@ -6960,7 +6965,7 @@ Crawl a URL:
|
||||
"code": 0,
|
||||
"data": {
|
||||
"created_at": 1772451421.7924063,
|
||||
"created_by": "be951084066611f18f5f00155d2f98f4",
|
||||
"created_by": "be951084066611f18f5f00155d2f98f4",
|
||||
"extension": "pdf",
|
||||
"id": "2143a03d162c11f1b80f00155d334d02",
|
||||
"mime_type": "application/pdf",
|
||||
|
||||
Reference in New Issue
Block a user