aggregation

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VotingInput

type VotingInput struct {
	Source     string         // Agent name that produced this input
	Content    string         // The actual content to vote on
	Confidence float64        // Confidence score (0-1)
	Metadata   map[string]any // Additional metadata
}

VotingInput represents a single input for voting

type VotingResult

type VotingResult struct {
	SelectedContent string         // The winning content
	Agreement       float64        // Level of agreement (0-1)
	Strategy        string         // Strategy used
	Explanation     string         // How the decision was made
	Votes           map[string]int // Vote counts per content
}

VotingResult contains the voting outcome

func ConfidenceVote

func ConfidenceVote(inputs []VotingInput) (*VotingResult, error)

ConfidenceVote selects input with highest confidence Ignores content, just picks most confident source

func MajorityVote

func MajorityVote(inputs []VotingInput) (*VotingResult, error)

MajorityVote implements simple majority voting Returns the content that appears most frequently

func UnanimousVote

func UnanimousVote(inputs []VotingInput) (*VotingResult, error)

UnanimousVote requires all inputs to agree Returns error if there's any disagreement

func WeightedVote

func WeightedVote(inputs []VotingInput) (*VotingResult, error)

WeightedVote uses confidence weights Content with highest weighted score wins

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL