voyageai

package
v0.0.0-...-5637490 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: BSD-3-Clause Imports: 13 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(apiKey string, timeout time.Duration, urlBuilder UrlBuilder, logger logrus.FieldLogger) *Client

func (*Client) GetApiKeyHash

func (c *Client) GetApiKeyHash(ctx context.Context, cfg moduletools.ClassConfig) [32]byte

func (*Client) GetVectorizerRateLimit

func (c *Client) GetVectorizerRateLimit(ctx context.Context, modelRL VoyageRLModel) *modulecomponents.RateLimits

func (*Client) Vectorize

func (*Client) VectorizeMultiModal

func (c *Client) VectorizeMultiModal(ctx context.Context, texts, images []string,
	settings Settings,
) (*modulecomponents.VectorizationCLIPResult[[]float32], error)

func (*Client) VectorizeQuery

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

type InputType

type InputType string
const (
	Document InputType = "document"
	Query    InputType = "query"
)

type Settings

type Settings struct {
	BaseURL   string
	Model     string
	Truncate  bool
	InputType InputType
}

type UrlBuilder

type UrlBuilder interface {
	URL(baseURL string) string
}

type VoyageRLModel

type VoyageRLModel struct {
	TokenLimit   int
	RequestLimit int
}

Jump to

Keyboard shortcuts

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