mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Improve API Documentation, Standardize Error Handling, and Enhance Comments (#5990)
### What problem does this PR solve? - The API documentation lacks detailed error code explanations. Added error code tables to `python_api_reference.md` and `http_api_reference.md` to clarify possible error codes and their meanings. - Error handling in the codebase is inconsistent. Standardized error handling logic in `sdk/python/ragflow_sdk/modules/chunk.py`. - Improved API comments by adding standardized docstrings to enhance code readability and maintainability. ### Type of change - [x] Documentation Update - [x] Refactoring
This commit is contained in:
@ -317,6 +317,23 @@ dataset = rag_object.list_datasets(name="kb_name")
|
||||
dataset.update({"embedding_model":"BAAI/bge-zh-v1.5", "chunk_method":"manual"})
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Error Codes
|
||||
|
||||
---
|
||||
|
||||
| Code | Message | Description |
|
||||
|------|---------|-------------|
|
||||
| 400 | Bad Request | Invalid request parameters |
|
||||
| 401 | Unauthorized | Unauthorized access |
|
||||
| 403 | Forbidden | Access denied |
|
||||
| 404 | Not Found | Resource not found |
|
||||
| 500 | Internal Server Error | Server internal error |
|
||||
| 1001 | Invalid Chunk ID | Invalid Chunk ID |
|
||||
| 1002 | Chunk Update Failed | Chunk update failed |
|
||||
|
||||
|
||||
---
|
||||
|
||||
## FILE MANAGEMENT WITHIN DATASET
|
||||
@ -1719,4 +1736,6 @@ for agent in rag_object.list_agents():
|
||||
print(agent)
|
||||
```
|
||||
|
||||
---
|
||||
---
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user