openaiembedder

package
v0.0.11-beta1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2023 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model int
const (
	Unknown Model = iota
	AdaSimilarity
	BabbageSimilarity
	CurieSimilarity
	DavinciSimilarity
	AdaSearchDocument
	AdaSearchQuery
	BabbageSearchDocument
	BabbageSearchQuery
	CurieSearchDocument
	CurieSearchQuery
	DavinciSearchDocument
	DavinciSearchQuery
	AdaCodeSearchCode
	AdaCodeSearchText
	BabbageCodeSearchCode
	BabbageCodeSearchText
	AdaEmbeddingV2
)

func (Model) String added in v0.0.4

func (m Model) String() string

type OpenAIEmbedder

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

func New

func New(model Model) *OpenAIEmbedder

func (*OpenAIEmbedder) Embed

func (o *OpenAIEmbedder) Embed(ctx context.Context, texts []string) ([]embedder.Embedding, error)

Embed returns the embeddings for the given texts

func (*OpenAIEmbedder) WithClient added in v0.0.9

func (o *OpenAIEmbedder) WithClient(client *openai.Client) *OpenAIEmbedder

WithClient sets the OpenAI client to use for the embedder

Jump to

Keyboard shortcuts

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