File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
js/packages/openinference-instrumentation-openai/src Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -755,7 +755,7 @@ function getChatCompletionInputMessageAttributes(
755755 ] = toolCall . function . arguments ;
756756 } else {
757757 // TODO: add exhaustive checks
758- diag . debug ( `Unsupported tool type: ${ toolCall . type } ` ) ;
758+ diag . warn ( `Unsupported tool type: ${ toolCall . type } ` ) ;
759759 }
760760 } ) ;
761761 }
@@ -886,7 +886,7 @@ function getChatCompletionOutputMessageAttributes(
886886 ] = toolCall . function . arguments ;
887887 } else {
888888 // TODO: switch to exhaustive checks
889- diag . debug ( `Unsupported tool type: ${ toolCall . type } ` ) ;
889+ diag . warn ( `Unsupported tool type: ${ toolCall . type } ` ) ;
890890 }
891891 } ) ;
892892 }
Original file line number Diff line number Diff line change 11import { SemanticConventions } from "@arizeai/openinference-semantic-conventions" ;
2- import { Attributes } from "@opentelemetry/api" ;
2+ import { Attributes , diag } from "@opentelemetry/api" ;
33import {
44 ResponseCreateParamsBase ,
55 ResponseInputItem ,
@@ -42,8 +42,12 @@ function getResponseItemAttributes(
4242 attributes [ `${ prefix } ${ SemanticConventions . MESSAGE_ROLE } ` ] = "tool" ;
4343 attributes [ `${ prefix } ${ SemanticConventions . MESSAGE_TOOL_CALL_ID } ` ] =
4444 item . call_id ;
45- attributes [ `${ prefix } ${ SemanticConventions . MESSAGE_CONTENT } ` ] =
46- item . output ;
45+ if ( typeof item . output === "string" ) {
46+ attributes [ `${ prefix } ${ SemanticConventions . MESSAGE_CONTENT } ` ] =
47+ item . output ;
48+ } else {
49+ diag . warn ( "Failed to serialize non-string typed tool output" ) ;
50+ }
4751 break ;
4852 }
4953 case "reasoning" : {
You can’t perform that action at this time.
0 commit comments