loop: preserve cumulative usage across conversation compaction
conversation: add optional CumulativeUsage parameter to New function
Update CompactConversation to preserve cumulative usage statistics when
resetting the conversation, preventing usage numbers from being lost during
compaction.
Co-Authored-By: sketch <hello@sketch.dev>
Change-ID: s11dcb84790847494k
diff --git a/llm/conversation/convo_test.go b/llm/conversation/convo_test.go
index 8794468..694b977 100644
--- a/llm/conversation/convo_test.go
+++ b/llm/conversation/convo_test.go
@@ -30,7 +30,7 @@
APIKey: apiKey,
HTTPC: rr.Client(),
}
- convo := New(ctx, srv)
+ convo := New(ctx, srv, nil)
const name = "Cornelius"
res, err := convo.SendUserTextMessage("Hi, my name is " + name)
@@ -92,7 +92,7 @@
srv := &ant.Service{}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
- convo := New(context.Background(), srv)
+ convo := New(context.Background(), srv, nil)
var cancelCalled bool
var cancelledWithErr error
@@ -248,7 +248,7 @@
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
srv := &ant.Service{}
- convo := New(context.Background(), srv)
+ convo := New(context.Background(), srv, nil)
// Create request with messages
req := &llm.Request{