scenario

package
v0.0.0-...-f28923a Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const MaxToken = 2600

Variables

This section is empty.

Functions

func GetAllRules

func GetAllRules() []types.Types

GetAllRules get all rules 获取所有规则

func Init

func Init() error

Init rules 初始化规则

func RunScript

func RunScript(script string, m *Messages, usage int)

RunScript runs the script. 执行脚本

func SetGPTHandler

func SetGPTHandler(h *gpt.Handler)

SetGPTHandler set gpt handler 设置 GPT 处理器

Types

type Messages

type Messages struct {
	MessageArray []*gpt.Message
	ID           string
	// contains filtered or unexported fields
}

Messages store the message history of a conversation 存储对话的消息历史

func CheckRule

func CheckRule(request *types.Request) *Messages

CheckRule check the rule of the request and generate the message 检查请求的规则并生成消息

func (*Messages) HandleAnswer

func (m *Messages) HandleAnswer(answer string, usage int) string

HandleAnswer handle the answer of the latest paragraph 处理最新段落的答案

Jump to

Keyboard shortcuts

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