-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
70 lines (45 loc) · 1.71 KB
/
Copy pathmodels.py
File metadata and controls
70 lines (45 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
"""
Shared data structures used across agents, verification, and orchestration.
"""
from __future__ import annotations
from datetime import datetime, timezone
from typing import List, Sequence
from pydantic import BaseModel, Field
def utc_now() -> datetime:
"""Return a UTC timestamp for agent outputs."""
return datetime.now(timezone.utc)
class AgentMessage(BaseModel):
"""Base payload returned by agents with minimal metadata."""
agent_id: str
confidence: float
status: str = "success"
timestamp: datetime = Field(default_factory=utc_now)
class ResearchOutput(AgentMessage):
"""Structured research response with raw findings."""
query: str
findings: List[str] = Field(default_factory=list)
sources: List[str] = Field(default_factory=list)
class AnalysisOutput(AgentMessage):
"""Analysis distilled from research findings."""
key_points: List[str] = Field(default_factory=list)
risks: List[str] = Field(default_factory=list)
stance: str
class SummaryOutput(AgentMessage):
"""Concise narrative summary with surfaced highlights."""
summary: str
highlights: List[str] = Field(default_factory=list)
class VerificationResult(AgentMessage):
"""Cross-check outcome aggregated across verifiers."""
passed: bool
score: float
confidence: float
issues: List[str] = Field(default_factory=list)
disagreement: bool
verifier_results: List[dict] = Field(default_factory=list)
status: str = "verified"
AgentTrace = List[dict[str, str]]
AgentOutputs = Sequence[AgentMessage]
class TaskContext(BaseModel):
"""Lightweight task context propagated to verifiers."""
query: str
agent_trace: AgentTrace = Field(default_factory=list)