Closed Valdanitooooo closed 1 week ago
Suggestion: To make it more readable, please use entire words to name a variables exposed/visible to users. Like:
To make it more readable, please use entire words to name a variables exposed/visible to users.
@KevinHuSh Great suggestion. I am doing this to ensure compatibility with both Web API, SDK API, and Server API, so that I can directly copy the request parameters from the browser to use the SDK or Swagger docs. Do we have a plan to refactor front-end requests? I didn't dare to modify other people's code because I was afraid it would have too much impact.
Refactoring will bring a lot of workload. If we don't refactor the front-end requests, it's also a good choice to let all three use the same logic. Just use the same parameters in the SDK API and Server API, and use a different set of parameters in the Web API. Do you have any ideas?
I have extracted the business logic into the services package. I believe that if web APIs can also use these logics, future functionality will be better maintained.
api/apps
├── apis
│ └── datasets.py --
├── services ⬇️
│ └── dataset_service.py
├── ... ⬆️
├── ... ⬆️
└── kb_app.py --⬆️
I dare not either ^^ So, for SDK and openapi firstly.
What problem does this PR solve?
ragflow.get_all_datasets()
===>ragflow.dataset.list()
if "parser_config" in json_data
===>if json_data["parser_config"]
Parameter validation configuration
When my parameter is
Error messages
Type of change