embeddings

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmbeddingData

type EmbeddingData struct {
	Object    string             `json:"object"`
	Index     int                `json:"index"`
	Embedding EmbeddingDataUnion `json:"embedding"`
}

type EmbeddingDataUnion

type EmbeddingDataUnion struct {
	OfFloat  []float64 `json:",omitempty"`
	OfBase64 *string   `json:",omitempty"`
}

func (*EmbeddingDataUnion) MarshalJSON

func (u *EmbeddingDataUnion) MarshalJSON() ([]byte, error)

func (*EmbeddingDataUnion) UnmarshalJSON

func (u *EmbeddingDataUnion) UnmarshalJSON(data []byte) error

type InputUnion

type InputUnion struct {
	OfString *string  `json:",omitempty"`
	OfList   []string `json:",omitempty"`
}

func (*InputUnion) MarshalJSON

func (u *InputUnion) MarshalJSON() ([]byte, error)

func (*InputUnion) UnmarshalJSON

func (u *InputUnion) UnmarshalJSON(data []byte) error

type Request

type Request struct {
	Model          string         `json:"model"`
	Input          InputUnion     `json:"input"`
	Dimensions     *int           `json:"dimensions"`
	EncodingFormat *string        `json:"encoding_format"` // "float" or "base64"
	ExtraFields    map[string]any `json:",omitempty"`
}

type Response

type Response struct {
	Object string          `json:"object"`
	Model  string          `json:"model"`
	Usage  *Usage          `json:"usage"`
	Data   []EmbeddingData `json:"data"`
}

type Usage

type Usage struct {
	PromptTokens int64 `json:"prompt_tokens"`
	TotalTokens  int64 `json:"total_tokens"`
}

Jump to

Keyboard shortcuts

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