embeddings

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Embedder

type Embedder interface {
	EmbedDocuments(ctx context.Context, texts []string) ([][]float32, error)
	EmbedQuery(ctx context.Context, text string) ([]float32, error)
}

Embedder is an interface matching github.com/tmc/langchaingo embedder used for generating embeddings for a single document and a batch

type OpenAIClient

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

func NewOpenAIClient

func NewOpenAIClient(key string) OpenAIClient

func NewOpenAIClientWithHTTP

func NewOpenAIClientWithHTTP(openAIEndpoint, key string, client *http.Client) OpenAIClient

func (*OpenAIClient) EmbedDocuments added in v1.4.0

func (o *OpenAIClient) EmbedDocuments(_ context.Context, content []string) ([][]float32, error)

func (*OpenAIClient) EmbedQuery added in v1.4.0

func (o *OpenAIClient) EmbedQuery(ctx context.Context, content string) ([]float32, error)

Jump to

Keyboard shortcuts

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