Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiagnosticResult ¶
type DiagnosticResult struct {
AgentName string `json:"agent_name"`
ConfidenceScore float64 `json:"confidence_score"` // X-axis (0.0 -> 1.0)
ConsistencyScore float64 `json:"consistency_score"` // Y-axis (0.0 -> 1.0)
Quadrant QuadrantState `json:"quadrant"`
InitialReasonR1 string `json:"r1_initial_reasoning"`
CounterReasonR2 string `json:"r2_counter_reasoning"`
Recommendation string `json:"recommendation"`
}
DiagnosticResult is the outcome of grilling a single agent: where it lands on the confidence/consistency grid and what action is recommended.
type DriftVerdict ¶
type DriftVerdict struct {
// HasDrift reports whether any agent flipped or significantly eroded.
HasDrift bool `json:"has_drift"`
// DriftedAgents lists the names of agents that drifted.
DriftedAgents []string `json:"drifted_agents"`
// PrimaryDriver is the agent (or the supervisor) responsible for the shift.
PrimaryDriver string `json:"primary_driver"`
// DriverImpact is a human-readable description of who swayed whom.
DriverImpact string `json:"driver_impact"`
// AgentShifts maps each agent name to its total variation distance.
AgentShifts map[string]float64 `json:"agent_shifts"`
}
DriftVerdict describes whether agents changed their positions over the course of a debate, which agents moved, and who drove the shift.
type FullDebateSummary ¶
type FullDebateSummary struct {
Question string `json:"question"`
Options []string `json:"options"`
OptionLabels []string `json:"option_labels"`
PromptResult *PromptResult `json:"prompt_result"`
DriftVerdict DriftVerdict `json:"drift_verdict"`
Diagnostics map[string]*DiagnosticResult `json:"diagnostics,omitempty"` // Targeted grilling results
OverallOutcome string `json:"overall_outcome"`
}
FullDebateSummary is the complete result of a Debate run: the question and options, pre/post positions, drift verdict, and targeted grilling diagnostics.
type Gaslit ¶
type Gaslit struct {
// contains filtered or unexported fields
}
Gaslit orchestrates a panel of debater agents under a supervising moderator.
func Init ¶
func Init(ctx context.Context, supervisorModel model.BaseModel[*schema.Message], agents []adk.Agent) (*Gaslit, error)
Init builds a Gaslit engine around the supplied supervisor model and debater agents. At least one agent is required. The returned engine serializes the baseline/evaluation phases, supervised cross-examination, and drift analysis.
The agents are keyed by their Name, which must be unique. Concurrent calls to Debate on the same engine are safe.
func (*Gaslit) Debate ¶
func (g *Gaslit) Debate(ctx context.Context, question string, options []string, verbose bool) (*FullDebateSummary, error)
Debate runs a full panel evaluation on the given multiple-choice question:
- Collects each agent's baseline position and confidence.
- Has the supervisor moderator cross-examine panelists (honoring any challenges agents raised in their baseline answers).
- Re-collects each agent's final position.
- Detects drift and attributes influence between agents.
- Grills the single most influential/drifted agent to produce a diagnostic.
Options are labeled A, B, C, ... in order. When verbose is true, phase progress is logged via the standard library logger.
type PromptResult ¶
PromptResult captures each agent's position before and after the debate.
type QuadrantState ¶
type QuadrantState string
QuadrantState is the 2D classification of an agent based on its confidence (x-axis) and semantic consistency (y-axis) under cross-examination.
const ( // QuadrantPeak indicates high confidence and high consistency. QuadrantPeak QuadrantState = "PEAK (Grounded Knowledge)" // QuadrantHallucinating indicates high confidence with fabricated contradictions. QuadrantHallucinating QuadrantState = "HALLUCINATING / MALICIOUS" // QuadrantKBDeficit indicates consistent but low-confidence answers. QuadrantKBDeficit QuadrantState = "KB_DEFICIT (Incomplete Info)" // QuadrantWrong indicates low confidence and inconsistent internal logic. QuadrantWrong QuadrantState = "WRONG / UNCERTAIN" )