Skip to content

Commit

Permalink
change model
Browse files Browse the repository at this point in the history
  • Loading branch information
xjl0 committed Jun 21, 2024
1 parent 5f2f5fe commit 4f0d772
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/discord/discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"discordbotgo/internal/chatGPT"
"errors"
"fmt"
"github.com/alexsergivan/transliterator"
"github.com/bwmarrin/discordgo"
"github.com/sashabaranov/go-openai"
Expand Down Expand Up @@ -85,14 +86,19 @@ func MessageHandler(s *discordgo.Session, m *discordgo.MessageCreate, gpt *chatG
stream, err := gpt.Client.CreateChatCompletionStream(
ctx,
openai.ChatCompletionRequest{
Model: openai.GPT4o,
Model: openai.GPT4o20240513,
Messages: messages,
Stream: true,
TopP: 1,
N: 1,
},
)
if err != nil {
s.ChannelMessageSendReply(m.ChannelID, fmt.Sprintf("Прости, я сегодня уже не могу ответить, занята, давай завтра \n ```%s\n```", err.Error()), &discordgo.MessageReference{
MessageID: m.Message.ID,
ChannelID: m.ChannelID,
GuildID: m.GuildID,
})
log.Printf("ChatCompletion error: %v\n", err)
return
}
Expand Down

0 comments on commit 4f0d772

Please sign in to comment.