File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
packages/core/src/utils/google-genai Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -128,10 +128,15 @@ function extractRequestAttributes(
128128
129129 return attributes ;
130130}
131-
131+ /**
132+ * Add private request attributes to spans.
133+ * This is only recorded if recordInputs is true.
134+ * Handles different parameter formats for different Google GenAI methods.
135+ */
132136function addPrivateRequestAttributes ( span : Span , params : Record < string , unknown > ) : void {
133137 if ( 'contents' in params ) {
134138 const contents = params . contents ;
139+ // For models.generateContent: ContentListUnion: Content | Content[] | PartUnion | PartUnion[]
135140 if ( Array . isArray ( contents ) ) {
136141 const truncatedContents = truncateGenAiMessages ( contents ) ;
137142 span . setAttributes ( { [ GEN_AI_REQUEST_MESSAGES_ATTRIBUTE ] : JSON . stringify ( truncatedContents ) } ) ;
You can’t perform that action at this time.
0 commit comments