#5 Реализовать клиентскую часть канала общения. Добавлены новые ивенты агента
This commit is contained in:
parent
bd516cee43
commit
f00cf48ba2
1 changed files with 5 additions and 0 deletions
|
|
@ -33,6 +33,9 @@ def test_client_message_invalid(data):
|
||||||
[
|
[
|
||||||
({"type": "STATUS"}, MsgStatus),
|
({"type": "STATUS"}, MsgStatus),
|
||||||
({"type": "AGENT_EVENT_TEXT_CHUNK", "text": "hi"}, MsgEventTextChunk),
|
({"type": "AGENT_EVENT_TEXT_CHUNK", "text": "hi"}, MsgEventTextChunk),
|
||||||
|
({"type": "AGENT_EVENT_TOOL_CALL_CHUNK", "tool_name": "search", "args_chunk": "{\"q\": \"hello\"}"}, MsgEventToolCallChunk),
|
||||||
|
({"type": "AGENT_EVENT_TOOL_RESULT", "tool_name": "search", "result": {"items": [1, 2, 3]}}, MsgEventToolResult),
|
||||||
|
({"type": "AGENT_EVENT_CUSTOM_UPDATE", "payload": {"status": "in_progress", "progress": 50}}, MsgEventCustomUpdate),
|
||||||
({"type": "AGENT_EVENT_END", "tokens_used": 10}, MsgEventEnd),
|
({"type": "AGENT_EVENT_END", "tokens_used": 10}, MsgEventEnd),
|
||||||
({"type": "ERROR", "code": "E1", "details": "fail"}, MsgError),
|
({"type": "ERROR", "code": "E1", "details": "fail"}, MsgError),
|
||||||
({"type": "GRACEFUL_DISCONNECT"}, MsgGracefulDisconnect),
|
({"type": "GRACEFUL_DISCONNECT"}, MsgGracefulDisconnect),
|
||||||
|
|
@ -47,6 +50,8 @@ def test_server_message_valid(data, expected_type):
|
||||||
"data",
|
"data",
|
||||||
[
|
[
|
||||||
{"type": "AGENT_EVENT_TEXT_CHUNK"}, # нет text
|
{"type": "AGENT_EVENT_TEXT_CHUNK"}, # нет text
|
||||||
|
{"type": "AGENT_EVENT_TOOL_RESULT", "tool_name": "search"}, # нет result
|
||||||
|
{"type": "AGENT_EVENT_CUSTOM_UPDATE"}, # нет payload
|
||||||
{"type": "AGENT_EVENT_END"}, # нет tokens_used
|
{"type": "AGENT_EVENT_END"}, # нет tokens_used
|
||||||
{"type": "ERROR", "code": "E1"}, # нет details
|
{"type": "ERROR", "code": "E1"}, # нет details
|
||||||
{"type": "UNKNOWN"},
|
{"type": "UNKNOWN"},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue