Documentation
¶
Index ¶
- Constants
- Variables
- type Cohere
- func (c *Cohere) Chat(ctx context.Context, prompt *chat.Chat) (string, error)
- func (c *Cohere) Completion(ctx context.Context, prompt string) (string, error)
- func (c *Cohere) Generate(ctx context.Context, t *thread.Thread) error
- func (c *Cohere) WithAPIKey(apiKey string) *Cohere
- func (c *Cohere) WithCache(cache *cache.Cache) *Cohere
- func (c *Cohere) WithMaxTokens(maxTokens int) *Cohere
- func (c *Cohere) WithModel(model Model) *Cohere
- func (c *Cohere) WithObserver(observer llmobserver.LLMObserver, traceID string) *Cohere
- func (c *Cohere) WithStop(stop []string) *Cohere
- func (c *Cohere) WithStream(callbackFn StreamCallbackFn) *Cohere
- func (c *Cohere) WithTemperature(temperature float64) *Cohere
- func (c *Cohere) WithVerbose(verbose bool) *Cohere
- type Model
- type StreamCallbackFn
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 (*Cohere) Completion ¶
Completion returns the completion for the given prompt
func (*Cohere) WithAPIKey ¶
WithAPIKey sets the API key to use for the LLM
func (*Cohere) WithMaxTokens ¶
WithMaxTokens sets the max tokens 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) WithStream ¶ added in v0.1.0
func (c *Cohere) WithStream(callbackFn StreamCallbackFn) *Cohere
func (*Cohere) WithTemperature ¶
WithTemperature sets the temperature to use for the LLM
func (*Cohere) WithVerbose ¶
WithVerbose sets the verbosity of the LLM
type 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)
Click to show internal directories.
Click to hide internal directories.