ds

package
v0.0.0-...-3fb9ebd Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppContext

type AppContext struct {
	LogFilePath         string        `yaml:"logFilePath"`
	MaxFetchRecord      int           `yaml:"maxFetchRecord"`
	MaxUserRecord       int           `yaml:"maxUserRecord"`
	OpenaiApiKey        string        `yaml:"openaiApiKey"`
	ApplicationId       string        `yaml:"applicationId"`
	BotName             string        `yaml:"botName"`
	BotToken            string        `yaml:"botToken"`
	ClearCmd            string        `yaml:"clearCmd"`
	ClearCmdDesc        string        `yaml:"clearCmdDesc"`
	ClearDelimiter      string        `yaml:"clearDelimiter"`
	ChatModel           string        `yaml:"chatModel"`
	ChatTemperature     float32       `yaml:"chatTemperature"`
	Character           string        `yaml:"character"`
	FreeChatLimit       int           `yaml:"creeChatLimit"`
	ConversationSupport bool          `yaml:"conversationSupport"`
	ChannelConfig       []ChatChannel `yaml:"channelConfig"`
	BotId               string
	ConfigFilePath      string
}

type ChatChannel

type ChatChannel struct {
	ChannelId           string  `yaml:"channelId"`
	ChatModel           string  `yaml:"chatModel,omitempty"`
	ChatTemperature     float32 `yaml:"chatTemperature,omitempty"`
	Character           string  `yaml:"character,omitempty"`
	FreeChatLimit       int     `yaml:"freeChatLimit,omitempty"`
	ConversationSupport bool    `yaml:"conversationSupport,omitempty"`
}

type ChatMessage

type ChatMessage struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

type Stack

type Stack struct {
	// contains filtered or unexported fields
}

func NewStack

func NewStack() *Stack

func (*Stack) GetBottomElement

func (s *Stack) GetBottomElement() (*discordgo.Message, error)

GetBottomElement returns the bottom element of the stack

func (*Stack) IsEmpty

func (s *Stack) IsEmpty() bool

func (*Stack) Pop

func (s *Stack) Pop() (*discordgo.Message, error)

func (*Stack) Push

func (s *Stack) Push(element *discordgo.Message)

func (*Stack) Size

func (s *Stack) Size() int

type Token

type Token struct {
	Discord string
	OpenAi  string
}

Token is the token for the discord bot and chatgpt

type UserSession

type UserSession struct {
	UserChannelID  string //UserSession's unique key
	UserId         string
	ChannelID      string
	UserName       string
	ClearDelimiter string
	Prompt         string
	OnConversation bool //Whether to enable context
	OnAt           bool //Whether to reply to the robot only when AT
	ChatCount      int  //Number of messages sent by the user
}

UserSession Each user holds a session in each channel to save its state

Jump to

Keyboard shortcuts

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