File tree 1 file changed +16
-5
lines changed
js/packages/openinference-vercel/src
1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -247,12 +247,23 @@ const getInputMessageAttributes = (promptMessages?: AttributeValue) => {
247
247
...acc ,
248
248
...message ,
249
249
[ `${ MESSAGE_PREFIX } .${ SemanticConventions . MESSAGE_ROLE } ` ] : message . role ,
250
- [ `${ MESSAGE_PREFIX } .${ SemanticConventions . TOOL_CALL_ID } ` ] :
251
- typeof message . toolCallId === "string"
252
- ? message . toolCallId
250
+ [ `${ MESSAGE_PREFIX } .${ SemanticConventions . MESSAGE_TOOL_CALL_ID } ` ] :
251
+ Array . isArray ( message . content )
252
+ ? typeof message . content [ 0 ] ?. toolCallId === "string"
253
+ ? message . content [ 0 ] . toolCallId
254
+ : undefined
255
+ : typeof message . toolCallId === "string"
256
+ ? message . toolCallId
257
+ : undefined ,
258
+ [ `${ MESSAGE_PREFIX } .${ SemanticConventions . TOOL_NAME } ` ] : Array . isArray (
259
+ message . content ,
260
+ )
261
+ ? typeof message . content [ 0 ] ?. toolName === "string"
262
+ ? message . content [ 0 ] . toolName
263
+ : undefined
264
+ : typeof message . toolName === "string"
265
+ ? message . toolName
253
266
: undefined ,
254
- [ `${ MESSAGE_PREFIX } .${ SemanticConventions . TOOL_NAME } ` ] :
255
- typeof message . toolName === "string" ? message . toolName : undefined ,
256
267
[ `${ MESSAGE_PREFIX } .${ SemanticConventions . MESSAGE_CONTENT } ` ] :
257
268
Array . isArray ( message . content )
258
269
? typeof message . content [ 0 ] ?. result === "string"
You can’t perform that action at this time.
0 commit comments