Add projects sdk version to openai user-agent and update assets.json tag and enhance User-Agent header sanitization in tests#44672
Open
howieleung wants to merge 1 commit intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances User-Agent header handling by adding the Azure AI Projects SDK version to the OpenAI client's User-Agent header for better telemetry tracking, and sanitizes the User-Agent header in test recordings to prevent platform-specific variations from causing test failures.
Changes:
- Added SDK version to User-Agent header in OpenAI client requests for telemetry
- Enhanced test recording sanitization to handle User-Agent header variations
- Updated test assets tag to include new test recordings
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py | Imports VERSION constant and appends SDK version to User-Agent header in logging transport |
| sdk/ai/azure-ai-projects/tests/conftest.py | Adds import and sanitizer for User-Agent header to prevent platform-specific test failures |
| sdk/ai/azure-ai-projects/assets.json | Updates test assets tag to reference new recordings with sanitized User-Agent |
…tag and enhance User-Agent header sanitization in tests
6e292bf to
52e71f6
Compare
|
/azp run-ed |
|
Command 'run-ed' is not supported by Azure Pipelines. Supported commands
See additional documentation. |
|
/azp run |
|
Commenter does not have sufficient privileges for PR 44672 in repo Azure/azure-sdk-for-python |
Member
Author
|
/azp run |
|
You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list. |
Member
Author
|
/azp run pullrequest (Build Test job_1_macos311) |
|
No pipelines are associated with this pull request. |
Member
Author
|
/azp run Test job_1_macos311 |
|
No pipelines are associated with this pull request. |
Member
Author
|
/azp run * |
|
No pipelines are associated with this pull request. |
Member
Author
|
/azp run python - pullrequest (Build Test job_1_macos311) |
|
No pipelines are associated with this pull request. |
Member
Author
|
/azp run Build Test job_1_macos311 |
|
No pipelines are associated with this pull request. |
Member
Author
|
/azp run python - pullrequest |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
|
/azp run python - pullrequest |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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
Please add an informative description that covers that changes made by the pull request and link all relevant issues.
If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines