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 {
126126 this . span . setAttributes ( {
127127 [ `${ SpanAttributes . LLM_COMPLETIONS } .${ index } .finish_reason` ] :
128128 completion . finish_reason ,
129- [ `${ SpanAttributes . LLM_COMPLETIONS } .${ index } .message. role` ] :
129+ [ `${ SpanAttributes . LLM_COMPLETIONS } .${ index } .role` ] :
130130 completion . message . role ,
131- [ `${ SpanAttributes . LLM_COMPLETIONS } .${ index } .message. content` ] :
131+ [ `${ SpanAttributes . LLM_COMPLETIONS } .${ index } .content` ] :
132132 completion . message . content || "" ,
133133 } ) ;
134134 } ) ;
Original file line number Diff line number Diff line change @@ -435,6 +435,10 @@ describe("Test SDK Decorators", () => {
435435 completionSpan . attributes [ `${ SpanAttributes . LLM_PROMPTS } .0.content` ] ,
436436 "Tell me a joke about OpenTelemetry" ,
437437 ) ;
438+ assert . strictEqual (
439+ completionSpan . attributes [ `${ SpanAttributes . LLM_COMPLETIONS } .0.content` ] ,
440+ result . choices [ 0 ] . message . content ,
441+ ) ;
438442 assert . ok (
439443 completionSpan . attributes [ `${ SpanAttributes . LLM_USAGE_TOTAL_TOKENS } ` ] ,
440444 ) ;
You can’t perform that action at this time.
0 commit comments