feat: sync deployed v1.0.0-rc.38-custom.67
This commit is contained in:
1 parent
d2e03ab7e8
commit
ffc8cf56db
154 files changed
+39540
-20509
No files matched your search
@@ -21,7 +21,7 @@ type ResponsesUsageAccumulator struct {
|
||||
imageCounter relaycommon.ImageGenerationCallCounter
|
||||
imageCommitted bool
|
||||
started bool
|
||||
hasUsage bool
|
||||
hasUsage bool
|
||||
finished bool
|
||||
}
|
||||
|
||||
@@ -42,7 +42,9 @@ func (a *ResponsesUsageAccumulator) Observe(event *dto.ResponsesStreamResponse)
|
||||
case "response.completed", "response.done", "response.failed", "response.incomplete", "response.cancelled", "response.canceled":
|
||||
if event.Response != nil {
|
||||
ApplyResponsesUsage(a.usage, event.Response.Usage)
|
||||
if event.Response.Usage!=nil {a.hasUsage=true}
|
||||
if event.Response.Usage != nil {
|
||||
a.hasUsage = true
|
||||
}
|
||||
if a.outputText.Len() == 0 {
|
||||
// Some upstreams carry the output only on the terminal event.
|
||||
a.outputText.WriteString(relayconvert.ExtractOutputTextFromResponses(event.Response))
|
||||
@@ -86,7 +88,9 @@ func (a *ResponsesUsageAccumulator) Finish() *dto.Usage {
|
||||
return a.usage
|
||||
}
|
||||
a.finished = true
|
||||
if a.info.DurableAttemptBilling && !a.hasUsage {a.usage.UsageSource="estimated"}
|
||||
if a.info.DurableAttemptBilling && !a.hasUsage {
|
||||
a.usage.UsageSource = "estimated"
|
||||
}
|
||||
// A final image item can already have reached the client before the stream
|
||||
// disconnects. Explicit failed/incomplete terminals reset and commit zero in
|
||||
// Observe; otherwise retain completed tool usage even without a terminal.
|
||||
|
||||
Reference in new issue
Block a user