Documentation ¶
Overview ¶
Package retriever provides functionality for retrieving relevant documents using various services.
Index ¶
- func AmazonKendraLanguageCodeAttributeFilter(languageCode string) *types.AttributeFilter
- type AmazonKendra
- type AmazonKendraClient
- type AmazonKendraOptions
- type AzureCognitiveSearch
- type AzureCognitiveSearchOptions
- type AzureCognitiveSearchRequest
- type HTTPClient
- type Merger
- type VectorStore
- type VectorStoreOptions
- type VectorStoreSearchType
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
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 AzureCognitiveSearch ¶ added in v0.0.32
type AzureCognitiveSearch struct {
// contains filtered or unexported fields
}
AzureCognitiveSearch is a retriever implementation for Azure Cognitive Search service.
func NewAzureCognitiveSearch ¶ added in v0.0.32
func NewAzureCognitiveSearch(apiKey, serviceName, indexName string, optFns ...func(o *AzureCognitiveSearchOptions)) *AzureCognitiveSearch
NewAzureCognitiveSearch creates a new instance of AzureCognitiveSearch retriever with the provided options.
func (*AzureCognitiveSearch) GetRelevantDocuments ¶ added in v0.0.32
func (r *AzureCognitiveSearch) GetRelevantDocuments(ctx context.Context, query string) ([]schema.Document, error)
GetRelevantDocuments retrieves relevant documents for the given query using Azure Cognitive Search.
type AzureCognitiveSearchOptions ¶ added in v0.0.32
type AzureCognitiveSearchOptions struct { // Number of documents to query for TopK uint // Azure Cognitive Search API version. APIVersion string // Key to extract content from response. ContentKey string // HTTP client to use for making requests. HTTPClient HTTPClient }
AzureCognitiveSearchOptions contains options for configuring the AzureCognitiveSearch retriever.
type AzureCognitiveSearchRequest ¶ added in v0.0.32
AzureCognitiveSearchRequest represents the request payload for Azure Cognitive Search.
type HTTPClient ¶ added in v0.0.32
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"
)