feat: 重构 Reminder Notification 系统并更新应用包名
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from schemas.agent.runtime_models import RouterAgentOutput
|
||||
from schemas.agent.runtime_models import RouterAgentOutput, WorkerAgentOutputRich
|
||||
|
||||
|
||||
def test_router_agent_output_coerces_key_entity_value_to_string() -> None:
|
||||
@@ -32,3 +32,59 @@ def test_router_agent_output_coerces_key_entity_value_to_string() -> None:
|
||||
model = RouterAgentOutput.model_validate(payload)
|
||||
|
||||
assert model.key_entities[0].value == "8"
|
||||
|
||||
|
||||
def test_router_agent_output_coerces_constraint_value_to_string() -> None:
|
||||
payload = {
|
||||
"normalized_task_input": {
|
||||
"user_text": "test",
|
||||
"multimodal_summary": [],
|
||||
"context_summary": "",
|
||||
},
|
||||
"key_entities": [],
|
||||
"constraints": [
|
||||
{
|
||||
"key": "strict_mode",
|
||||
"value": True,
|
||||
"required": True,
|
||||
}
|
||||
],
|
||||
"task_typing": {
|
||||
"primary": "planning",
|
||||
"secondary": [],
|
||||
},
|
||||
"execution_mode": "onestep",
|
||||
"result_typing": {
|
||||
"primary": "summary",
|
||||
"secondary": [],
|
||||
},
|
||||
}
|
||||
|
||||
model = RouterAgentOutput.model_validate(payload)
|
||||
|
||||
assert model.constraints[0].value == "True"
|
||||
|
||||
|
||||
def test_worker_agent_output_rich_accepts_list_item_status_object() -> None:
|
||||
payload = {
|
||||
"status": "success",
|
||||
"answer": "done",
|
||||
"result_type": "summary",
|
||||
"ui_hints": {
|
||||
"intent": "status",
|
||||
"status": "info",
|
||||
"title": "状态",
|
||||
"listItems": [
|
||||
{
|
||||
"title": "任务A",
|
||||
"status": {"type": "info", "value": "已归档"},
|
||||
}
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
model = WorkerAgentOutputRich.model_validate(payload)
|
||||
|
||||
assert model.ui_hints is not None
|
||||
assert model.ui_hints.list_items[0].status is not None
|
||||
assert model.ui_hints.list_items[0].status.value == "info"
|
||||
|
||||
Reference in New Issue
Block a user