mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-30 23:26:36 +08:00
Align p3 HTTP/SDK tests with current backend behavior (#12563)
### What problem does this PR solve? Updates pre-existing HTTP API and SDK tests to align with current backend behavior (validation errors, 404s, and schema defaults). This ensures p3 regression coverage is accurate without changing production code. ### Type of change - [x] Other (please describe): align p3 HTTP/SDK tests with current backend behavior --------- Co-authored-by: Liu An <asiro@qq.com>
This commit is contained in:
@ -265,7 +265,6 @@ async def not_found(error):
|
||||
"message": error_msg,
|
||||
}, 404
|
||||
|
||||
|
||||
@app.teardown_request
|
||||
def _db_close(exception):
|
||||
if exception:
|
||||
|
||||
@ -176,7 +176,7 @@ async def update(tenant_id, chat_id):
|
||||
req["llm_id"] = llm.pop("model_name")
|
||||
if req.get("llm_id") is not None:
|
||||
llm_name, llm_factory = TenantLLMService.split_model_name_and_factory(req["llm_id"])
|
||||
model_type = llm.pop("model_type")
|
||||
model_type = llm.get("model_type")
|
||||
model_type = model_type if model_type in ["chat", "image2text"] else "chat"
|
||||
if not TenantLLMService.query(tenant_id=tenant_id, llm_name=llm_name, llm_factory=llm_factory, model_type=model_type):
|
||||
return get_error_data_result(f"`model_name` {req.get('llm_id')} doesn't exist")
|
||||
|
||||
Reference in New Issue
Block a user