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 13 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.
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.

2 participants