feat: publish sanitized custom.97 source

This commit is contained in:
cneicy committed 2026-10-27 20:43:39 +08:00
1 parent 8e6ed0317b
commit 86c0276156
1022 files changed
+69903 -19207

No files matched your search

+4
View File
@@ -32,6 +32,7 @@ type ResponseGuardUsage struct {
}
type ResponseGuardAttempt struct {
Timing *UpstreamTiming `json:"-"`
OnEvent func([]byte, bool) `json:"-"`
OnClose func() `json:"-"`
closeOnce sync.Once
@@ -141,6 +142,9 @@ func (g *ResponseModelGuard) APIError() *types.NewAPIError {
// Only read the provider's declaration and numeric usage, never generated text.
func (a *ResponseGuardAttempt) observe(payload []byte, stream bool) error {
if stream {
a.Timing.Mark("first_sse_data")
}
if a.OnEvent != nil {
a.OnEvent(payload, stream)
}