chains

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RetrievalQA

type RetrievalQA struct {
	Retriever schema.Retriever
	LLM       llms.Model
}

func NewRetrievalQA

func NewRetrievalQA(retriever schema.Retriever, llm llms.Model) RetrievalQA

func (RetrievalQA) Call

func (c RetrievalQA) Call(ctx context.Context, query string) (string, error)

type ValidatingRetrievalQA added in v0.2.0

type ValidatingRetrievalQA struct {
	Retriever    schema.Retriever
	GeneratorLLM llms.Model
	ValidatorLLM llms.Model
	// contains filtered or unexported fields
}

ValidatingRetrievalQA validates the relevance of retrieved context before generation.

func NewValidatingRetrievalQA added in v0.2.0

func NewValidatingRetrievalQA(retriever schema.Retriever, generator llms.Model, opts ...ValidatingRetrievalQAOption) (ValidatingRetrievalQA, error)

NewValidatingRetrievalQA creates a new ValidatingRetrievalQA chain.

func (*ValidatingRetrievalQA) Call added in v0.2.0

func (c *ValidatingRetrievalQA) Call(ctx context.Context, query string) (string, error)

type ValidatingRetrievalQAOption added in v0.2.0

type ValidatingRetrievalQAOption func(*ValidatingRetrievalQA)

func WithLogger added in v0.2.0

func WithLogger(logger *slog.Logger) ValidatingRetrievalQAOption

func WithValidator added in v0.2.0

func WithValidator(llm llms.Model) ValidatingRetrievalQAOption

Jump to

Keyboard shortcuts

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