-
Notifications
You must be signed in to change notification settings - Fork 737
telemetry(amazonq chat): numberOfCodeBlocks #4761
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
Conversation
dogusata
left a comment
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.
Please replace the code block calculation method with ui endstream method return.
packages/core/src/codewhispererChat/controllers/chat/messenger/messenger.ts
Outdated
Show resolved
Hide resolved
| // Count the number of <pre> tags in the HTML to find the total number of code blocks | ||
| const totalNumberOfCodeBlocks = (html.match(/<pre>/g) || []).length |
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.
This is not specific enough - it could match unrelated <pre> tags.
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.
My suggestion would be jsdom and the method querySelectorAll with a query of pre > code to find all code blocks
Problem
recordAddMessageis missing the required parametercwsprChatResponseCodeSnippetCountfor AB testing.Solution
TODO:
This is a temporary solution (until backend response contains the number of code blocks with the last chunk), revert this change once backend is ready and use data from the backend.
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.