[AutoPR azure-ai-contentsafety]-generated-from-SDK Generation - Python-6834987 - #49005
azure-sdk-automation[bot] wants to merge 8 commits into
Conversation
…fig.yaml', API Version: 2026-09-01-preview, SDK Release Type: beta, and CommitSHA: 'e7d422ec1d105f2871caca4940636098ef6ab580' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6834987 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release.
|
Azure Pipelines: Successfully started running 1 pipeline(s). 9 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🟡 Changes recommended
Release metadata, request typing, changelog content, and runnable coverage remain incomplete.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Regenerates azure-ai-contentsafety for the 2026-09-01-preview API and prepares the 1.1.0b1 beta release.
Changes:
- Adds provenance detection, prompt shielding, protected-material detection, and unified moderation APIs.
- Migrates packaging to
pyproject.tomland Python 3.10+. - Adds API metadata, generated samples, and test scaffolding.
File summaries
Base path: sdk/contentsafety/azure-ai-contentsafety/
| File | Description |
|---|---|
tsp-location.yaml |
Updates the specification commit. |
tests/conftest.py |
Formatting-only change. |
setup.py |
Removes legacy packaging configuration. |
sdk_packaging.toml |
Moves packaging settings elsewhere. |
samples/sample_manage_blocklist.py |
Adds pylint suppressions. |
pyproject.toml |
Adds modern build and package metadata. |
MANIFEST.in |
Formatting-only change. |
generated_tests/testpreparer.py |
Adds generated synchronous test helpers. |
generated_tests/testpreparer_async.py |
Adds generated asynchronous test helpers. |
generated_tests/test_content_safety.py |
Adds generated Content Safety tests. |
generated_tests/test_content_safety_async.py |
Adds generated async Content Safety tests. |
generated_tests/test_content_provenance.py |
Adds generated provenance tests. |
generated_tests/test_content_provenance_async.py |
Adds generated async provenance tests. |
generated_tests/test_blocklist.py |
Adds generated blocklist tests. |
generated_tests/test_blocklist_async.py |
Adds generated async blocklist tests. |
generated_tests/conftest.py |
Adds generated sanitizer configuration. |
generated_samples/unified_moderate.py |
Demonstrates unified moderation. |
generated_samples/shield_prompt.py |
Demonstrates prompt shielding. |
generated_samples/remove_blocklist_items.py |
Demonstrates removing blocklist items. |
generated_samples/provenance_get_operation_status.py |
Demonstrates provenance status retrieval. |
generated_samples/provenance_detect.py |
Demonstrates provenance detection. |
generated_samples/list_text_blocklists.py |
Demonstrates listing blocklists. |
generated_samples/list_text_blocklist_items.py |
Demonstrates listing blocklist items. |
generated_samples/get_text_blocklist.py |
Demonstrates retrieving a blocklist. |
generated_samples/get_text_blocklist_item.py |
Demonstrates retrieving a blocklist item. |
generated_samples/detect_text_protected_material.py |
Demonstrates protected-material detection. |
generated_samples/delete_text_blocklist.py |
Demonstrates deleting a blocklist. |
generated_samples/create_or_update_text_blocklist.py |
Demonstrates blocklist creation and updates. |
generated_samples/analyze_text.py |
Demonstrates text analysis. |
generated_samples/analyze_image.py |
Demonstrates image analysis. |
generated_samples/add_or_update_blocklist_items.py |
Demonstrates adding blocklist items. |
CHANGELOG.md |
Adds the beta release entry. |
azure/ai/contentsafety/types.py |
Adds request TypedDict definitions. |
azure/ai/contentsafety/models/_patch.py |
Updates customization scaffolding. |
azure/ai/contentsafety/models/_enums.py |
Adds preview API enums. |
azure/ai/contentsafety/models/__init__.py |
Exports new models and enums. |
azure/ai/contentsafety/aio/_vendor.py |
Removes obsolete async mixin helpers. |
azure/ai/contentsafety/aio/_patch.py |
Updates async customization scaffolding. |
azure/ai/contentsafety/aio/_operations/_patch.py |
Updates async operation customization scaffolding. |
azure/ai/contentsafety/aio/_operations/__init__.py |
Updates internal async operation exports. |
azure/ai/contentsafety/aio/_configuration.py |
Adds preview client configuration. |
azure/ai/contentsafety/aio/_client.py |
Adds asynchronous preview clients. |
azure/ai/contentsafety/aio/__init__.py |
Exports the async provenance client. |
azure/ai/contentsafety/_version.py |
Sets version 1.1.0b1. |
azure/ai/contentsafety/_vendor.py |
Removes obsolete mixin helpers. |
azure/ai/contentsafety/_validation.py |
Adds API-version validation. |
azure/ai/contentsafety/_utils/utils.py |
Adds generic client mixin typing. |
azure/ai/contentsafety/_utils/__init__.py |
Initializes generated utilities. |
azure/ai/contentsafety/_patch.py |
Updates customization scaffolding. |
azure/ai/contentsafety/_operations/_patch.py |
Updates operation customization scaffolding. |
azure/ai/contentsafety/_operations/__init__.py |
Updates internal operation exports. |
azure/ai/contentsafety/_model_base.py |
Removes the legacy model base. |
azure/ai/contentsafety/_configuration.py |
Adds synchronous preview configuration. |
azure/ai/contentsafety/_client.py |
Adds synchronous preview clients. |
azure/ai/contentsafety/__init__.py |
Exports the provenance client. |
apiview-properties.json |
Adds cross-language API mappings. |
api.metadata.yml |
Records API extraction metadata. |
api.md |
Captures the generated public API surface. |
_metadata.json |
Records generation inputs and versions. |
Review details
- Files reviewed: 63/64 changed files
- Comments generated: 5
- Review effort level: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟡 Changes recommended
Release metadata, input typing, changelog completeness, and coverage for the new APIs must be corrected.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (3)
Previously missed (1) — in code that hasn't changed since the last review.
sdk/contentsafety/azure-ai-contentsafety/pyproject.toml:26
- This raises the minimum supported Python version from 3.7 to 3.10, but the new release entry does not disclose that compatibility change. Add a changelog note that Python 3.9 and earlier are no longer supported.
sdk/contentsafety/azure-ai-contentsafety/pyproject.toml:16
- The package version is
1.1.0b1, so publishing it with the Production/Stable classifier gives consumers contradictory release metadata. Use the Beta classifier for this prerelease.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/types.py:207 blocklistItemIdis service-generated and the model marks it read-only and excludes it from the constructor, but this requestTypedDictmakes it mandatory. Static type checking therefore requires callers to provide a value they should not send. Correct the source schema's required/read-only modeling and regenerate this input type without a required ID.
- Files reviewed: 54/55 changed files
- Comments generated: 2
- Review effort level: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
Package metadata and documentation are inconsistent, and the new provenance client lacks test coverage.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (3)
Previously missed (1) — in code that hasn't changed since the last review.
sdk/contentsafety/azure-ai-contentsafety/pyproject.toml:26
- Raising the package minimum to Python 3.10 leaves the public README incorrect:
README.md:21still states that Python 3.7 or later is supported. Update the prerequisite alongside this packaging migration so users on 3.7–3.9 do not install an incompatible release.
sdk/contentsafety/azure-ai-contentsafety/pyproject.toml:16
- The package version is
1.1.0b1, but this classifier publishes it as production/stable. Beta packages in this repository use the Beta classifier (for example,sdk/contentunderstanding/azure-ai-contentunderstanding/pyproject.toml:20), so package indexes will otherwise display contradictory maturity metadata.
sdk/contentsafety/azure-ai-contentsafety/CHANGELOG.md:8 - The release notes omit other public APIs added by this regeneration:
shield_promptanddetect_text_protected_material. Without listing them, consumers cannot discover the full feature delta for 1.1.0b1.
- Added support for Content Provenance Detection operations.
- Added support for Unified Moderate policy evaluation.
- Files reviewed: 55/56 changed files
- Comments generated: 1
- Review effort level: Balanced
This comment has been minimized.
This comment has been minimized.
|
/azp run public - azure-sdk-for-python - ci |
|
No pipelines are associated with this pull request. |
There was a problem hiding this comment.
🟡 Changes recommended
The generated request typing is inconsistent, preview functionality lacks tests, and package/API documentation is incomplete or contradictory.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (4)
Previously missed (2) — in code that hasn't changed since the last review.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_client.py:54
- This API-version contract is inconsistent with the generated behavior: omitted
api_versionbecomes"2026-09-01-preview"in_configuration.py:42, existing tests use"2023-10-01", and operation validation explicitly supports"2024-09-01". Document the actual default and all supported versions here and in the async client so callers are not told valid stable versions are unknown.
sdk/contentsafety/azure-ai-contentsafety/tests/test_case.py:32 - This pins every key-authenticated test client to the old 2023 API, so the new default preview API and the newly added Unified Moderate and Content Provenance paths receive no recorded test coverage. Keep stable-version coverage if needed, but add preview-specific client helpers and tests that exercise the new sync/async operations and LRO result handling.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/types.py:207
blocklistItemIdis marked required in the dictionary request type even though its documentation says the service generates it and the model request constructor excludes this read-only field (models/_models.py:1072,1084-1088). This makes the dict overload require a server-assigned value while the model overload does not. Correct the property visibility/optionality in the source specification and regenerate so request callers can omit it consistently.
sdk/contentsafety/azure-ai-contentsafety/CHANGELOG.md:8- The generated API also adds
shield_promptanddetect_text_protected_material, but this release history lists only Provenance Detection and Unified Moderate. Include those newly exposed operations so consumers can see the complete feature set in the release notes.
- Added support for Content Provenance Detection operations.
- Added support for Unified Moderate policy evaluation.
- Files reviewed: 56/57 changed files
- Comments generated: 1
- Review effort level: Balanced
This comment has been minimized.
This comment has been minimized.
|
/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. |
|
/azp run python - pullrequest |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
[Pilot] PR Pipeline Failure AnalysisWhat failedAzure Pipeline build 6839726 ( Relevant pipeline outputNo actual test failures were reported for this build ( Recommended next steps
|
There was a problem hiding this comment.
🟡 Changes recommended
Request typing and generated samples contain invalid inputs, while the new preview APIs lack coverage and complete release documentation.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (2)
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/types.py:207
blocklistItemIdis service-generated and the model marks it read-only (models/_models.py:1072), but this requestTypedDictrequires callers to provide it. That makes valid inputs containing onlytextfail static type checking and led the generated sample to send a fabricated ID. Remove this read-only field from the request shape (or at least make it non-required) and regenerate the dependent API artifacts/sample.
sdk/contentsafety/azure-ai-contentsafety/CHANGELOG.md:8- The release notes omit other user-visible changes in this PR:
shield_promptanddetect_text_protected_material, the default API-version change from2023-10-01to2026-09-01-preview, and the minimum Python increase from 3.7 to 3.10. Document these so consumers can assess compatibility before installing the beta.
### Features Added
- Added support for Content Provenance Detection operations.
- Added support for Unified Moderate policy evaluation.
- Files reviewed: 58/59 changed files
- Comments generated: 4
- Review effort level: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
Preview coverage, API consistency, release notes, and package-index fallback handling have unresolved issues.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (2)
sdk/contentsafety/azure-ai-contentsafety/tests/test_case.py:32
- Pinning every existing client fixture to
2023-10-01means the suite never exercises the new default preview API or the newly added Content Provenance and Unified Moderate paths. Keep the stable-version coverage, but add preview/default-version tests for the new operations so regressions in this release are detectable.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/types.py:206 blocklistItemIdis marked required even though the documentation says the service generates it and the model version marks it read-only. Because thisTypedDictis accepted as request input, type checkers force dictionary callers to provide a server-generated ID while model callers cannot provide one. Correct the TypeSpec visibility/optionality and regenerate so the two request forms agree.
- Files reviewed: 58/59 changed files
- Comments generated: 3
- Review effort level: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
Preview-version gating, APIView consistency, regex coverage, and an invalid generated sample need correction.
Get a fresh assessment by requesting another Copilot review.
Review details
- Files reviewed: 60/61 changed files
- Comments generated: 5
- Review effort level: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
Valid-JSON HTTP failures from public PyPI bypass the new configured-index fallback.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
scripts/breaking_changes_checker/detect_breaking_changes.py:888
- A public-index HTTP failure can still bypass this fallback.
PyPIClient._pypi_json_request(eng/tools/azure-sdk-tools/pypi_tools/pypi.py:57-65) never checksresponse.status; a 5xx response with a valid JSON error body reachesget_ordered_versions, raisesKeyErrorfor the missingreleasesfield, and is handled below as “no relevant version” instead of retrying the configured index. Validate HTTP status inPyPIClient(while preserving the intended 404 semantics) and add a valid-JSON 5xx regression test.
- Files reviewed: 60/61 changed files
- Comments generated: 0 new
- Review effort level: Balanced
Configurations: 'specification/cognitiveservices/ContentSafety/tspconfig.yaml', API Version: 2026-09-01-preview, SDK Release Type: beta, and CommitSHA: 'e7d422ec1d105f2871caca4940636098ef6ab580' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6834987 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. Release plan link: https://azsdk-releaseplan-dashboard-hveph5aqhhcfhtgu.westus-01.azurewebsites.net/?releaseplan=36522 Submitted by: huliang@microsoft.com
Shared breaking-checker scope
This PR intentionally updates the repository-wide breaking-change checker because the SDK CI environment configures a curated Azure Artifacts index that can omit versions already released on public PyPI. Version resolution remains public-PyPI-first and falls back to the configured index only when the public request fails at the transport or response-decoding boundary. The expanded behavior is package-independent and is covered by focused tests for transport failure, malformed JSON/proxy responses, and preserving the original public-index error when the fallback has no usable version.