File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
packages/agents-extensions/src Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @openai/agents-extensions ' : patch
3
+ ---
4
+
5
+ Fix #259 Failing to send trace data with usage for ai-sdk models
Original file line number Diff line number Diff line change @@ -500,9 +500,10 @@ export class AiSdkModel implements Model {
500
500
501
501
if ( span && request . tracing === true ) {
502
502
span . spanData . usage = {
503
+ // Note that tracing supports only input and output tokens for Chat Completions.
504
+ // So, we don't include other properties here.
503
505
input_tokens : response . usage . inputTokens ,
504
506
output_tokens : response . usage . outputTokens ,
505
- total_tokens : response . usage . totalTokens ,
506
507
} ;
507
508
}
508
509
@@ -724,9 +725,10 @@ export class AiSdkModel implements Model {
724
725
if ( span && request . tracing === true ) {
725
726
span . spanData . output = outputs ;
726
727
span . spanData . usage = {
728
+ // Note that tracing supports only input and output tokens for Chat Completions.
729
+ // So, we don't include other properties here.
727
730
input_tokens : finalEvent . response . usage . inputTokens ,
728
731
output_tokens : finalEvent . response . usage . outputTokens ,
729
- total_tokens : finalEvent . response . usage . totalTokens ,
730
732
} ;
731
733
}
732
734
You can’t perform that action at this time.
0 commit comments