openai

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config func(o *OpenAI)

func WithBaseURL

func WithBaseURL(baseURL string) Config

func WithDimensions

func WithDimensions(dimensions uint32) Config

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) Config

type OpenAI

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

func New

func New(model string, apiKey string, config ...Config) *OpenAI

func (*OpenAI) Dimensions

func (o *OpenAI) Dimensions() uint32

func (*OpenAI) GenerateEmbeddings

func (o *OpenAI) GenerateEmbeddings(ctx context.Context, data string) ([]float32, error)

func (*OpenAI) ModelName

func (o *OpenAI) ModelName() string

Jump to

Keyboard shortcuts

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