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:
Xinghan Pan
2025-03-13 19:06:50 +08:00
committed by GitHub
parent 940072592f
commit 47926f7d21
8 changed files with 591 additions and 24 deletions

View File

@ -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)
```
---
---