File size: 1,168 Bytes
13bc746
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""
TriangleResult — What comes back when three models deliberate.
"""

from dataclasses import dataclass, field
from typing import Optional


@dataclass
class TriangleResult:
    """The output of a triangulated inference."""

    answer: str
    """The converged answer (or best candidate if no convergence)."""

    confidence: float
    """0.0 to 1.0. How much the three models agreed."""

    converged: bool
    """True if all three models reached consensus."""

    disagreement: dict = field(default_factory=dict)
    """Where the models diverged. Keys are model names, values are their raw answers."""

    flag: Optional[str] = None
    """If disagreement was significant, this describes what they fought about.
    A flag is signal, not failure. It means the models found something worth examining."""

    raw_responses: list = field(default_factory=list)
    """The unprocessed response from each model, in order."""

    steering_model: Optional[str] = None
    """Which model steered this round (proposed the answer the others evaluated)."""

    rounds: int = 1
    """How many deliberation rounds it took to converge (or max_rounds if it didn't)."""