cohere

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxTokens   = 256
	DefaultTemperature = 0.75
	DefaultModel       = ModelCommand
)

Variables

View Source
var (
	ErrCohereChat = fmt.Errorf("cohere chat error")
)

Functions

This section is empty.

Types

type Cohere

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

func New added in v0.1.0

func New() *Cohere

func NewCompletion

func NewCompletion() *Cohere

NewCompletion returns a new completion LLM

func (*Cohere) Chat

func (c *Cohere) Chat(ctx context.Context, prompt *chat.Chat) (string, error)

Chat is not implemented

func (*Cohere) Completion

func (c *Cohere) Completion(ctx context.Context, prompt string) (string, error)

Completion returns the completion for the given prompt

func (*Cohere) Generate added in v0.1.0

func (c *Cohere) Generate(ctx context.Context, t *thread.Thread) error

func (*Cohere) WithAPIKey

func (c *Cohere) WithAPIKey(apiKey string) *Cohere

WithAPIKey sets the API key to use for the LLM

func (*Cohere) WithCache added in v0.1.0

func (c *Cohere) WithCache(cache *cache.Cache) *Cohere

func (*Cohere) WithMaxTokens

func (c *Cohere) WithMaxTokens(maxTokens int) *Cohere

WithMaxTokens sets the max tokens to use for the LLM

func (*Cohere) WithModel

func (c *Cohere) WithModel(model Model) *Cohere

WithModel sets the model to use for the LLM

func (*Cohere) WithObserver added in v0.2.0

func (c *Cohere) WithObserver(observer llmobserver.LLMObserver, traceID string) *Cohere

func (*Cohere) WithStop

func (c *Cohere) WithStop(stop []string) *Cohere

WithStop sets the stop sequences to use for the LLM

func (*Cohere) WithStream added in v0.1.0

func (c *Cohere) WithStream(callbackFn StreamCallbackFn) *Cohere

func (*Cohere) WithTemperature

func (c *Cohere) WithTemperature(temperature float64) *Cohere

WithTemperature sets the temperature to use for the LLM

func (*Cohere) WithVerbose

func (c *Cohere) WithVerbose(verbose bool) *Cohere

WithVerbose sets the verbosity of the LLM

type Model

type Model = model.Model
const (
	ModelCommand             Model = model.ModelCommand
	ModelCommandNightly      Model = model.ModelCommandNightly
	ModelCommandLight        Model = model.ModelCommandLight
	ModelCommandLightNightly Model = model.ModelCommandLightNightly
)

type StreamCallbackFn added in v0.1.0

type StreamCallbackFn func(string)

Jump to

Keyboard shortcuts

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