Documentation
¶
Overview ¶
Package rerankwire owns validation-preserving acceptance of every built-in reranker response. It is module-internal because its exported identifiers exist only to share the acceptance owner between search and provider packages.
Index ¶
- func DecodeResponse(reader io.Reader, value any) error
- type AcceptedResult
- func AcceptCrossEncoder(results []IndexedResult, scores []Required[float64], rankings []IndexedResult, ...) ([]AcceptedResult, error)
- func AcceptLLM(raw string, population int) ([]AcceptedResult, error)
- func AcceptTyped(values []TypedResult, population int) ([]AcceptedResult, error)
- func AcceptVoyage(data, results []IndexedResult, population int) ([]AcceptedResult, error)
- type IndexedResult
- type Required
- type TypedResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AcceptedResult ¶
AcceptedResult is the sole normalized output of built-in provider decoding.
func AcceptCrossEncoder ¶
func AcceptCrossEncoder(results []IndexedResult, scores []Required[float64], rankings []IndexedResult, population int) ([]AcceptedResult, error)
AcceptCrossEncoder validates every supported cross-encoder representation and rejects a response that supplies more than one non-empty ranking.
func AcceptLLM ¶
func AcceptLLM(raw string, population int) ([]AcceptedResult, error)
AcceptLLM owns envelope selection and presence-aware binding for model output. Every response must satisfy the one-envelope JSON grammar before a ranking can be interpreted.
func AcceptTyped ¶
func AcceptTyped(values []TypedResult, population int) ([]AcceptedResult, error)
AcceptTyped validates a provider result that arrived through a typed API.
func AcceptVoyage ¶
func AcceptVoyage(data, results []IndexedResult, population int) ([]AcceptedResult, error)
AcceptVoyage validates both Voyage response spellings without preferring one.
type IndexedResult ¶
type IndexedResult struct {
Index Required[int] `json:"index"`
Score Required[float64] `json:"score"`
RelevanceScore Required[float64] `json:"relevance_score"`
Document string `json:"document,omitempty"`
}
IndexedResult is the shared presence-aware indexed JSON representation.
type Required ¶
type Required[T any] struct { // contains filtered or unexported fields }
Required is a JSON scalar or collection whose presence is part of the wire contract. The zero value means absent; JSON null is present but invalid.
func (*Required[T]) UnmarshalJSON ¶
type TypedResult ¶
TypedResult represents a result whose index and score came from a typed provider API rather than JSON. Its constructor marks both fields present.