retriever

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AmazonKendraLanguageCodeAttributeFilter added in v0.0.22

func AmazonKendraLanguageCodeAttributeFilter(languageCode string) *types.AttributeFilter

Types

type AmazonKendra added in v0.0.22

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

func NewAmazonKendra added in v0.0.22

func NewAmazonKendra(client AmazonKendraClient, index string, optFns ...func(o *AmazonKendraOptions)) *AmazonKendra

func (*AmazonKendra) GetRelevantDocuments added in v0.0.22

func (r *AmazonKendra) GetRelevantDocuments(ctx context.Context, query string) ([]schema.Document, error)

type AmazonKendraClient added in v0.0.22

type AmazonKendraClient interface {
	// Retrieve retrieves documents from Amazon Kendra based on the provided input parameters.
	// It returns the retrieval output or an error if the retrieval operation fails.
	Retrieve(ctx context.Context, params *kendra.RetrieveInput, optFns ...func(*kendra.Options)) (*kendra.RetrieveOutput, error)

	// Query performs a query operation on Amazon Kendra using the specified input parameters.
	// It returns the query output or an error if the query operation fails.
	Query(ctx context.Context, params *kendra.QueryInput, optFns ...func(*kendra.Options)) (*kendra.QueryOutput, error)
}

AmazonKendraClient represents a client for interacting with Amazon Kendra.

type AmazonKendraOptions added in v0.0.22

type AmazonKendraOptions struct {
	// Number of documents to query for
	TopK int32

	// Provides filtering the results based on document attributes or metadata
	// fields.
	AttributeFilter *types.AttributeFilter
}

type VectorStore added in v0.0.10

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

func NewVectorStore added in v0.0.10

func NewVectorStore(vectorStore schema.VectorStore, optFns ...func(o *VectorStoreOptions)) *VectorStore

func (*VectorStore) GetRelevantDocuments added in v0.0.10

func (r *VectorStore) GetRelevantDocuments(ctx context.Context, query string) ([]schema.Document, error)

GetRelevantDocuments returns documents using the vector store.

type VectorStoreOptions added in v0.0.10

type VectorStoreOptions struct {
	SearchType VectorStoreSearchType
}

type VectorStoreSearchType added in v0.0.10

type VectorStoreSearchType string
const (
	VectorStoreSearchTypeSimilarity VectorStoreSearchType = "similarity"
)

Jump to

Keyboard shortcuts

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