feat: 完成项目助手与监控演示并修复聊天及云部署配置
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
"""Versioned contracts shared by the Xingbang project assistant."""
|
||||
|
||||
from .project_assistant import Evidence, Finding, ProjectSnapshot, SkillResult
|
||||
|
||||
__all__ = ["Evidence", "Finding", "ProjectSnapshot", "SkillResult"]
|
||||
@@ -0,0 +1,69 @@
|
||||
"""Stable, serialisable contracts for project-scoped business runs."""
|
||||
|
||||
from typing import Any, Literal
|
||||
|
||||
from pydantic import BaseModel, Field, ConfigDict
|
||||
|
||||
|
||||
class Evidence(BaseModel):
|
||||
model_config = ConfigDict(extra="allow")
|
||||
id: str
|
||||
project_id: str
|
||||
source: str
|
||||
locator: str
|
||||
field: str
|
||||
value: Any = None
|
||||
snapshot_id: str
|
||||
|
||||
|
||||
class CheckOutcome(BaseModel):
|
||||
model_config = ConfigDict(extra="allow")
|
||||
code: str = Field(min_length=1, max_length=250)
|
||||
title: str
|
||||
result: Literal["pass", "issue", "unknown", "not_applicable", "error"]
|
||||
severity: Literal["info", "attention", "warning"] = "attention"
|
||||
fields: list[str] = Field(default_factory=list)
|
||||
evidence_ids: list[str] = Field(default_factory=list)
|
||||
basis_ids: list[str] = Field(default_factory=list)
|
||||
suggested_action: str = ""
|
||||
|
||||
|
||||
class Finding(BaseModel):
|
||||
id: str
|
||||
code: str
|
||||
project_id: str
|
||||
title: str
|
||||
result: Literal["pass", "issue", "unknown", "not_applicable", "error"]
|
||||
severity: Literal["info", "attention", "warning"] = "attention"
|
||||
status: Literal["待处理", "待补件", "待复核", "已解决", "不适用"] = "待处理"
|
||||
evidence_ids: list[str] = Field(default_factory=list)
|
||||
basis_ids: list[str] = Field(default_factory=list)
|
||||
suggested_action: str = ""
|
||||
first_seen_run_id: str
|
||||
last_seen_run_id: str
|
||||
|
||||
|
||||
class ProjectSnapshot(BaseModel):
|
||||
model_config = ConfigDict(extra="allow")
|
||||
schema_version: int = 1
|
||||
id: str
|
||||
project_id: str
|
||||
data_domain: Literal["demo", "production"]
|
||||
revision: int
|
||||
created_at: str
|
||||
facts: dict[str, Any]
|
||||
documents: list[dict[str, Any]] = Field(default_factory=list)
|
||||
|
||||
|
||||
class SkillResult(BaseModel):
|
||||
model_config = ConfigDict(extra="allow")
|
||||
schema_version: int = 1
|
||||
run_id: str
|
||||
step_id: str
|
||||
skill: dict[str, str]
|
||||
status: Literal["completed", "partial", "failed", "skipped"]
|
||||
input_snapshot_id: str
|
||||
outputs: dict[str, Any] = Field(default_factory=dict)
|
||||
findings: list[CheckOutcome] = Field(default_factory=list)
|
||||
missing_inputs: list[str] = Field(default_factory=list)
|
||||
errors: list[dict[str, Any]] = Field(default_factory=list)
|
||||
Reference in New Issue
Block a user