test: align backend boundary and schema contract tests with current behavior
This commit is contained in:
@@ -48,6 +48,7 @@ async def test_non_stream_chat_uses_backend_neutral_result():
|
||||
session_id="session-001",
|
||||
text="发生了交通事故",
|
||||
need_form_update=True,
|
||||
client_mode="direct",
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@ def test_chat_request_defaults_are_backward_compatible() -> None:
|
||||
|
||||
assert request.model_dump() == {
|
||||
**chat_request_payload(),
|
||||
"clientMode": "direct",
|
||||
"needFormUpdate": False,
|
||||
"useTextChunk": False,
|
||||
}
|
||||
@@ -159,7 +160,7 @@ def test_required_fields_remain_required(
|
||||
(ProcessRequest_get, get_request_payload, "sessionId", "s" * 65),
|
||||
(ProcessRequest_set, set_request_payload, "timeStamp", "t" * 33),
|
||||
(ProcessResponse_chat, chat_response_payload, "nextStage", "n" * 33),
|
||||
(ProcessResponse_chat, chat_response_payload, "nextStageCode", "10020"),
|
||||
(ProcessResponse_chat, chat_response_payload, "nextStageCode", "s" * 33),
|
||||
(ProcessResponse_chat, chat_response_payload, "code", "10000"),
|
||||
(ProcessResponse_get, get_response_payload, "code", "10000"),
|
||||
(ProcessResponse_set, set_response_payload, "code", "10000"),
|
||||
|
||||
@@ -42,8 +42,8 @@ async def test_complete_translates_fastgpt_response_to_neutral_result():
|
||||
"newVariables": {"status_code": "1002"},
|
||||
"responseData": [
|
||||
{
|
||||
"moduleName": "文本内容提取事故信息",
|
||||
"extractResult": {
|
||||
"moduleName": "更新表单",
|
||||
"customOutputs": {
|
||||
"formUpdate": '{"jdcsl": 2, "ywrysw": false}'
|
||||
},
|
||||
}
|
||||
@@ -58,6 +58,7 @@ async def test_complete_translates_fastgpt_response_to_neutral_result():
|
||||
session_id="session-001",
|
||||
text="发生了交通事故",
|
||||
need_form_update=True,
|
||||
client_mode="direct",
|
||||
)
|
||||
)
|
||||
|
||||
@@ -71,7 +72,7 @@ async def test_complete_translates_fastgpt_response_to_neutral_result():
|
||||
"chatId": "session-001",
|
||||
"stream": False,
|
||||
"detail": True,
|
||||
"variables": {"needFormUpdate": True},
|
||||
"variables": {"needFormUpdate": True, "clientMode": "direct"},
|
||||
}
|
||||
]
|
||||
|
||||
@@ -92,8 +93,8 @@ async def test_stream_translates_fastgpt_events_to_neutral_events(monkeypatch):
|
||||
kind="flowResponses",
|
||||
data=[
|
||||
{
|
||||
"moduleName": "文本内容提取事故信息",
|
||||
"extractResult": {"formUpdate": '{"jdcsl": 2}'},
|
||||
"moduleName": "更新表单",
|
||||
"customOutputs": {"formUpdate": '{"jdcsl": 2}'},
|
||||
}
|
||||
],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user