Use newer model cause Discord be bussin'
This commit is contained in:
@ -3,8 +3,8 @@ package bot
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"git.ewnix.net/phlux/discord-gpt-bot/bot/memory"
|
||||
"git.ewnix.net/phlux/discord-gpt-bot/openai"
|
||||
"discord-gpt-bot/openai"
|
||||
|
||||
"github.com/bwmarrin/discordgo"
|
||||
)
|
||||
|
||||
@ -20,7 +20,7 @@ func Start(session *discordgo.Session) {
|
||||
|
||||
userID := m.Author.ID
|
||||
content := strings.ReplaceAll(m.Content, "<@"+s.State.User.ID+">", "")
|
||||
history := memory.GetHistory(userID)
|
||||
history := GetHistory(userID)
|
||||
|
||||
history = append(history, openai.Message{Role: "user", Content: strings.TrimSpace(content)})
|
||||
resp, err := openai.Ask(history)
|
||||
@ -30,7 +30,7 @@ func Start(session *discordgo.Session) {
|
||||
}
|
||||
|
||||
history = append(history, openai.Message{Role: "assistant", Content: resp})
|
||||
memory.SetHistory(userID, history)
|
||||
SetHistory(userID, history)
|
||||
|
||||
s.ChannelMessageSend(m.ChannelID, resp)
|
||||
})
|
||||
|
@ -1,7 +1,7 @@
|
||||
package memory
|
||||
package bot
|
||||
|
||||
import (
|
||||
"git.ewnix.net/phlux/discord-gpt-bot/openai"
|
||||
"discord-gpt-bot/openai"
|
||||
)
|
||||
|
||||
var conversations = map[string][]openai.Message{}
|
||||
|
Reference in New Issue
Block a user