This commit is contained in:
2026-03-02 17:57:13 +03:00
parent 3e0d3db47e
commit bca84ad269
6 changed files with 10 additions and 7 deletions

View File

@@ -3,6 +3,7 @@ package plugins
import (
"io"
"strings"
"time"
"ymgb/database"
"ymgb/openai"
"ymgb/utils/ai"
@@ -20,7 +21,7 @@ func RegisterAi() *laniakea.Plugin[database.Context] {
func gptTest(ctx *laniakea.MsgContext, _ *database.Context) {
q := strings.Join(ctx.Args, " ")
m := ctx.Answer("Генерация запущена")
api := openai.NewOpenAIAPI(ai.GPTBaseUrl, "", "anthropic/claude-sonnet-4")
api := openai.NewOpenAIAPI(ai.GPTBaseUrl, "", "gpt-5.2")
resp, err := api.CreateCompletionStream([]openai.Message{}, q, 1.0)
if err != nil {
m.Delete()
@@ -55,6 +56,7 @@ func gptTest(ctx *laniakea.MsgContext, _ *database.Context) {
//draft.Flush()
break
}
time.Sleep(time.Millisecond * 250)
}
err = draft.Flush()
if err != nil {

View File

@@ -7,6 +7,7 @@ import (
"log"
"strconv"
"strings"
"time"
"ymgb/database"
"ymgb/database/mdb"
"ymgb/database/psql"
@@ -689,6 +690,7 @@ func generate(ctx *laniakea.MsgContext, db *database.Context) {
//draft.Flush()
break
}
time.Sleep(time.Millisecond * 250)
}
counter := redisRpRep.GetCounter(ctx.FromID, waifuId)