Documentation ¶
Index ¶
- Variables
- func Adventure(w http.ResponseWriter, req *http.Request)
- func Adventure_V1_Command(bot *linebot.Client, event *linebot.Event, userMessage string)
- func Adventure_V1_InitUser(userid string)
- func Adventure_V2_Command(bot *linebot.Client, event *linebot.Event, userMessage string)
- func Adventure_V2_InitUser(userid string)
- func Adventure_V3_Command(bot *linebot.Client, event *linebot.Event, userMessage string)
- func Adventure_V3_InitUser(userid string)
- func ConvertStructToMap(i interface{}) (map[string]interface{}, error)
- func Delete(collection string, id string) error
- func GetAll(collection string) ([]map[string]interface{}, error)
- func GetByID(collection string, ID string) (map[string]interface{}, error)
- func GetByKeyValue(collection string, key string, value string) ([]map[string]interface{}, error)
- func GetClient() *firestore.Client
- func IsRunningInTestMode() bool
- func SendLineTextMessage(bot *linebot.Client, event *linebot.Event, reply string)
- func SendLineTextMessageWithQuickReply(bot *linebot.Client, event *linebot.Event, adv AdvanceResponse)
- func UpdateOrCreate(collection string, id string, data interface{}, flag ...bool) (err error)
- type AdvanceResponse
- type AdventureVersionSetting
- type UserConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var InDialogs = make(map[string]bool)
View Source
var UsersState = make(map[string]UserConfig)
Functions ¶
func Adventure_V1_Command ¶
func Adventure_V1_InitUser ¶
func Adventure_V1_InitUser(userid string)
func Adventure_V2_Command ¶
func Adventure_V2_InitUser ¶
func Adventure_V2_InitUser(userid string)
func Adventure_V3_Command ¶
func Adventure_V3_InitUser ¶
func Adventure_V3_InitUser(userid string)
func ConvertStructToMap ¶
func GetByKeyValue ¶
func GetClient ¶
GetClient uses sync.Once to ensure that the firestore client is only initialized once
func IsRunningInTestMode ¶
func IsRunningInTestMode() bool
func SendLineTextMessage ¶
func SendLineTextMessageWithQuickReply ¶
func SendLineTextMessageWithQuickReply(bot *linebot.Client, event *linebot.Event, adv AdvanceResponse)
Types ¶
type AdvanceResponse ¶
type AdvanceResponse struct { Body string `json:"Body,omitempty"` Items []string `json:"Items,omitempty"` }
func ConvertJsonToAdv ¶
func ConvertJsonToAdv(str string) (AdvanceResponse, error)
func DoAnAdventure ¶
func DoAnAdventure(userid string, userMessage string, ChatCompletionRequest openai.ChatCompletionRequest) (adv AdvanceResponse, err error)
func DoAnAdventureV2 ¶
func DoAnAdventureV2(userid string, userMessage string, ChatCompletionRequest openai.ChatCompletionRequest) (adv AdvanceResponse, err error)
func Help ¶
func Help() AdvanceResponse
type AdventureVersionSetting ¶
type AdventureVersionSetting struct { SystemPrompt string ChatCompletionRequestFirst openai.ChatCompletionRequest ChatCompletionRequestNormal openai.ChatCompletionRequest }
var Adv_V1 AdventureVersionSetting
var Adv_V2 AdventureVersionSetting
var Adv_V3 AdventureVersionSetting
type UserConfig ¶
type UserConfig struct { ChatHistory []openai.ChatCompletionMessage ConversationCount int CurrentVersion string }
Click to show internal directories.
Click to hide internal directories.