diff --git a/chat/init.go b/chat/init.go index 4be91d6..64a2b33 100644 --- a/chat/init.go +++ b/chat/init.go @@ -2,6 +2,7 @@ package chat import ( "github.com/fumiama/deepinfra" + "github.com/fumiama/deepinfra/model" zero "github.com/wdvxdr1123/ZeroBot" ) @@ -22,18 +23,10 @@ func init() { }) } -func Reply(ctx *zero.Ctx, txt string) { - gid := ctx.Event.GroupID - if gid == 0 { - gid = -ctx.Event.UserID - } - lst.add(gid, "", txt, true) +func Reply(grp int64, txt string) { + lst.add(grp, "", txt, true) } -func Ask(ctx *zero.Ctx, temp float32, mn, sysp, sepstr string) deepinfra.Model { - gid := ctx.Event.GroupID - if gid == 0 { - gid = -ctx.Event.UserID - } - return lst.modelize(temp, gid, mn, sysp, sepstr) +func Ask(p model.Protocol, grp int64, sysp string) deepinfra.Model { + return lst.modelize(p, grp, sysp) } diff --git a/chat/list.go b/chat/list.go index 8c027bf..f8f0458 100644 --- a/chat/list.go +++ b/chat/list.go @@ -49,8 +49,8 @@ func (l *list) add(grp int64, usr, txt string, isme bool) { l.m[grp] = msgs[:len(msgs)-1] } -func (l *list) modelize(temp float32, grp int64, mn, sysp, sepstr string) deepinfra.Model { - m := model.NewCustom(mn, sepstr, temp, 0.9, 1024).System(sysp) +func (l *list) modelize(p model.Protocol, grp int64, sysp string) deepinfra.Model { + m := p.System(sysp) l.mu.RLock() defer l.mu.RUnlock() sz := len(l.m[grp]) diff --git a/go.mod b/go.mod index 76d2683..0181f4d 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/RomiChan/syncx v0.0.0-20240418144900-b7402ffdebc7 github.com/RomiChan/websocket v1.4.3-0.20220227141055-9b2c6168c9c5 github.com/fumiama/cron v1.3.0 - github.com/fumiama/deepinfra v0.0.0-20250214082557-71569e85d503 + github.com/fumiama/deepinfra v0.0.0-20250221160812-ed1290950d32 github.com/fumiama/go-base16384 v1.7.0 github.com/gin-gonic/gin v1.8.2 github.com/go-playground/assert/v2 v2.2.0 diff --git a/go.sum b/go.sum index 5151f95..f8b77cb 100644 --- a/go.sum +++ b/go.sum @@ -39,8 +39,8 @@ github.com/ericpauley/go-quantize v0.0.0-20200331213906-ae555eb2afa4 h1:BBade+Jl github.com/ericpauley/go-quantize v0.0.0-20200331213906-ae555eb2afa4/go.mod h1:H7chHJglrhPPzetLdzBleF8d22WYOv7UM/lEKYiwlKM= github.com/fumiama/cron v1.3.0 h1:ZWlwuexF+HQHl3cYytEE5HNwD99q+3vNZF1GrEiXCFo= github.com/fumiama/cron v1.3.0/go.mod h1:bz5Izvgi/xEUI8tlBN8BI2jr9Moo8N4or0KV8xXuPDY= -github.com/fumiama/deepinfra v0.0.0-20250214082557-71569e85d503 h1:ToU4IyLhSW0QXeBcshd9ARAA/bGt3PGTBcyxUzqaJwg= -github.com/fumiama/deepinfra v0.0.0-20250214082557-71569e85d503/go.mod h1:wW05PQSn8mo1mZIoa6LBUE+3xIBjkoONvnfPTV5ZOhY= +github.com/fumiama/deepinfra v0.0.0-20250221160812-ed1290950d32 h1:loqzJ8AK5R/ayUoFbiVr02rvwqIhcwgeKSvOuv20Q1U= +github.com/fumiama/deepinfra v0.0.0-20250221160812-ed1290950d32/go.mod h1:wW05PQSn8mo1mZIoa6LBUE+3xIBjkoONvnfPTV5ZOhY= github.com/fumiama/go-base16384 v1.7.0 h1:6fep7XPQWxRlh4Hu+KsdH+6+YdUp+w6CwRXtMWSsXCA= github.com/fumiama/go-base16384 v1.7.0/go.mod h1:OEn+947GV5gsbTAnyuUW/SrfxJYUdYupSIQXOuGOcXM= github.com/fumiama/go-registry v0.2.7 h1:tLEqgEpsiybQMqBv0dLHm5leia/z1DhajMupwnOHeNs=