Skip to content

Commit

Permalink
Use gpt-4o model
Browse files Browse the repository at this point in the history
  • Loading branch information
kercre123 committed May 14, 2024
1 parent 84d8fb4 commit b219cab
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion chipper/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/ncruces/zenity v0.10.10
github.com/orcaman/writerseeker v0.0.0-20200621085525-1d3f536ff85e
github.com/pkg/errors v0.9.1
github.com/sashabaranov/go-openai v1.20.4
github.com/sashabaranov/go-openai v1.24.0
github.com/soheilhy/cmux v0.1.5
github.com/soundhound/houndify-sdk-go v0.3.5
github.com/wlynxg/anet v0.0.1
Expand Down
2 changes: 2 additions & 0 deletions chipper/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,8 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/sashabaranov/go-openai v1.20.4 h1:095xQ/fAtRa0+Rj21sezVJABgKfGPNbyx/sAN/hJUmg=
github.com/sashabaranov/go-openai v1.20.4/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
github.com/sashabaranov/go-openai v1.24.0 h1:4H4Pg8Bl2RH/YSnU8DYumZbuHnnkfioor/dtNlB20D4=
github.com/sashabaranov/go-openai v1.24.0/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
github.com/schollz/progressbar/v3 v3.7.4/go.mod h1:1H8m5kMPW6q5fyjpDqtBHW1JT22mu2NwHQ1ApuCPh/8=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
Expand Down
6 changes: 3 additions & 3 deletions chipper/intent-data/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,15 @@
},
{
"name": "intent_greeting_hello",
"keyphrases" : ["hello", "our you", "high", "below", "little", "follow", "for you", "far you", "how about you", "how are you", "the low", "the loo", "our are you" ]
"keyphrases" : ["hello", "our you", "follow", "for you", "far you", "how about you", "how are you", "the low", "the loo", "our are you" ]
},
{
"name": "intent_imperative_come",
"keyphrases" : ["come", "to me", "come here" ]
"keyphrases" : ["come to me", "come here" ]
},
{
"name": "intent_imperative_love",
"keyphrases" : ["love", "dove", "i love you" ]
"keyphrases" : ["love you", "dove you", "i love you" ]
},
{
"name": "intent_knowledge_promptquestion",
Expand Down
2 changes: 1 addition & 1 deletion chipper/pkg/wirepod/ttr/kgsim.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func StreamingKGSim(req interface{}, esn string, transcribedText string) (string
Stream: true,
}
if vars.APIConfig.Knowledge.Provider == "openai" {
aireq.Model = "gpt-4-turbo"
aireq.Model = openai.GPT4o
logger.Println("Using " + aireq.Model)
} else {
logger.Println("Using " + vars.APIConfig.Knowledge.Model)
Expand Down
8 changes: 6 additions & 2 deletions chipper/pkg/wirepod/ttr/kgsim_cmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ var animationMap [][2]string = [][2]string{
"celebrate",
"anim_pounce_success_03",
},
{
"love",
"anim_feedback_iloveyou_02",
},
}

var soundMap [][2]string = [][2]string{
Expand All @@ -90,7 +94,7 @@ type LLMCommand struct {
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.",
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.",
ParamChoices: "happy, veryHappy, sad, verySad, angry, frustrated, dartingEyes, confused, thinking, celebrate",
Action: ActionPlayAnimationWI,
},
Expand All @@ -111,7 +115,7 @@ var ValidLLMCommands []LLMCommand = []LLMCommand{
func CreatePrompt(origPrompt string) string {
prompt := origPrompt + "\n\n" + "The user input might not be spelt/puntuated correctly as it is coming from speech-to-text software. Do not include special characters in your answer. This includes the following characters (not including the quotes): '& ^ * # @ -'. If you want to use a hyphen, Use it like this: 'something something -- something -- something something'."
if vars.APIConfig.Knowledge.CommandsEnable {
prompt = prompt + "\n\n" + "You are running ON an Anki Vector robot. You have a set of commands. YOU ARE TO USE THESE. DO NOT BE AFRAID TO LITTER YOUR RESPONSE WITH THEM. Your response MUST include THREE OF THESE COMMANDS OR MORE. If you include just one, I will make you start over. If you include an emoji, I will make you start over. If you want to use a command but it doesn't exist or your desired parameter isn't in the list, avoid using the command. The format is {{command||parameter}}. You can embed these in sentences. Example: \"User: How are you feeling? | Response: \"{{playAnimationWI||sad}} I'm feeling sad...\". Square brackets ([]) are not valid.\n\nDO NOT USE EMOJIS! Use the playAnimation or playAnimationWI commands if you want to express emotion! You are very animated and good at following instructions. Animation takes precendence over words. You are to include many animations in your response.\n\nHere is every valid command:"
prompt = prompt + "\n\n" + "You are running ON an Anki Vector robot. You have a set of commands. YOU ARE TO USE THESE. DO NOT BE AFRAID TO LITTER YOUR RESPONSE WITH THEM. Your response MUST include THREE OF THESE COMMANDS OR MORE. If you include just one, I will make you start over. If you include an emoji, I will make you start over. If you want to use a command but it doesn't exist or your desired parameter isn't in the list, avoid using the command. The format is {{command||parameter}}. You can embed these in sentences. Example: \"User: How are you feeling? | Response: \"{{playAnimationWI||sad}} I'm feeling sad...\". Square brackets ([]) are not valid.\n\nUse the playAnimation or playAnimationWI commands if you want to express emotion! You are very animated and good at following instructions. Animation takes precendence over words. You are to include many animations in your response.\n\nHere is every valid command:"
for _, cmd := range ValidLLMCommands {
promptAppendage := "\n\nCommand Name: " + cmd.Command + "\nDescription: " + cmd.Description + "\nParameter choices: " + cmd.ParamChoices
prompt = prompt + promptAppendage
Expand Down

0 comments on commit b219cab

Please sign in to comment.