index

package
v0.0.0-...-b7aeced Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	ID string

	Title   string
	Source  string
	Content string

	Metadata map[string]string

	Embedding []float32
}

type Embedder

type Embedder = provider.Embedder

type ListOptions

type ListOptions struct {
	Limit  *int
	Cursor string
}

type Page

type Page[T Document] struct {
	Items []T

	Cursor string
}

type Provider

type Provider interface {
	List(ctx context.Context, options *ListOptions) (*Page[Document], error)

	Index(ctx context.Context, documents ...Document) error
	Delete(ctx context.Context, ids ...string) error

	Query(ctx context.Context, query string, options *QueryOptions) ([]Result, error)
}

type QueryOptions

type QueryOptions struct {
	Limit *int

	Filters map[string]string
}

type Reranker

type Reranker = provider.Reranker

type Result

type Result struct {
	Document
	Score float32
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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