39 lines
976 B
Python
39 lines
976 B
Python
from __future__ import annotations
|
|
|
|
from schemas.agent.runtime_models import RouterAgentOutput
|
|
|
|
|
|
def test_router_agent_output_coerces_key_entity_value_to_string() -> None:
|
|
payload = {
|
|
"normalized_task_input": {
|
|
"user_text": "test",
|
|
"multimodal_summary": [],
|
|
"context_summary": "",
|
|
},
|
|
"key_entities": [
|
|
{
|
|
"name": "priority",
|
|
"type": "number",
|
|
"value": 8,
|
|
}
|
|
],
|
|
"constraints": [],
|
|
"task_typing": {
|
|
"primary": "planning",
|
|
"secondary": [],
|
|
},
|
|
"execution_mode": "onestep",
|
|
"result_typing": {
|
|
"primary": "summary",
|
|
"secondary": [],
|
|
},
|
|
"ui": {
|
|
"ui_mode": "none",
|
|
"ui_decision_reason": "test",
|
|
},
|
|
}
|
|
|
|
model = RouterAgentOutput.model_validate(payload)
|
|
|
|
assert model.key_entities[0].value == "8"
|