wcohere

package
v0.0.0-...-8a3d196 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CommandLight is a smaller, faster version of Command.
	// It's almost as capable but a lot faster.
	// Max Tokens: 4096. Endpoint: Co.generate()
	CommandLight string = "command-light"

	// Command is an instruction-following conversational model that performs
	// language tasks with high quality, more reliably and with a longer context
	// than base generative models.
	// Max Tokens: 4096. Endpoint: Co.generate()
	Command string = "command"
)

Command models

View Source
const (
	// BaseLight is a smaller, faster version of Base.
	// It's almost as capable but a lot faster.
	// Max Tokens: 2048. Endpoint: Co.generate()
	BaseLight string = "base-light"

	// Base is a model that performs generative language tasks.
	// Max Tokens: 2048. Endpoint: Co.generate()
	Base string = "base"
)

Generation models

View Source
const (
	// EmbedEnglishLightV2 is a smaller, faster version of EmbedEnglishV2.
	// It's almost as capable but a lot faster. It supports English only.
	// Max Tokens: 512. Similarity Metric: Cosine Similarity.
	// Endpoints: Co.Classify(), Co.Embed(), Co.Detect_language(), Co.Tokenize(), Co.Detokenize()
	EmbedEnglishLightV2 string = "embed-english-light-v2.0"

	// EmbedEnglishV2 is a model that allows for text to be classified or turned into embeddings.
	// It supports English only.
	// Max Tokens: 512. Similarity Metric: Cosine Similarity.
	// Endpoints: Co.Classify(), Co.Embed(), Co.Detect_language(), Co.Tokenize(), Co.Detokenize()
	EmbedEnglishV2 string = "embed-english-v2.0"

	// EmbedMultilingualV2 provides multilingual classification and embedding support.
	// Max Tokens: 256. Similarity Metric: Dot Product Similarity.
	// Endpoints: Co.Classify(), Co.Embed(), Co.Detect_language(), Co.Tokenize(), Co.Detokenize()
	EmbedMultilingualV2 string = "embed-multilingual-v2.0"
)

Representation models

View Source
const (
	// RerankEnglishV2 is a model that allows for re-ranking English language documents.
	// No token limit since it accepts full strings rather than tokens.
	// Endpoint: Co.rerank()
	RerankEnglishV2 string = "rerank-english-v2.0"

	// RerankMultilingualV2 is a model for documents that are not in English.
	// Supports the same languages as EmbedMultilingualV2.
	// No token limit since it accepts full strings rather than tokens.
	// Endpoint: Co.rerank()
	RerankMultilingualV2 string = "rerank-multilingual-v2.0"
)

Rerank models

View Source
const (
	// SummarizeMedium is a smaller, faster version of SummarizeXLarge.
	// It's almost as capable but a lot faster.
	// Max Tokens: 2048. Endpoint: Co.summarize()
	SummarizeMedium string = "summarize-medium"

	// SummarizeXLarge is a model that takes a piece of text and generates a summary.
	// Max Tokens: 2048. Endpoint: Co.summarize()
	SummarizeXLarge string = "summarize-xlarge"
)

Summarize models

Variables

View Source
var DefaultClient *cohereclient.Client

Functions

func GetEmbedRequestPrice

func GetEmbedRequestPrice(numTokens int) float64

func GetGenerateRequestPrice

func GetGenerateRequestPrice(numTokens int, model string) (float64, error)

func GetRerankPrice

func GetRerankPrice(numSearchUnit int) float64

Cohere counts a single search unit as a query with up to 100 documents to be ranked. Documents longer than 510 tokens when including the length of the search query will be split up into multiple chunks, where each chunk counts as a singular document.

func GetSummarizeRequestPrice

func GetSummarizeRequestPrice(numTokens int) float64

func InitDefaultClient

func InitDefaultClient(defaultApiKey string) error

func NewClient

func NewClient(apikey string) (*cohereclient.Client, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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