forked from AllCodeCom/research-agent-claude
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschemas.py
More file actions
61 lines (48 loc) · 1.14 KB
/
schemas.py
File metadata and controls
61 lines (48 loc) · 1.14 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
"""schemas.py — Shared data contracts between all agents."""
from dataclasses import dataclass, field
from typing import Optional
@dataclass
class SearchResult:
url: str
title: str
content: str
@dataclass
class Finding:
claim: str
source_url: str
source_title: str
source_credibility: float
claim_credibility: float
topic_relevance: float
quote: Optional[str] = None
@dataclass
class KeyClaim:
claim: str
supporting_sources: list[str]
contested: bool = False
contest_note: Optional[str] = None
@dataclass
class SynthesizedSection:
title: str
summary: str
key_claims: list[KeyClaim]
confidence: float
def __post_init__(self):
# Allow dicts from JSON parsing to be auto-converted
self.key_claims = [
KeyClaim(**c) if isinstance(c, dict) else c
for c in self.key_claims
]
@dataclass
class Synthesis:
topic: str
sections: list[SynthesizedSection]
gaps: list[str]
overall_confidence: float
@dataclass
class Report:
topic: str
markdown: str
sources: list[str]
overall_confidence: float
gaps: list[str]