Stream token usage on every agent message (#5342)

This commit is contained in:
David Katz
2025-10-29 23:23:25 -04:00
committed by GitHub
parent c875f13757
commit 37e1bb1d37
18 changed files with 214 additions and 63 deletions
+41
View File
@@ -3278,12 +3278,16 @@
"type": "object",
"required": [
"message",
"token_state",
"type"
],
"properties": {
"message": {
"$ref": "#/components/schemas/Message"
},
"token_state": {
"$ref": "#/components/schemas/TokenState"
},
"type": {
"type": "string",
"enum": [
@@ -4526,6 +4530,43 @@
}
}
},
"TokenState": {
"type": "object",
"required": [
"inputTokens",
"outputTokens",
"totalTokens",
"accumulatedInputTokens",
"accumulatedOutputTokens",
"accumulatedTotalTokens"
],
"properties": {
"accumulatedInputTokens": {
"type": "integer",
"format": "int32"
},
"accumulatedOutputTokens": {
"type": "integer",
"format": "int32"
},
"accumulatedTotalTokens": {
"type": "integer",
"format": "int32"
},
"inputTokens": {
"type": "integer",
"format": "int32"
},
"outputTokens": {
"type": "integer",
"format": "int32"
},
"totalTokens": {
"type": "integer",
"format": "int32"
}
}
},
"Tool": {
"type": "object",
"required": [