huggingface

package
v0.0.0-...-14dc775 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Completer

type Completer = openai.Completer

func NewCompleter

func NewCompleter(url, model string, options ...Option) (*Completer, error)

type Config

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

type Embedder

type Embedder struct {
	*Config
}

func NewEmbedder

func NewEmbedder(url, model string, options ...Option) (*Embedder, error)

func (*Embedder) Embed

func (e *Embedder) Embed(ctx context.Context, texts []string) (*provider.Embedding, error)

type Option

type Option func(*Config)

func WithClient

func WithClient(client *http.Client) Option

func WithToken

func WithToken(token string) Option

type Reranker

type Reranker struct {
	*Config
}

func NewReranker

func NewReranker(url, model string, options ...Option) (*Reranker, error)

func (*Reranker) Rerank

func (r *Reranker) Rerank(ctx context.Context, query string, texts []string, options *provider.RerankOptions) ([]provider.Ranking, error)

type Result

type Result struct {
	Index int     `json:"index"`
	Score float64 `json:"score"`
}

Jump to

Keyboard shortcuts

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