documentcompressor

package
v0.0.100 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CohereClient

type CohereClient interface {
	Rerank(ctx context.Context, request *cohere.RerankRequest) (*cohere.RerankResponse, error)
}

CohereClient is an interface for interacting with the Cohere API.

type CohereRerank

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

CohereRerank is a struct representing the Cohere Rerank compression functionality.

func NewCohereRank

func NewCohereRank(client CohereClient, optFns ...func(o *CohereRerankOptions)) *CohereRerank

NewCohereRank creates a new instance of CohereRerank with the provided client and options.

func (*CohereRerank) Compress

func (c *CohereRerank) Compress(ctx context.Context, docs []schema.Document, query string) ([]schema.Document, error)

Compress compresses the input documents using Cohere Rerank.

type CohereRerankOptions

type CohereRerankOptions struct {
	ModelName string
	TopN      int
}

CohereRerankOptions contains options for Cohere Rerank compression.

Jump to

Keyboard shortcuts

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