openai

package
v1.32.21 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(openAIApiKey, openAIOrganization, azureApiKey string, timeout time.Duration, logger logrus.FieldLogger) *Client

func (*Client) GetApiKeyHash

func (v *Client) GetApiKeyHash(ctx context.Context, settings Settings) [32]byte

func (*Client) GetVectorizerRateLimit

func (v *Client) GetVectorizerRateLimit(ctx context.Context, settings Settings) *modulecomponents.RateLimits

func (*Client) Vectorize

func (*Client) VectorizeQuery

func (v *Client) VectorizeQuery(ctx context.Context, input []string,
	settings Settings,
) (*modulecomponents.VectorizationResult[[]float32], error)

type Settings

type Settings struct {
	Type, Model, ModelVersion, ModelString, ResourceName string
	BaseURL                                              string
	DeploymentID                                         string
	ApiVersion                                           string
	IsAzure                                              bool
	IsThirdPartyProvider                                 bool
	Dimensions                                           *int64
}

Jump to

Keyboard shortcuts

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