openai

package
v2.0.22 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 11 Imported by: 7

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 NewClient

func NewClient(apiKey string, db *badger.DB, logger *logging.Logger) *Client

func (*Client) CreateEmbedding

func (c *Client) CreateEmbedding(input string, model oai.EmbeddingModel) (*oai.Embedding, error)

type EmbeddingRequest

type EmbeddingRequest struct {
	Input          string `json:"input"`
	Model          string `json:"model"`
	EncodingFormat string `json:"encoding_format,omitempty"`
	User           string `json:"user,omitempty"`
}

type EmbeddingResult

type EmbeddingResult struct {
	Vector []float64 `json:"embedding"`
	Index  int       `json:"index"`
	Object string    `json:"object"`
}

Jump to

Keyboard shortcuts

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