diff --git a/database/mdb/logs.go b/database/mdb/logs.go index bb31744..1c60048 100644 --- a/database/mdb/logs.go +++ b/database/mdb/logs.go @@ -46,7 +46,7 @@ func GetConsoleLogs(db *database.Context) ([]ConsoleLogEntry, error) { type MessageLogEntry struct { MessageID int `bson:"messageId" json:"message_id"` SenderID int `bson:"senderId" json:"sender_id"` - ChatID int `bson:"chatId" json:"chat_id"` + ChatID int64 `bson:"chatId" json:"chat_id"` Text string `bson:"text" json:"text"` TimeStamp int64 `bson:"timestamp" json:"timestamp"` } diff --git a/go.mod b/go.mod index 8b06166..308544b 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.26.0 require ( git.nix13.pw/scuroneko/extypes v1.2.1 - git.nix13.pw/scuroneko/laniakea v1.0.0-beta.6 + git.nix13.pw/scuroneko/laniakea v1.0.0-beta.8 git.nix13.pw/scuroneko/slog v1.0.2 github.com/google/uuid v1.6.0 github.com/joho/godotenv v1.5.1 @@ -15,7 +15,7 @@ require ( go.mongodb.org/mongo-driver/v2 v2.5.0 ) -//replace git.nix13.pw/scuroneko/laniakea v1.0.0-beta.6 => ./laniakea +//replace git.nix13.pw/scuroneko/laniakea v1.0.0-beta.8 => ./laniakea //replace git.nix13.pw/scuroneko/extypes v1.2.1 => ../go-extypes //replace git.nix13.pw/scuroneko/slog v1.0.2 => ../slog diff --git a/go.sum b/go.sum index b314ed8..c11981f 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= git.nix13.pw/scuroneko/extypes v1.2.1 h1:IYrOjnWKL2EAuJYtYNa+luB1vBe6paE8VY/YD+5/RpQ= git.nix13.pw/scuroneko/extypes v1.2.1/go.mod h1:uZVs8Yo3RrYAG9dMad6qR6lsYY67t+459D9c65QAYAw= -git.nix13.pw/scuroneko/laniakea v1.0.0-beta.6 h1:4XgYsXgx68/UkXORku2245yLaT+NnKnipanKpUKsuoI= -git.nix13.pw/scuroneko/laniakea v1.0.0-beta.6/go.mod h1:DZgCqOazRzoa+f/GSNuKnTB2wIZ1eJD3cGf34Qya31U= +git.nix13.pw/scuroneko/laniakea v1.0.0-beta.8 h1:A0O0iXZ7iW0E2Bc9xE9lxrpPoIfc6080anfOHPOSim8= +git.nix13.pw/scuroneko/laniakea v1.0.0-beta.8/go.mod h1:DZgCqOazRzoa+f/GSNuKnTB2wIZ1eJD3cGf34Qya31U= git.nix13.pw/scuroneko/slog v1.0.2 h1:vZyUROygxC2d5FJHUQM/30xFEHY1JT/aweDZXA4rm2g= git.nix13.pw/scuroneko/slog v1.0.2/go.mod h1:3Qm2wzkR5KjwOponMfG7TcGSDjmYaFqRAmLvSPTuWJI= github.com/alitto/pond/v2 v2.6.2 h1:Sphe40g0ILeM1pA2c2K+Th0DGU+pt0A/Kprr+WB24Pw= diff --git a/openai/api.go b/openai/api.go index 4a463bc..24a4783 100644 --- a/openai/api.go +++ b/openai/api.go @@ -169,7 +169,6 @@ func (r *Request[P]) DoStreamWithContext(ctx context.Context, api *API) (iter.Se if !yield(resp, nil) { return } - time.Sleep(time.Millisecond * 100) } }, nil } diff --git a/plugins/ai.go b/plugins/ai.go index 5e486c5..fd218f8 100644 --- a/plugins/ai.go +++ b/plugins/ai.go @@ -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 { diff --git a/plugins/rp.go b/plugins/rp.go index 6a9901e..6a7c899 100644 --- a/plugins/rp.go +++ b/plugins/rp.go @@ -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)