File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -126,9 +126,9 @@ export class LLMSpan {
126
126
this . span . setAttributes ( {
127
127
[ `${ SpanAttributes . LLM_COMPLETIONS } .${ index } .finish_reason` ] :
128
128
completion . finish_reason ,
129
- [ `${ SpanAttributes . LLM_COMPLETIONS } .${ index } .message. role` ] :
129
+ [ `${ SpanAttributes . LLM_COMPLETIONS } .${ index } .role` ] :
130
130
completion . message . role ,
131
- [ `${ SpanAttributes . LLM_COMPLETIONS } .${ index } .message. content` ] :
131
+ [ `${ SpanAttributes . LLM_COMPLETIONS } .${ index } .content` ] :
132
132
completion . message . content || "" ,
133
133
} ) ;
134
134
} ) ;
Original file line number Diff line number Diff line change @@ -435,6 +435,10 @@ describe("Test SDK Decorators", () => {
435
435
completionSpan . attributes [ `${ SpanAttributes . LLM_PROMPTS } .0.content` ] ,
436
436
"Tell me a joke about OpenTelemetry" ,
437
437
) ;
438
+ assert . strictEqual (
439
+ completionSpan . attributes [ `${ SpanAttributes . LLM_COMPLETIONS } .0.content` ] ,
440
+ result . choices [ 0 ] . message . content ,
441
+ ) ;
438
442
assert . ok (
439
443
completionSpan . attributes [ `${ SpanAttributes . LLM_USAGE_TOTAL_TOKENS } ` ] ,
440
444
) ;
You can’t perform that action at this time.
0 commit comments