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 {
500500
501501 if ( span && request . tracing === true ) {
502502 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.
503505 input_tokens : response . usage . inputTokens ,
504506 output_tokens : response . usage . outputTokens ,
505- total_tokens : response . usage . totalTokens ,
506507 } ;
507508 }
508509
@@ -724,9 +725,10 @@ export class AiSdkModel implements Model {
724725 if ( span && request . tracing === true ) {
725726 span . spanData . output = outputs ;
726727 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.
727730 input_tokens : finalEvent . response . usage . inputTokens ,
728731 output_tokens : finalEvent . response . usage . outputTokens ,
729- total_tokens : finalEvent . response . usage . totalTokens ,
730732 } ;
731733 }
732734
You can’t perform that action at this time.
0 commit comments