voyageai

package
v0.0.0-...-9f472b2 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Embedding

func Embedding(model EmbeddingModel) func(ctx context.Context, text string) ([]float32, error)

Types

type ApiResponse

type ApiResponse struct {
	Object string `json:"object"`
	Data   []struct {
		Object    string    `json:"object"`
		Embedding []float32 `json:"embedding"`
		Index     int       `json:"index"`
	} `json:"data"`
	Model string `json:"model"`
	Usage struct {
		TotalTokens int `json:"total_tokens"`
	} `json:"usage"`
}

type EmbeddingModel

type EmbeddingModel string
const (
	Voyage2Model             EmbeddingModel = "voyage-2"
	VoyageLarge2Model        EmbeddingModel = "voyage-large-2"
	VoyageFinance2Model      EmbeddingModel = "voyage-finance-2"
	VoyageMultilingual2Model EmbeddingModel = "voyage-multilingual-2"
	VoyageLaw2Model          EmbeddingModel = "voyage-law-2"
	VoyageCode2Model         EmbeddingModel = "voyage-code-2"
)

type RateLimitedClient

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

func NewRateLimitedClient

func NewRateLimitedClient(requestsPerSecond float64) *RateLimitedClient

func (*RateLimitedClient) Do

func (c *RateLimitedClient) Do(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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