evaluation

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RagasLLMJudge

type RagasLLMJudge struct {
	// contains filtered or unexported fields
}

RagasLLMJudge implements the LLMJudge interface using standard RAGAS-style prompts. It leverages a strong LLM (like GPT-4) to grade the pipeline's output.

func NewRagasLLMJudge

func NewRagasLLMJudge(judgeLLM chat.Client) *RagasLLMJudge

func (*RagasLLMJudge) EvaluateAnswerRelevance

func (j *RagasLLMJudge) EvaluateAnswerRelevance(ctx context.Context, query string, answer string) (float32, string, error)

EvaluateAnswerRelevance checks if the answer actually answers the user's question.

func (*RagasLLMJudge) EvaluateContextPrecision

func (j *RagasLLMJudge) EvaluateContextPrecision(ctx context.Context, query string, chunks []*entity.Chunk) (float32, string, error)

EvaluateContextPrecision checks the quality of the retrieved chunks.

func (*RagasLLMJudge) EvaluateFaithfulness

func (j *RagasLLMJudge) EvaluateFaithfulness(ctx context.Context, query string, chunks []*entity.Chunk, answer string) (float32, string, error)

EvaluateFaithfulness checks for hallucinations against the retrieved context.

Jump to

Keyboard shortcuts

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