[Content Understanding] Update toLlmInput page markers and filter LLMStats telemetry#49396
Open
chienyuanchang wants to merge 4 commits into
Open
[Content Understanding] Update toLlmInput page markers and filter LLMStats telemetry#49396chienyuanchang wants to merge 4 commits into
chienyuanchang wants to merge 4 commits into
Conversation
3 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates azure-ai-contentunderstanding’s preview LlmInputHelper.toLlmInput() output to match an upcoming service page-marker format and to suppress service-emitted internal telemetry warnings (LLMStats:) from the LLM-facing rai_warnings front matter.
Changes:
- Switched SDK-injected page markers from
<!-- page N -->to<!-- InputPageNumber: N -->. - Added a duplicate-marker guard: if the markdown already contains
<!-- InputPageNumber:, the helper skips injecting markers. - Filtered warnings whose message begins with
LLMStats:(after leading whitespace) so they are not rendered intorai_warnings.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/LlmInputHelper.java | Implements the new InputPageNumber marker format, skips marker injection when markers already exist, and filters LLMStats: warnings from rai_warnings. |
| sdk/contentunderstanding/azure-ai-contentunderstanding/src/test/java/com/azure/ai/contentunderstanding/tests/LlmInputHelperTest.java | Updates existing assertions for the new marker format and adds unit tests covering LLMStats: filtering and duplicate-marker avoidance. |
| sdk/contentunderstanding/azure-ai-contentunderstanding/src/test/java/com/azure/ai/contentunderstanding/tests/samples/Sample_Advanced_ToLlmInputTest.java | Updates sample test assertions and messages to match <!-- InputPageNumber: N -->. |
| sdk/contentunderstanding/azure-ai-contentunderstanding/src/test/java/com/azure/ai/contentunderstanding/tests/samples/Sample_Advanced_ToLlmInputAsyncTest.java | Updates async sample test assertions and messages to match <!-- InputPageNumber: N -->. |
| sdk/contentunderstanding/azure-ai-contentunderstanding/src/samples/java/com/azure/ai/contentunderstanding/samples/Sample_Advanced_ToLlmInput.java | Updates sample comments/documentation to reference the new marker format. |
| sdk/contentunderstanding/azure-ai-contentunderstanding/README.md | Updates the rendered example marker and aligns the dependency snippet version with the module’s current version. |
| sdk/contentunderstanding/azure-ai-contentunderstanding/CHANGELOG.md | Documents the marker format update and the LLMStats: warning filtering under 1.1.0-beta.2 (Unreleased). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Updates the
azure-ai-contentunderstandingLlmInputHelper.toLlmInput()helper to align its rendered output with the upcoming service page-marker format and to remove non-user-facing telemetry from RAI warning output.Changes made:
<!-- page N -->to<!-- InputPageNumber: N -->.<!-- InputPageNumber:,toLlmInput()does not inject additional page markers.LLMStats:from the renderedrai_warningsfront matter.LLMStats:text when it appears in the document markdown body; only structured warnings are filtered.CHANGELOG.md.Relevant issues / context:
LLMStats:filtering: Python: Adopt azure-ai-contentunderstandingto_llm_inputin CU context provider microsoft/agent-framework#5796Companion PRs (sibling SDKs):
This PR is not based on regenerated SDK code from a new swagger / TypeSpec spec.
All SDK Contribution checklist:
LlmInputHelper.toLlmInput()helper.General Guidelines and Best Practices
Testing Guidelines