contract

package
v0.0.0-...-0e94699 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatBotClientInterface

type ChatBotClientInterface interface {
	// GetConfig 获取基本配置
	GetConfig() *rcconfig.ChatBot
	// SetConfig 设置基本配置
	SetConfig(config *rcconfig.ChatBot)

	CreateCompletion(ctx context.Context, message *model.Message) (*model.Message, error)
	CreateCompletionStream(ctx context.Context, message *model.Message, role model.Role, processStreamData func(data string, status model2.ChatStatus) error) (*model.Message, error)
	CreateChatCompletion(ctx context.Context, message *model.Message, role model.Role) (*model.Message, error)
	CreateChatCompletionStream(ctx context.Context, message *model.Message, role model.Role, processStreamData func(data string, status model2.ChatStatus) error) (*model.Message, error)

	// SetTemperature 设置模型温度
	SetTemperature(temperature float64) error

	// SetMaxAnswerLength 设置回答的最大长度
	SetMaxAnswerLength(length int) error
}

ChatBotClientInterface 是与 ChatBot 客户端交互的接口

Jump to

Keyboard shortcuts

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