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

@@ -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"`
}

4
go.mod
View File

@@ -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

4
go.sum
View File

@@ -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=

View File

@@ -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
}

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)