docs: 更新协议文档,删除废弃计划文档
- 更新 http-error-codes, user-points-chat-data-protocol - 更新 divination-run-protocol, profile-protocol - 删除废弃的后端和前端设计计划文档
This commit is contained in:
@@ -5,7 +5,6 @@ from typing import Any, Literal
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
from schemas.agent.ui_hints import UiHintsPayload
|
||||
from schemas.domain.divination import DerivedDivinationData
|
||||
|
||||
|
||||
@@ -53,18 +52,28 @@ class WorkerAgentOutputLite(BaseModel):
|
||||
error: ErrorInfo | None = None
|
||||
|
||||
|
||||
class WorkerAgentOutputRich(WorkerAgentOutputLite):
|
||||
ui_hints: UiHintsPayload | None = None
|
||||
class FollowUpOutput(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
status: RunStatus = RunStatus.SUCCESS
|
||||
answer: str = Field(min_length=1, max_length=4000)
|
||||
error: ErrorInfo | None = None
|
||||
|
||||
|
||||
class AgentOutput(WorkerAgentOutputRich):
|
||||
class AgentOutput(WorkerAgentOutputLite):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
divination_derived: DerivedDivinationData | None = None
|
||||
|
||||
|
||||
WorkerAgentOutput = WorkerAgentOutputLite | WorkerAgentOutputRich
|
||||
WorkerAgentOutput = WorkerAgentOutputLite
|
||||
RuntimeAgentOutput = AgentOutput | FollowUpOutput
|
||||
|
||||
|
||||
def resolve_worker_output_model() -> type[WorkerAgentOutputLite]:
|
||||
def resolve_worker_output_model(
|
||||
*, runtime_mode: str
|
||||
) -> type[WorkerAgentOutputLite | FollowUpOutput]:
|
||||
normalized = runtime_mode.strip().lower()
|
||||
if normalized == "follow_up":
|
||||
return FollowUpOutput
|
||||
return WorkerAgentOutputLite
|
||||
|
||||
Reference in New Issue
Block a user