Go: add stats (#17061)

### Summary

Add LLM token stats framework

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-07-18 21:02:07 +08:00
committed by GitHub
parent cafbbd467d
commit b8d06d02e6
144 changed files with 1578 additions and 1280 deletions

View File

@@ -90,6 +90,7 @@ func TestStreamNotTruncatedByNonStreamTimeout(t *testing.T) {
[]Message{{Role: "user", Content: "hi"}},
&APIConfig{ApiKey: &apiKey},
nil,
nil,
func(c *string, _ *string) error {
if c != nil && *c != "[DONE]" {
got.WriteString(*c)
@@ -132,7 +133,7 @@ func TestNonStreamHonorsShortDeadline(t *testing.T) {
"llama-3.3-70b-versatile",
[]Message{{Role: "user", Content: "hi"}},
&APIConfig{ApiKey: &apiKey},
nil,
nil, nil,
)
done <- err
}()