chatmodel

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Anthropic

type Anthropic struct {
	schema.Tokenizer
	// contains filtered or unexported fields
}

func NewAnthropic

func NewAnthropic(apiKey string) (*Anthropic, error)

func (*Anthropic) Callbacks

func (cm *Anthropic) Callbacks() []schema.Callback

func (*Anthropic) Generate

func (cm *Anthropic) Generate(ctx context.Context, messages schema.ChatMessages) (*schema.LLMResult, error)

func (*Anthropic) Type

func (cm *Anthropic) Type() string

func (*Anthropic) Verbose

func (cm *Anthropic) Verbose() bool

type AnthropicOptions

type AnthropicOptions struct {
	*schema.CallbackOptions
	// Model name to use.
	ModelName string
	// Denotes the number of tokens to predict per generation.
	MaxTokens int
}

type Fake added in v0.0.14

type Fake struct {
	schema.Tokenizer
	// contains filtered or unexported fields
}

func NewFake added in v0.0.14

func NewFake(response string) *Fake

func (*Fake) Callbacks added in v0.0.14

func (cm *Fake) Callbacks() []schema.Callback

func (*Fake) Generate added in v0.0.14

func (cm *Fake) Generate(ctx context.Context, messages schema.ChatMessages) (*schema.LLMResult, error)

func (*Fake) Type added in v0.0.14

func (cm *Fake) Type() string

func (*Fake) Verbose added in v0.0.14

func (cm *Fake) Verbose() bool

type OpenAI

type OpenAI struct {
	schema.Tokenizer
	// contains filtered or unexported fields
}

func NewOpenAI

func NewOpenAI(apiKey string) (*OpenAI, error)

func (*OpenAI) Callbacks

func (cm *OpenAI) Callbacks() []schema.Callback

func (*OpenAI) Generate

func (cm *OpenAI) Generate(ctx context.Context, messages schema.ChatMessages) (*schema.LLMResult, error)

func (*OpenAI) Type

func (cm *OpenAI) Type() string

func (*OpenAI) Verbose

func (cm *OpenAI) Verbose() bool

type OpenAIOptions

type OpenAIOptions struct {
	*schema.CallbackOptions
	// Model name to use.
	ModelName string
	// Sampling temperature to use.
	Temperatur float32
	// The maximum number of tokens to generate in the completion.
	// -1 returns as many tokens as possible given the prompt and
	//the models maximal context size.
	MaxTokens int
	// Total probability mass of tokens to consider at each step.
	TopP float32
	// Penalizes repeated tokens.
	PresencePenalty float32
	// Penalizes repeated tokens according to frequency.
	FrequencyPenalty float32
	// How many completions to generate for each prompt.
	N int
	// Batch size to use when passing multiple documents to generate.
	BatchSize int
}

Jump to

Keyboard shortcuts

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