Skip to content

Conversation

@azure-sdk
Copy link
Collaborator

Configurations: 'specification/ai/ContentUnderstanding/tspconfig.yaml', API Version: 2025-11-01, SDK Release Type: beta, and CommitSHA: 'd0cd556bd91d2dda700e983c0d253fa025b324c0' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5634426 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. Release plan link: Submitted by:

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

API Change Check

APIView identified API level changes in this PR and created the following API reviews

com.azure:azure-ai-contentunderstanding

yungshinlintw and others added 24 commits December 4, 2025 05:38
… from .NET SDK

- Sample00_ConfigureDefaults: Demonstrates configuration management (get/update defaults)
- Sample01_AnalyzeBinary: Binary PDF analysis from local file
- Sample02_AnalyzeUrl: Analyze documents from URL
- Sample03_AnalyzeInvoice: Extract structured invoice fields with nested objects and arrays
- Sample04_CreateAnalyzer: Create and use custom analyzer with field schema (Extract/Generate/Classify methods)

Key features:
- All samples use DefaultAzureCredentialBuilder for authentication
- Environment variable based configuration (ENDPOINT)
- Comprehensive JUnit 5 tests with assertions
- GitHub public URLs for test data
- Proper field access patterns with type casting (ContentField, StringField, NumberField, ObjectField, ArrayField)
- All tests passing (6/6 = 100% success rate)

Technical implementation:
- Fixed API differences from C# SDK (ContentSpan, ContentField, 5-parameter beginAnalyze)
- Proper null checking and type casting for all field access
- Detailed validation assertions for all document properties
- Clean resource management with @AfterEach cleanup

Module-info.java formatting cleanup included.
- Sample05_CreateClassifier: Create classifier analyzer with multiple classification fields (document_type, industry, urgency)
- Sample06_GetAnalyzer: Get analyzer information including configuration and field schema

Key features:
- Sample05: Demonstrates classification-only analyzer with 3 classifiers
- Sample06: Shows how to retrieve and inspect analyzer properties including prebuilt analyzers
- Fixed API usage: getAnalyzerId(), getCreatedAt(), getLastModified At() instead of getId(), getCreatedDateTime(), getUpdatedDateTime()
- Comprehensive field schema inspection with all 31 prebuilt-invoice fields
- All tests passing with real Azure service
- Sample07_ListAnalyzers: List and filter all available analyzers (prebuilt and custom)
  * testListAnalyzersAsync: Lists all 134 analyzers (87 prebuilt, 47 custom)
  * testListReadyAnalyzersAsync: Filters for ready analyzers only
- Sample08_UpdateAnalyzer: Update existing analyzer properties
  * Demonstrates updating description, configuration, and field schema
  * Uses @beforeeach to create test analyzer and @AfterEach for cleanup
  * Shows how to add new fields while preserving existing ones

All tests passing with real Azure service
Fixed Sample08_UpdateAnalyzer to avoid 409 conflict error:
- Delete existing analyzer before recreating with updated configuration
- Added note about using updateAnalyzerWithResponse for atomic updates in production
- All 12 tests now passing (Sample00-08 with multiple test methods)

Test results: 12/12 passed (100% success rate)
…iables and Improve Test Patterns

- Updated environment variable names from "ENDPOINT" and "CONTENTUNDERSTANDING_API_KEY" to "CONTENTUNDERSTANDING_ENDPOINT" and "AZURE_CONTENT_UNDERSTANDING_KEY" across multiple sample test files.
- Modified sample tests to load local files instead of using publicly accessible URLs for document analysis.
- Enhanced assertions and logging for better clarity and debugging.
- Improved API usage patterns in tests for creating, copying, and deleting analyzers, including async patterns.
- Added model mappings for analyzers in relevant samples to demonstrate configuration capabilities.
…e validation of source and copied analyzers
… Azure Credential Authentication

- Updated Sample03_AnalyzeInvoice, Sample04_CreateAnalyzer, Sample05_CreateClassifier, Sample06_GetAnalyzer, Sample07_ListAnalyzers, Sample08_UpdateAnalyzer, Sample09_DeleteAnalyzer, Sample10_AnalyzeConfigs, Sample11_AnalyzeReturnRawJson, Sample12_GetResultFile, Sample13_DeleteResult, Sample14_CopyAnalyzer, Sample15_GrantCopyAuth, and Sample16_CreateAnalyzerWithLabels to include logic for initializing the Content Understanding client with either an API key or the Default Azure Credential.
- Added assertions to verify client initialization in each sample.
- Improved code readability and maintainability by consolidating client creation logic.
- Sample12_GetResultFile: Demonstrates how to retrieve keyframe images from video analysis operations.
- Sample13_DeleteResult: Shows how to delete analysis results after they are no longer needed.
- Sample14_CopyAnalyzer: Illustrates how to copy an analyzer within the same resource.
- Sample15_GrantCopyAuth: Demonstrates granting copy authorization for cross-resource analyzer copying.
- Sample16_CreateAnalyzerWithLabels: Shows how to create an analyzer with labeled training data from Azure Blob Storage.
@changjian-wang changjian-wang force-pushed the sdkauto/azure-ai-contentunderstanding-5634426 branch 3 times, most recently from 7bedda6 to e2af7aa Compare December 16, 2025 10:13
- Delete 13 @disabled test files (replaced by Sample tests)
- Modify Sample00-Sample16 to extend ContentUnderstandingClientTestBase
- Add testResourceNamer for reproducible random IDs in PLAYBACK mode
- Remove problematic sanitizers (AZSDK2003, AZSDK2030, AZSDK3423, AZSDK3430, AZSDK3493)
- Configure maven-surefire-plugin to include Sample*.java
- Use AZURE_CONTENT_UNDERSTANDING_ENDPOINT env var (matches .NET naming)
yungshinlintw and others added 30 commits January 23, 2026 05:41
… consistency

- Renamed environment variables to include the prefix CONTENTUNDERSTANDING for clarity and consistency across the sample code.
- Updated related validation messages to reflect the new variable names.
…ntUnderstandingClient and ContentUnderstandingAsyncClient

- Added new overloads for beginAnalyze methods that hide the stringEncoding parameter, aligning with .NET's approach.
- Updated sample code to reflect the new method signatures, enhancing usability and clarity.
- Introduced convenience methods for analyzing inputs with default settings, improving the API's simplicity.
…ion and analysis

- Updated Sample05_CreateClassifier to utilize ContentCategoryDefinition for defining custom categories.
- Enhanced documentation within the sample to clarify the purpose and functionality of classifiers.
- Simplified the creation of ContentAnalyzerConfig and ContentAnalyzer instances using method chaining.
- Added new tests in Sample02_AnalyzeUrl for analyzing video and audio URLs, including assertions for content validation.
- Refactored Sample04_CreateAnalyzer, Sample08_UpdateAnalyzer, and Sample09_DeleteAnalyzer to streamline analyzer creation with method chaining.
- Improved assertions in Sample05_CreateClassifier to validate content categories and analyzer configurations.
…d readability

- Updated assertions in Sample05_CreateClassifier, Sample06_GetAnalyzer, Sample07_ListAnalyzers, Sample08_UpdateAnalyzer, Sample09_DeleteAnalyzer, Sample10_AnalyzeConfigs, Sample11_AnalyzeReturnRawJson, and Sample16_CreateAnalyzerWithLabels to use static imports from `org.junit.jupiter.api.Assertions`.
- Enhanced clarity and consistency across test cases by removing redundant code and improving assertion messages.
- Adjusted Sample16_CreateAnalyzerWithLabels to conditionally use labeled training data based on environment variable.
…ranting copy authorization, and creating analyzers with labeled training data

- Implement Sample13_DeleteResultAsync to demonstrate how to delete analysis results after they are no longer needed.
- Implement Sample14_CopyAnalyzerAsync to show how to copy an analyzer within the same resource.
- Implement Sample15_GrantCopyAuthAsync for cross-resource copying of analyzers with granted authorization.
- Implement Sample16_CreateAnalyzerWithLabelsAsync to create an analyzer with labeled training data from Azure Blob Storage.
…t parameter and add wait for result files in async sample
The Azure Content Understanding service needs extended time after video analysis completes before result files (keyframe images) are available. This commit adds a retry mechanism:
- Tests and samples now retry up to 12 times with 10-second intervals (2 minutes total)
- Replaced @disabled annotation with retry mechanism as requested
- Consistent implementation across sync and async versions
…nalyzer creation samples for consistent test behavior
…async-sample skill to assist async sample creation
- Updated Sample01_AnalyzeBinaryAsync to replace synchronous polling with reactive flatMap.
- Updated Sample02_AnalyzeUrlAsync to utilize reactive chaining for polling results.
- Refactored Sample03_AnalyzeInvoiceAsync to adopt reactive pattern for operation completion.
- Modified Sample04_CreateAnalyzerAsync to implement reactive handling for analyzer creation.
- Changed Sample05_CreateClassifierAsync to use reactive approach for classifier creation.
- Updated Sample08_UpdateAnalyzerAsync to replace sync polling with reactive pattern.
- Refactored Sample09_DeleteAnalyzerAsync to adopt reactive chaining for analyzer deletion.
- Modified Sample10_AnalyzeConfigsAsync to utilize reactive pattern for analysis operation.
- Updated Sample11_AnalyzeReturnRawJsonAsync to implement reactive handling for raw JSON analysis.
- Refactored Sample12_GetResultFileAsync to use reactive pattern for retrieving result file.
- Changed Sample13_DeleteResultAsync to adopt reactive chaining for result deletion.
- Updated Sample14_CopyAnalyzerAsync to implement reactive pattern for copying analyzers.
- Refactored Sample15_GrantCopyAuthAsync to utilize reactive approach for granting copy authorization.
- Modified Sample16_CreateAnalyzerWithLabelsAsync to adopt reactive pattern for creating analyzers with labels.
- Implement `sdk-push-recordings` to push session recordings to Azure SDK Assets repository.
- Create `sdk-run-all-samples` to execute all samples in sequence for validation.
- Introduce `sdk-run-sample` for running individual SDK samples.
- Develop `sdk-setup-env` to load environment variables from `.env` files for Azure SDK development.
- Add `sdk-test-playback` for running tests in PLAYBACK mode using recorded API responses.
- Implement `sdk-test-record` for capturing live API responses during tests in RECORD mode.
- Create `sdk-workflow-record-push` to orchestrate the complete process of recording tests and pushing to the Azure SDK Assets repository.
- Add scripts for running all samples, individual samples, loading environment variables, and executing tests in both RECORD and PLAYBACK modes.
- Implement `sdk-push-recordings` skill to push session recordings to Azure SDK Assets repository.
- Create `sdk-run-all-samples` skill to execute all samples in sequence for validation.
- Introduce `sdk-run-sample` skill to run individual SDK samples for testing and debugging.
- Develop `sdk-setup-env` skill to load environment variables from `.env` files for Azure SDK development.
- Add `sdk-test-playback` skill to run tests in PLAYBACK mode using recorded API responses.
- Implement `sdk-test-record` skill to run tests in RECORD mode to capture live API responses.
- Create `sdk-workflow-record-push` skill to orchestrate the complete process of recording tests and pushing to the Azure SDK Assets repository.
- Add scripts for running all samples, running individual samples, loading environment variables, and executing tests in both RECORD and PLAYBACK modes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants