openAI

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

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

Go to latest
Published: Sep 8, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GPT432K0314             = "gpt-4-32k-0314"
	GPT432K                 = "gpt-4-32k"
	GPT40314                = "gpt-4-0314"
	GPT4                    = "gpt-4"
	GPT3Dot5Turbo0301       = "gpt-3.5-turbo-0301"
	GPT3Dot5Turbo           = "gpt-3.5-turbo"
	GPT3TextDavinci003      = "text-davinci-003"
	GPT3TextDavinci002      = "text-davinci-002"
	GPT3TextCurie001        = "text-curie-001"
	GPT3TextBabbage001      = "text-babbage-001"
	GPT3TextAda001          = "text-ada-001"
	GPT3TextDavinci001      = "text-davinci-001"
	GPT3DavinciInstructBeta = "davinci-instruct-beta"
	GPT3Davinci             = "davinci"
	GPT3CurieInstructBeta   = "curie-instruct-beta"
	GPT3Curie               = "curie"
	GPT3Ada                 = "ada"
	GPT3Babbage             = "babbage"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct {
	*ArtisanCloud.BaseDriver
}

func NewDriver

func NewDriver(config *rcconfig.ChatBot) *Driver

func (*Driver) CreateChatCompletion

func (d *Driver) CreateChatCompletion(ctx context.Context, message *model2.Message, role model2.Role) (*model2.Message, error)

SendMessage 向指定对话发送消息

func (*Driver) CreateChatCompletionStream

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

func (*Driver) CreateCompletion

func (d *Driver) CreateCompletion(ctx context.Context, message *model2.Message) (*model2.Message, error)

GenerateAnswer 生成无上下文回答

func (*Driver) CreateCompletionStream

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

func (*Driver) OverrideGetUrlFromEndpoint

func (d *Driver) OverrideGetUrlFromEndpoint() func(endpoint string) (string, error)

func (*Driver) SetMaxAnswerLength

func (d *Driver) SetMaxAnswerLength(length int) error

SetMaxAnswerLength 设置回答的最大长度

func (*Driver) SetTemperature

func (d *Driver) SetTemperature(temperature float64) error

SetTemperature 设置模型温度

func (*Driver) StartModel

func (d *Driver) StartModel() error

StartModel 启动 ChatGPT 模型

func (*Driver) StopModel

func (d *Driver) StopModel() error

StopModel 停止 ChatGPT 模型

Jump to

Keyboard shortcuts

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