openai

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpenAIConfig

type OpenAIConfig struct {
	Alias   string
	BaseURL string
	ApiKey  string
	Model   string
	Dim     int64
}

func NewOpenAIConfig

func NewOpenAIConfig(opts ...OpenAIConfigOption) *OpenAIConfig

type OpenAIConfigOption

type OpenAIConfigOption func(*OpenAIConfig)

func WithAlias

func WithAlias(name string) OpenAIConfigOption

func WithApiKey

func WithApiKey(apiKey string) OpenAIConfigOption

func WithBaseURL

func WithBaseURL(baseURL string) OpenAIConfigOption

func WithDim

func WithDim(dim int64) OpenAIConfigOption

func WithModel

func WithModel(model string) OpenAIConfigOption

type OpenAIEmbedder

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

func NewOpenAIEmbedder

func NewOpenAIEmbedder(ctx context.Context, cfg *OpenAIConfig) *OpenAIEmbedder

func (*OpenAIEmbedder) Embed

func (oe *OpenAIEmbedder) Embed(ctx context.Context, text []string) ([][]float32, error)

Jump to

Keyboard shortcuts

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