f
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package handlers
|
package handlers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"hal/env"
|
"hal/env"
|
||||||
"hal/openai"
|
"hal/openai"
|
||||||
"log"
|
"log"
|
||||||
@@ -17,7 +16,7 @@ func OnMessageCreated(s *discordgo.Session, m *discordgo.MessageCreate) {
|
|||||||
if containUser(m.Mentions, s.State.User.ID) {
|
if containUser(m.Mentions, s.State.User.ID) {
|
||||||
aiclient := openai.NewClient(env.GetEnvVariables().OpenaiHalToken)
|
aiclient := openai.NewClient(env.GetEnvVariables().OpenaiHalToken)
|
||||||
|
|
||||||
res, err := aiclient.ChatCompletions(m.Content)
|
res, err := aiclient.Completions(m.Content)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Panicf("failed to query open ai with the following prompt [%s]. Error: %s", m.Content, err.Error())
|
log.Panicf("failed to query open ai with the following prompt [%s]. Error: %s", m.Content, err.Error())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user