docs: 更新协议文档,删除废弃计划文档
- 更新 http-error-codes, user-points-chat-data-protocol - 更新 divination-run-protocol, profile-protocol - 删除废弃的后端和前端设计计划文档
This commit is contained in:
@@ -3,7 +3,11 @@ from __future__ import annotations
|
||||
import pytest
|
||||
from pydantic import ValidationError
|
||||
|
||||
from schemas.agent.runtime_models import WorkerAgentOutputLite
|
||||
from schemas.agent.runtime_models import (
|
||||
FollowUpOutput,
|
||||
WorkerAgentOutputLite,
|
||||
resolve_worker_output_model,
|
||||
)
|
||||
|
||||
|
||||
def test_worker_output_lite_rejects_divination_derived_from_llm() -> None:
|
||||
@@ -20,3 +24,29 @@ def test_worker_output_lite_rejects_divination_derived_from_llm() -> None:
|
||||
|
||||
with pytest.raises(ValidationError):
|
||||
WorkerAgentOutputLite.model_validate(payload)
|
||||
|
||||
|
||||
def test_follow_up_output_accepts_minimal_schema() -> None:
|
||||
payload = {
|
||||
"status": "success",
|
||||
"answer": "追问回答",
|
||||
}
|
||||
|
||||
parsed = FollowUpOutput.model_validate(payload)
|
||||
assert parsed.answer == "追问回答"
|
||||
|
||||
|
||||
def test_follow_up_output_rejects_chat_only_fields() -> None:
|
||||
payload = {
|
||||
"status": "success",
|
||||
"answer": "追问回答",
|
||||
"sign_level": "中上签",
|
||||
}
|
||||
|
||||
with pytest.raises(ValidationError):
|
||||
FollowUpOutput.model_validate(payload)
|
||||
|
||||
|
||||
def test_resolve_worker_output_model_uses_runtime_mode() -> None:
|
||||
assert resolve_worker_output_model(runtime_mode="chat") is WorkerAgentOutputLite
|
||||
assert resolve_worker_output_model(runtime_mode="follow_up") is FollowUpOutput
|
||||
|
||||
Reference in New Issue
Block a user