Documentation ¶
Index ¶
- Constants
- Variables
- func BControl(robot *vector.Vector, ctx context.Context, start, stop chan bool)
- func CreateAIReq(transcribedText, esn string, gpt3tryagain, isKG bool) openai.ChatCompletionRequest
- func CreatePrompt(origPrompt string, model string, isKG bool) string
- func CreatePrompt_xiao_wan(origPrompt string) string
- func DoGetImage(msgs []openai.ChatCompletionMessage, param string, robot *vector.Vector, ...)
- func DoNewRequest(robot *vector.Vector)
- func DoPlayAnimation(animation string, robot *vector.Vector) error
- func DoPlayAnimationWI(animation string, robot *vector.Vector) error
- func DoPlayAnimationWI_xiao_wan(animation string, robot *vector.Vector) error
- func DoPlayAnimation_xiao_wan(animation string, robot *vector.Vector) error
- func DoPlaySound(sound string, robot *vector.Vector) error
- func DoPlaySound_xiao_wan(sound string, robot *vector.Vector) error
- func DoSayText(input string, robot *vector.Vector) error
- func DoSayText_OpenAI(robot *vector.Vector, input string) error
- func DoSayText_cn_xiao_wan(input string, robot *vector.Vector) error
- func DoSayText_xiao_wan(input string, robot *vector.Vector) error
- func GetChat(esn string) vars.RememberedChat
- func IntentPass(req interface{}, intentThing string, speechText string, ...) (interface{}, error)
- func InterruptKGSimWhenTouchedOrWaked(rob *vector.Vector, stop chan bool, stopStop chan bool) bool
- func KGSim(esn string, textToSay string) error
- func KGSim_xiao_wan(esn string, textToSay string) error
- func LoadPlugins()
- func ModelIsSupported(cmd LLMCommand, model string) bool
- func ParamChecker(req interface{}, intent string, speechText string, botSerial string)
- func ParamCheckerSlotsEnUS(req interface{}, intent string, slots map[string]string, isOpus bool, ...)
- func PerformActions(msgs []openai.ChatCompletionMessage, actions []RobotAction, ...) bool
- func PerformActions_xiao_wan(actions []RobotAction_xiao_wan, robot *vector.Vector)
- func PlaceChat(chat vars.RememberedChat)
- func ProcessTextAll(req interface{}, voiceText string, intents []vars.JsonIntent, isOpus bool) bool
- func Remember(user, ai openai.ChatCompletionMessage, esn string)
- func StartAnim_Queue(esn string)
- func StopAnim_Queue(esn string)
- func StreamingKGSim(req interface{}, esn string, transcribedText string, isKG bool) (string, error)
- func StreamingKGSim_test(req interface{}, esn string, transcribedText string) (string, error)
- func StreamingKGSim_xiao_wan(req interface{}, esn string, transcribedText string) (string, error)
- func WaitForAnim_Queue(esn string)
- func Xiao_wan_start(transcribedText string) (string, error)
- type AnimationQueue
- type LLMCommand
- type LLMCommand_xiao_wan
- type RobotAction
- type RobotAction_xiao_wan
- type WeatherStruct
Constants ¶
View Source
const ( // arg: text to say // not a command ActionSayText = 0 // arg: animation name ActionPlayAnimation = 1 // arg: animation name ActionPlayAnimationWI = 2 // arg: now ActionGetImage = 3 ActionNewRequest = 4 // arg: sound file ActionPlaySound = 4 )
View Source
const ( // arg: text to say // not a command ActionSayText_xiao_wan = 0 // 定义说话动作常量 // arg: animation name ActionPlayAnimation_xiao_wan = 1 // 定义播放动画动作常量 // arg: animation name ActionPlayAnimationWI_xiao_wan = 2 // 定义播放动画(不中断说话)动作常量 // arg: sound file ActionPlaySound_xiao_wan = 3 // 定义播放声音文件动作常量 )
Variables ¶
View Source
var AnimationQueues []AnimationQueue
View Source
var PluginList []*plugin.Plugin
View Source
var PluginNames []string
View Source
var PluginUtterances []*[]string
View Source
var ValidLLMCommands []LLMCommand = []LLMCommand{ { Command: "playAnimationWI", Description: "Plays an animation on the robot without interrupting speech. This should be used FAR more than the playAnimation command. This is great for storytelling and making any normal response animated. Don't put two of these right next to each other. Use this MANY times. The param choices are the only choices you have. You can't create any.", ParamChoices: "happy, veryHappy, sad, verySad, angry, frustrated, dartingEyes, confused, thinking, celebrate, love", Action: ActionPlayAnimationWI, SupportedModels: []string{"all"}, }, { Command: "playAnimation", Description: "Plays an animation on the robot. This will interrupt speech. Only use this if you are directed to play an animaion.", ParamChoices: "happy, veryHappy, sad, verySad, angry, frustrated, dartingEyes, confused, thinking, celebrate, love", Action: ActionPlayAnimation, SupportedModels: []string{"all"}, }, { Command: "getImage", Description: "Gets an image from the robot's camera and places it in the next message. If you want to do this, tell the user what you are about to do THEN use the command. This command should END a sentence. Your response will be stopped when this command is recognized. If a user says something like 'what do you see', you should assume that you need to take a new photo. Do NOT automatically assume that you are analyzing a previous photo.", ParamChoices: "front, lookingUp", Action: ActionGetImage, SupportedModels: []string{openai.GPT4o, openai.GPT4oMini}, }, { Command: "newVoiceRequest", Description: "Starts a new voice command from the robot. Use this if you want more input from the user after your response/if you want to carry out a conversation. Below this, there should be a NOTE telling you whether you are in conversation mode or not. If you are, DONT BE AFRAID TO USE THIS COMMAND! This goes at the end of your response, if you use it.", ParamChoices: "now", Action: ActionNewRequest, SupportedModels: []string{"all"}, }, }
View Source
var ValidLLMCommands_xiao_wan []LLMCommand_xiao_wan = []LLMCommand_xiao_wan{ { Command: "playAnimation", Description: "Plays an animation on the robot. This will interrupt speech.", ParamChoices: "happy, veryHappy, sad, verySad, angry, frustrated, dartingEyes, confused, thinking, celebrate", Action: ActionPlayAnimation_xiao_wan, }, { Command: "playAnimationWI", Description: "Plays an animation on the robot without interrupting speech.", ParamChoices: "happy, veryHappy, sad, verySad, angry, frustrated, dartingEyes, confused, thinking, celebrate", Action: ActionPlayAnimationWI_xiao_wan, }, }
创建从LLM解析并生成RobotActions结构体的函数
Functions ¶
func CreateAIReq ¶
func CreatePrompt_xiao_wan ¶
func DoGetImage ¶
func DoNewRequest ¶
func GetChat ¶
func GetChat(esn string) vars.RememberedChat
func IntentPass ¶
func KGSim_xiao_wan ¶
func LoadPlugins ¶
func LoadPlugins()
func ModelIsSupported ¶
func ModelIsSupported(cmd LLMCommand, model string) bool
func ParamChecker ¶
stt
func ParamCheckerSlotsEnUS ¶
func ParamCheckerSlotsEnUS(req interface{}, intent string, slots map[string]string, isOpus bool, botSerial string)
stintent
func PerformActions ¶
func PerformActions(msgs []openai.ChatCompletionMessage, actions []RobotAction, robot *vector.Vector, stopStop chan bool) bool
func PerformActions_xiao_wan ¶
func PerformActions_xiao_wan(actions []RobotAction_xiao_wan, robot *vector.Vector)
func PlaceChat ¶
func PlaceChat(chat vars.RememberedChat)
func ProcessTextAll ¶
func ProcessTextAll(req interface{}, voiceText string, intents []vars.JsonIntent, isOpus bool) bool
func Remember ¶
func Remember(user, ai openai.ChatCompletionMessage, esn string)
remember last 16 lines of chat
func StartAnim_Queue ¶
func StartAnim_Queue(esn string)
func StopAnim_Queue ¶
func StopAnim_Queue(esn string)
func StreamingKGSim ¶
func StreamingKGSim_test ¶
func StreamingKGSim_xiao_wan ¶
func WaitForAnim_Queue ¶
func WaitForAnim_Queue(esn string)
func Xiao_wan_start ¶
Types ¶
type AnimationQueue ¶
type LLMCommand ¶
type LLMCommand_xiao_wan ¶
type RobotAction ¶
func CmdParamToAction ¶
func CmdParamToAction(cmd, param string) RobotAction
func GetActionsFromString ¶
func GetActionsFromString(input string) []RobotAction
type RobotAction_xiao_wan ¶
func CmdParamToAction_xiao_wan ¶
func CmdParamToAction_xiao_wan(cmd, param string) RobotAction_xiao_wan
func GetActionsFromString_xiao_wan ¶
func GetActionsFromString_xiao_wan(input string) []RobotAction_xiao_wan
Click to show internal directories.
Click to hide internal directories.