Simplify client mode to single FastGPT app
This commit is contained in:
@@ -2,42 +2,15 @@ import pytest
|
||||
from pydantic import ValidationError
|
||||
|
||||
from src.api.endpoints import external_stage_code
|
||||
from src.schemas.models import (
|
||||
ProcessRequest_chat,
|
||||
ProcessRequest_delete_session,
|
||||
ProcessRequest_get,
|
||||
ProcessRequest_set,
|
||||
)
|
||||
from src.schemas.models import ProcessRequest_chat
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("request_model", "payload"),
|
||||
[
|
||||
(
|
||||
ProcessRequest_chat,
|
||||
{"sessionId": "session-1", "timeStamp": "1", "text": "你好"},
|
||||
),
|
||||
(
|
||||
ProcessRequest_set,
|
||||
{
|
||||
"sessionId": "session-1",
|
||||
"timeStamp": "1",
|
||||
"key": "name",
|
||||
"value": "张三",
|
||||
},
|
||||
),
|
||||
(
|
||||
ProcessRequest_get,
|
||||
{"sessionId": "session-1", "timeStamp": "1", "key": "name"},
|
||||
),
|
||||
(
|
||||
ProcessRequest_delete_session,
|
||||
{"sessionId": "session-1", "timeStamp": "1"},
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_client_mode_defaults_to_direct(request_model, payload):
|
||||
request = request_model(**payload)
|
||||
def test_client_mode_defaults_to_direct():
|
||||
request = ProcessRequest_chat(
|
||||
sessionId="session-1",
|
||||
timeStamp="1",
|
||||
text="你好",
|
||||
)
|
||||
|
||||
assert request.clientMode == "direct"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user