refactoring, fixes and laniakea v0.8
This commit is contained in:
@@ -1,21 +1,22 @@
|
||||
package plugins
|
||||
|
||||
import (
|
||||
"kurumibot/database/mdb"
|
||||
"kurumibot/database/red"
|
||||
"kurumibot/utils/ai"
|
||||
"strings"
|
||||
"ymgb/database"
|
||||
"ymgb/database/mdb"
|
||||
"ymgb/database/red"
|
||||
"ymgb/utils/ai"
|
||||
|
||||
"git.nix13.pw/scuroneko/laniakea"
|
||||
)
|
||||
|
||||
func RegisterAi(bot *laniakea.Bot) {
|
||||
p := laniakea.NewPlugin("AI")
|
||||
func RegisterAi() *laniakea.Plugin[database.Context] {
|
||||
p := laniakea.NewPlugin[database.Context]("AI")
|
||||
p.AddCommand(p.NewCommand(gpt, "gpt").SkipCommandAutoGen())
|
||||
bot.AddPlugins(p)
|
||||
return p
|
||||
}
|
||||
|
||||
func gpt(ctx *laniakea.MsgContext, db *laniakea.DatabaseContext) {
|
||||
func gpt(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
q := strings.Join(ctx.Args, " ")
|
||||
api := ai.NewOpenAIAPI(ai.GPTBaseUrl, "", "anthropic/claude-sonnet-4")
|
||||
defer api.Close()
|
||||
|
||||
Reference in New Issue
Block a user