some new
This commit is contained in:
@@ -46,7 +46,7 @@ func GetConsoleLogs(db *database.Context) ([]ConsoleLogEntry, error) {
|
|||||||
type MessageLogEntry struct {
|
type MessageLogEntry struct {
|
||||||
MessageID int `bson:"messageId" json:"message_id"`
|
MessageID int `bson:"messageId" json:"message_id"`
|
||||||
SenderID int `bson:"senderId" json:"sender_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"`
|
Text string `bson:"text" json:"text"`
|
||||||
TimeStamp int64 `bson:"timestamp" json:"timestamp"`
|
TimeStamp int64 `bson:"timestamp" json:"timestamp"`
|
||||||
}
|
}
|
||||||
|
|||||||
4
go.mod
4
go.mod
@@ -4,7 +4,7 @@ go 1.26.0
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
git.nix13.pw/scuroneko/extypes v1.2.1
|
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
|
git.nix13.pw/scuroneko/slog v1.0.2
|
||||||
github.com/google/uuid v1.6.0
|
github.com/google/uuid v1.6.0
|
||||||
github.com/joho/godotenv v1.5.1
|
github.com/joho/godotenv v1.5.1
|
||||||
@@ -15,7 +15,7 @@ require (
|
|||||||
go.mongodb.org/mongo-driver/v2 v2.5.0
|
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/extypes v1.2.1 => ../go-extypes
|
||||||
//replace git.nix13.pw/scuroneko/slog v1.0.2 => ../slog
|
//replace git.nix13.pw/scuroneko/slog v1.0.2 => ../slog
|
||||||
|
|
||||||
|
|||||||
4
go.sum
4
go.sum
@@ -2,8 +2,8 @@ filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
|
|||||||
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
|
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 h1:IYrOjnWKL2EAuJYtYNa+luB1vBe6paE8VY/YD+5/RpQ=
|
||||||
git.nix13.pw/scuroneko/extypes v1.2.1/go.mod h1:uZVs8Yo3RrYAG9dMad6qR6lsYY67t+459D9c65QAYAw=
|
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.8 h1:A0O0iXZ7iW0E2Bc9xE9lxrpPoIfc6080anfOHPOSim8=
|
||||||
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/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 h1:vZyUROygxC2d5FJHUQM/30xFEHY1JT/aweDZXA4rm2g=
|
||||||
git.nix13.pw/scuroneko/slog v1.0.2/go.mod h1:3Qm2wzkR5KjwOponMfG7TcGSDjmYaFqRAmLvSPTuWJI=
|
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=
|
github.com/alitto/pond/v2 v2.6.2 h1:Sphe40g0ILeM1pA2c2K+Th0DGU+pt0A/Kprr+WB24Pw=
|
||||||
|
|||||||
@@ -169,7 +169,6 @@ func (r *Request[P]) DoStreamWithContext(ctx context.Context, api *API) (iter.Se
|
|||||||
if !yield(resp, nil) {
|
if !yield(resp, nil) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
time.Sleep(time.Millisecond * 100)
|
|
||||||
}
|
}
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package plugins
|
|||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
"ymgb/database"
|
"ymgb/database"
|
||||||
"ymgb/openai"
|
"ymgb/openai"
|
||||||
"ymgb/utils/ai"
|
"ymgb/utils/ai"
|
||||||
@@ -20,7 +21,7 @@ func RegisterAi() *laniakea.Plugin[database.Context] {
|
|||||||
func gptTest(ctx *laniakea.MsgContext, _ *database.Context) {
|
func gptTest(ctx *laniakea.MsgContext, _ *database.Context) {
|
||||||
q := strings.Join(ctx.Args, " ")
|
q := strings.Join(ctx.Args, " ")
|
||||||
m := ctx.Answer("Генерация запущена")
|
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)
|
resp, err := api.CreateCompletionStream([]openai.Message{}, q, 1.0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
m.Delete()
|
m.Delete()
|
||||||
@@ -55,6 +56,7 @@ func gptTest(ctx *laniakea.MsgContext, _ *database.Context) {
|
|||||||
//draft.Flush()
|
//draft.Flush()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
time.Sleep(time.Millisecond * 250)
|
||||||
}
|
}
|
||||||
err = draft.Flush()
|
err = draft.Flush()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
"ymgb/database"
|
"ymgb/database"
|
||||||
"ymgb/database/mdb"
|
"ymgb/database/mdb"
|
||||||
"ymgb/database/psql"
|
"ymgb/database/psql"
|
||||||
@@ -689,6 +690,7 @@ func generate(ctx *laniakea.MsgContext, db *database.Context) {
|
|||||||
//draft.Flush()
|
//draft.Flush()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
time.Sleep(time.Millisecond * 250)
|
||||||
}
|
}
|
||||||
|
|
||||||
counter := redisRpRep.GetCounter(ctx.FromID, waifuId)
|
counter := redisRpRep.GetCounter(ctx.FromID, waifuId)
|
||||||
|
|||||||
Reference in New Issue
Block a user