-
Notifications
You must be signed in to change notification settings - Fork 8
[nodejs] Clean up inputs/outputs for InvokeAgent spans based on new OTel format #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
b4a7717
aa10faf
aa0f134
9ecfd83
a20c19a
7e9dc62
e99a70d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -255,21 +255,27 @@ export class OpenAIAgentsTraceProcessor implements TracingProcessor { | |||||||||||||||||||||
| // Store the complete _input structure as JSON | ||||||||||||||||||||||
| otelSpan.setAttribute( | ||||||||||||||||||||||
| OpenTelemetryConstants.GEN_AI_INPUT_MESSAGES_KEY, | ||||||||||||||||||||||
| JSON.stringify(inputObj) | ||||||||||||||||||||||
| this.buildInputMessages(inputObj) | ||||||||||||||||||||||
| ); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||
| /** | |
| * Builds a JSON-encoded representation of input messages for tracing. | |
| * Extracts the text content of user-role messages when available, otherwise | |
| * falls back to serializing the full input array. | |
| * | |
| * @param arr - Array of message objects containing a role and string content. | |
| * @returns A JSON string of user message contents, or the original array if no valid user content is found. | |
| */ |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable name 'userTexts' is misleading in the context of 'buildOutputMessages'. This variable collects output texts (type 'output_text'), not user texts. Consider renaming to 'outputTexts' for clarity.
Uh oh!
There was an error while loading. Please reload this page.