Use newer model cause Discord be bussin'

This commit is contained in:
2025-05-03 21:57:59 +00:00
parent 2732420294
commit 6b8f4674c3
8 changed files with 43 additions and 14 deletions

View File

@ -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)
})

View File

@ -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{}