File size: 5,232 Bytes
026ee5d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# Models API Reference

This page documents the Pydantic models used throughout DeepCritical.

## Evidence

**Module**: `src.utils.models`

**Purpose**: Represents evidence from search results.

```python
class Evidence(BaseModel):
    citation: Citation
    content: str
    relevance_score: float = Field(ge=0.0, le=1.0)
    metadata: dict[str, Any] = Field(default_factory=dict)
```

**Fields**:
- `citation`: Citation information (title, URL, date, authors)
- `content`: Evidence text content
- `relevance_score`: Relevance score (0.0-1.0)
- `metadata`: Additional metadata dictionary

## Citation

**Module**: `src.utils.models`

**Purpose**: Citation information for evidence.

```python
class Citation(BaseModel):
    title: str
    url: str
    date: str | None = None
    authors: list[str] = Field(default_factory=list)
```

**Fields**:
- `title`: Article/trial title
- `url`: Source URL
- `date`: Publication date (optional)
- `authors`: List of authors (optional)

## KnowledgeGapOutput

**Module**: `src.utils.models`

**Purpose**: Output from knowledge gap evaluation.

```python
class KnowledgeGapOutput(BaseModel):
    research_complete: bool
    outstanding_gaps: list[str] = Field(default_factory=list)
```

**Fields**:
- `research_complete`: Boolean indicating if research is complete
- `outstanding_gaps`: List of remaining knowledge gaps

## AgentSelectionPlan

**Module**: `src.utils.models`

**Purpose**: Plan for tool/agent selection.

```python
class AgentSelectionPlan(BaseModel):
    tasks: list[AgentTask] = Field(default_factory=list)
```

**Fields**:
- `tasks`: List of agent tasks to execute

## AgentTask

**Module**: `src.utils.models`

**Purpose**: Individual agent task.

```python
class AgentTask(BaseModel):
    agent_name: str
    query: str
    context: dict[str, Any] = Field(default_factory=dict)
```

**Fields**:
- `agent_name`: Name of agent to use
- `query`: Task query
- `context`: Additional context dictionary

## ReportDraft

**Module**: `src.utils.models`

**Purpose**: Draft structure for long-form reports.

```python
class ReportDraft(BaseModel):
    title: str
    sections: list[ReportSection] = Field(default_factory=list)
    references: list[Citation] = Field(default_factory=list)
```

**Fields**:
- `title`: Report title
- `sections`: List of report sections
- `references`: List of citations

## ReportSection

**Module**: `src.utils.models`

**Purpose**: Individual section in a report draft.

```python
class ReportSection(BaseModel):
    title: str
    content: str
    order: int
```

**Fields**:
- `title`: Section title
- `content`: Section content
- `order`: Section order number

## ParsedQuery

**Module**: `src.utils.models`

**Purpose**: Parsed and improved query.

```python
class ParsedQuery(BaseModel):
    original_query: str
    improved_query: str
    research_mode: Literal["iterative", "deep"]
    key_entities: list[str] = Field(default_factory=list)
    research_questions: list[str] = Field(default_factory=list)
```

**Fields**:
- `original_query`: Original query string
- `improved_query`: Refined query string
- `research_mode`: Research mode ("iterative" or "deep")
- `key_entities`: List of key entities
- `research_questions`: List of research questions

## Conversation

**Module**: `src.utils.models`

**Purpose**: Conversation history with iterations.

```python
class Conversation(BaseModel):
    iterations: list[IterationData] = Field(default_factory=list)
```

**Fields**:
- `iterations`: List of iteration data

## IterationData

**Module**: `src.utils.models`

**Purpose**: Data for a single iteration.

```python
class IterationData(BaseModel):
    iteration: int
    observations: str | None = None
    knowledge_gaps: list[str] = Field(default_factory=list)
    tool_calls: list[dict[str, Any]] = Field(default_factory=list)
    findings: str | None = None
    thoughts: str | None = None
```

**Fields**:
- `iteration`: Iteration number
- `observations`: Generated observations
- `knowledge_gaps`: Identified knowledge gaps
- `tool_calls`: Tool calls made
- `findings`: Findings from tools
- `thoughts`: Agent thoughts

## AgentEvent

**Module**: `src.utils.models`

**Purpose**: Event emitted during research execution.

```python
class AgentEvent(BaseModel):
    type: str
    iteration: int | None = None
    data: dict[str, Any] = Field(default_factory=dict)
```

**Fields**:
- `type`: Event type (e.g., "started", "search_complete", "complete")
- `iteration`: Iteration number (optional)
- `data`: Event data dictionary

## BudgetStatus

**Module**: `src.utils.models`

**Purpose**: Current budget status.

```python
class BudgetStatus(BaseModel):
    tokens_used: int
    tokens_limit: int
    time_elapsed_seconds: float
    time_limit_seconds: float
    iterations: int
    iterations_limit: int
```

**Fields**:
- `tokens_used`: Tokens used so far
- `tokens_limit`: Token limit
- `time_elapsed_seconds`: Elapsed time in seconds
- `time_limit_seconds`: Time limit in seconds
- `iterations`: Current iteration count
- `iterations_limit`: Iteration limit

## See Also

- [Architecture - Agents](../architecture/agents.md) - How models are used
- [Configuration](../configuration/index.md) - Model configuration