cohere

package
v1.27.12 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRPM = 10000    // from https://docs.cohere.com/docs/going-live#production-key-specifications default for production keys
	DefaultTPM = 10000000 // no token limit used by cohere
)

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, logger logrus.FieldLogger) *Client

func (*Client) GetApiKeyHash

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

func (*Client) GetVectorizerRateLimit

func (c *Client) GetVectorizerRateLimit(ctx context.Context, cfg moduletools.ClassConfig) *modulecomponents.RateLimits

func (*Client) HasTokenLimit

func (c *Client) HasTokenLimit() bool

func (*Client) ReturnsRateLimit

func (c *Client) ReturnsRateLimit() bool

func (*Client) Vectorize

func (c *Client) Vectorize(ctx context.Context,
	inputs []string, settings Settings,
) (*modulecomponents.VectorizationResult, error)

type InputType

type InputType string
const (
	SearchDocument InputType = "search_document"
	SearchQuery    InputType = "search_query"
	Image          InputType = "image"
)

type Settings

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

Jump to

Keyboard shortcuts

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