Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
c753924
SDK-GEN: Generate SDK with tsp-client on CU GA TypeSpec
yungshinlintw Nov 21, 2025
f826e7e
SDK-FIX: Suppress specific warnings in project file for Azure.AI.Cont…
yungshinlintw Nov 21, 2025
2925453
MIGRATION: Migrate Project related files
yungshinlintw Nov 21, 2025
cc89698
SDK-FIX: Update AnalyzeRequest1 initialization to handle null modelDe…
yungshinlintw Nov 21, 2025
36f29fe
SAMPLE: Migrate Analyze* Samples
yungshinlintw Nov 21, 2025
3d84e07
SAMPLE: Update .gitignore to include sample output directories genera…
yungshinlintw Nov 21, 2025
94fb012
SDK-EXT: ContentField.Value
yungshinlintw Nov 21, 2025
fc447f2
SDK-EXT: Extension methods for ArrayField and ObjectField to enhance …
yungshinlintw Nov 21, 2025
5a3e07a
SDK-EXT: Add extension methods for DocumentContent to retrieve fields…
yungshinlintw Nov 21, 2025
473739e
SDK-FIX: Enhance deserialization logic in ContentAnalyzer and Support…
yungshinlintw Nov 21, 2025
db6724b
SDK-EXT: Add extension methods for ContentUnderstandingClient to upda…
yungshinlintw Nov 21, 2025
9af7c76
SAMPLE: Add new samples for CreateAnalyzer, AnalyzeUrlPrebuiltInvoice…
yungshinlintw Nov 21, 2025
3d8dd78
SDK-FIX: Improve serialization logic in AnalyzeRequest1 and AnalyzeRe…
yungshinlintw Nov 21, 2025
e6b37b3
SDK-FIX: Update deserialization logic in AudioVisualContent to handle…
yungshinlintw Nov 21, 2025
533029c
SDK-EXT: Add OperationExtensions class with GetOperationId method to …
yungshinlintw Nov 21, 2025
b54f662
SAMPLE: Add GetResultFile sample demonstrating how to retrieve keyfra…
yungshinlintw Nov 21, 2025
be5e285
Add comprehensive tests for Azure.AI.ContentUnderstanding
Nov 21, 2025
45aad16
Include shared source file in test project
Nov 21, 2025
d108858
SERVICE-FIX: Allow 201/202 in copy. SDK-FIX: copy request
yungshinlintw Nov 23, 2025
e125b08
SAMPLE: Add new samples for Classifier, AnalyzeBinaryFeatures, Analyz…
yungshinlintw Nov 23, 2025
aa1c560
Merge branch 'yslin/cu_ga_sdk_tsp_client' of https://github.com/Azure…
yungshinlintw Nov 23, 2025
352b31e
SAMPLE-MD: Add AnalyzeBinary.md and also add sample test infra
yungshinlintw Nov 23, 2025
6fb5844
SAMPLE: Add Sample01_AnalyzeBinary demonstrating PDF analysis using p…
yungshinlintw Nov 23, 2025
bb7d68d
SAMPLE: Add Sample02_AnalyzeUrl demonstrating document analysis from …
yungshinlintw Nov 23, 2025
c43e556
SAMPLE: Add Sample00_ConfigureDefaults demonstrating model deployment…
yungshinlintw Nov 23, 2025
97324c9
SDK: Introduce customization for ContentUnderstandingClient to manage…
yungshinlintw Nov 23, 2025
da9e4ac
SAMPLE: Add Sample03_AnalyzeInvoice demonstrating invoice analysis us…
yungshinlintw Nov 23, 2025
f9193fd
SAMPLE: Add Sample04_CreateAnalyzer
yungshinlintw Nov 23, 2025
0942535
SAMPLE: Add multiple new samples for analyzer management and classifi…
yungshinlintw Nov 23, 2025
09ca40e
SAMPLE: Add new samples for analyzing documents and retrieving results
yungshinlintw Nov 24, 2025
f84da89
SAMPLE: Add new samples for deleting analysis results and copying ana…
yungshinlintw Nov 24, 2025
c00719f
SAMPLE: Remove deprecated samples for document analysis and management
yungshinlintw Nov 24, 2025
479980f
SAMPLE: Update appsettings.json.sample and remove outdated UpdateAnal…
yungshinlintw Nov 24, 2025
ec32410
TEST: Add AssemblyInfo and include AzureResourceProviderNamespaceAttr…
yungshinlintw Nov 24, 2025
746c135
SAMPLE-TEST: Remove AnalyzeBinaryTest and enhance Sample01_AnalyzeBin…
yungshinlintw Nov 24, 2025
5c6332b
Enhance tests for Content Understanding SDK
Nov 24, 2025
2887b93
Remove obsolete test helper and update analyzer tests for improved fu…
Nov 24, 2025
653060a
Restore the deleted test csproj, and code cleanup
yungshinlintw Nov 24, 2025
9938246
TEST: Clean up
yungshinlintw Nov 24, 2025
5461273
SAMPLE: Add runnable GrantCopyAuth
yungshinlintw Nov 24, 2025
cf775cf
README: Update Sample README.md
yungshinlintw Nov 24, 2025
ca3cebe
SAMPLE: Delete duplicated samples
yungshinlintw Nov 24, 2025
5c52620
SDK-GEN: Re-generate SDK and add customization for return AnalyzeResu…
yungshinlintw Nov 24, 2025
10cc0f4
SDK-EXT: Address OperationId timing issue
yungshinlintw Nov 24, 2025
e01ac56
SAMPLE: Update samples to use byte arrays directly instead of BinaryD…
yungshinlintw Nov 24, 2025
d195a2d
SDK-EXT: Use BinaryData for AnalyzeBinary
yungshinlintw Nov 25, 2025
aabe91d
SAMPLE: Sample Update to use BinaryData for AnalyzeBinary
yungshinlintw Nov 25, 2025
b919cce
SDK-EXT: Change AnalyzeResultOperation constructor access modifier to…
yungshinlintw Nov 25, 2025
75d2bfd
SDK-EXT: Update AnalyzeResultOperation to expose operation ID via Id …
yungshinlintw Nov 25, 2025
8e94dca
SDK-EXT: Remove redundant XML documentation for the AnalyzeResultOper…
yungshinlintw Nov 25, 2025
8e8032a
SAMPLE: Update samples to use operation ID from Id property instead o…
yungshinlintw Nov 25, 2025
29a35a8
Update Sample Readme (#54129)
chienyuanchang Nov 25, 2025
30c3169
SDK-GEN: Update Content Understanding SDK to reflect changes in model…
yungshinlintw Nov 25, 2025
0ab9b95
SDK-EXT: Remove suppression of AZC0034 warning in Content Understandi…
yungshinlintw Nov 25, 2025
a280d88
SDK-EXT: Add suppression for AZC0034 warnings in Suppression.cs to ha…
yungshinlintw Nov 25, 2025
f118dcc
SDK-GEN: Update Content Understanding SDK to correct SupportedModels …
yungshinlintw Nov 25, 2025
d43bb07
SDK-FIX: Fix known emitters (copyAnalyzer path, result) and serivce i…
yungshinlintw Nov 25, 2025
bb8d80b
SAMPLE: Sample update for ContentCategory renaming
yungshinlintw Nov 25, 2025
0e11caa
TEST: Enable GrantCopyAuth test
yungshinlintw Nov 25, 2025
2fb0ab1
TEST: Migrate recording to test asset repo
yungshinlintw Nov 25, 2025
3e179db
API and README
yungshinlintw Nov 25, 2025
b4a85f9
CI: Fix broken links and remove en-US in the link
yungshinlintw Nov 25, 2025
8965069
CI: Make sure that samples are not packable
yungshinlintw Nov 25, 2025
85a92df
CI: Fix broken link and remove en-US in link
yungshinlintw Nov 25, 2025
b3c6e3a
CI: CHANGELOG: Update version to 1.0.0-beta.1 (Unreleased) and clarif…
yungshinlintw Nov 25, 2025
feff9d9
CI: Update sample documentation links to point to the correct GitHub …
yungshinlintw Nov 25, 2025
9575d74
CI: Update azure-cognitive-services
yungshinlintw Nov 25, 2025
76960a3
CI: Address cspell issue
yungshinlintw Nov 25, 2025
f1138c2
CI: Address cspell.json issue
yungshinlintw Nov 25, 2025
f29bb58
CI: Updaet assets.json
yungshinlintw Nov 25, 2025
27b9561
SAMPLE: Delete dupe line
yungshinlintw Nov 25, 2025
064afdd
SDK-FIX: Re-implement the required CU service workaround and emitter…
yungshinlintw Nov 25, 2025
553b29d
SDK-FIX: Fix CI issues due to blank lines
yungshinlintw Nov 25, 2025
48cbfac
CI: Update for sample code snippets consistency between MD and sample…
yungshinlintw Nov 25, 2025
3965d1b
CI: Fix relative link to MD to be URL
yungshinlintw Nov 25, 2025
c6d405e
Enhance test assertions and logging for Content Understanding SDK sam…
Nov 26, 2025
7ae31e7
Merge remote-tracking branch 'origin/main' into yslin/cu_ga_sdk_tsp_c…
yungshinlintw Nov 26, 2025
6a86545
SDK-GEN: Regenerate SDK after mergeing from main
yungshinlintw Nov 26, 2025
a16a282
use mixed_financial_docs for classifier (#54175)
chienyuanchang Nov 26, 2025
677a712
SAMPLE: Removed snippets not used in MD file
yungshinlintw Nov 26, 2025
a966bde
Update assets.json for Sample05_CreateClassifier test recordings
yungshinlintw Nov 26, 2025
cc2437f
Update assets.json tag to include new Sample05_CreateClassifier recor…
yungshinlintw Nov 26, 2025
6b27c19
SAMPLE: Update classifier test sample file
yungshinlintw Nov 26, 2025
ddcbe32
TEST: Update assets.json tag to reflect latest changes in the Content…
yungshinlintw Nov 26, 2025
18e972d
CI: Update samples to include file path and document URL placeholders…
yungshinlintw Nov 26, 2025
df42a40
CI: Fix MD file link
yungshinlintw Nov 26, 2025
aaadc7d
PR: Remove local editconfig
yungshinlintw Nov 26, 2025
356cbce
Merge branch 'yslin/cu_ga_sdk_tsp_client' of https://github.com/Azure…
Nov 27, 2025
9839e9c
PR: Feedback to add CODEOWNERS and better nuget description
yungshinlintw Nov 27, 2025
60d491c
TEST: Enhance console output for analysis operation verification in S…
Nov 28, 2025
89d8126
PR: Remove runnable samples per PR feedback.
yungshinlintw Nov 28, 2025
ba58a99
PR: Move cspell.yaml from .github/ to CU project
yungshinlintw Nov 29, 2025
f6f4290
CI: Fixed broken md file links
yungshinlintw Nov 29, 2025
37df33a
Merge remote-tracking branch 'origin/changjian-wang/improve_tests_for…
yungshinlintw Nov 29, 2025
c757c16
SAMPLE: Update messages
yungshinlintw Nov 29, 2025
3650d7c
TEST: update assets.json for extended test cases
yungshinlintw Nov 29, 2025
7bcda26
CI: Fix incorrect cspell.json path
yungshinlintw Nov 29, 2025
e48e2ed
TEST: Add client tests
yungshinlintw Nov 29, 2025
12661ba
CI: Fix snippet issue
yungshinlintw Nov 29, 2025
276f9c3
TEST: Fix incorrect media file used in GetResultFile sample test
yungshinlintw Nov 29, 2025
2af7ade
TEST: Extend client test cases
yungshinlintw Nov 29, 2025
05db1d3
SAMPLE: Extend client test cases
yungshinlintw Nov 29, 2025
f6b3cb3
CI: Update sample snippet
yungshinlintw Nov 29, 2025
dd8b75a
CI: Fix incorrect sample test cod
yungshinlintw Nov 29, 2025
70ae5b9
SAMPLE: Remove asserstions in GrantCopyAuth sample
yungshinlintw Dec 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,14 @@
# ServiceLabel: %Cognitive - Face
# ServiceOwners: @dipidoo @longli0 @ShaoAnLin @leareai @Han-msft

# PRLabel: %Cognitive - Content Understanding

Check failure on line 220 in .github/CODEOWNERS

View check run for this annotation

Azure Pipelines / net - codeowners-linter - ci

.github/CODEOWNERS#L220

.github/CODEOWNERS(220,1): error : Error(s) on line 220 Source Line: # PRLabel: %Cognitive - Content Understanding -'Cognitive - Content Understanding' is not a valid label for this repository.
/sdk/contentunderstanding/ @vkurpad, @yungshinlintw, @bojunehsu, @changjian-wang

Check failure on line 221 in .github/CODEOWNERS

View check run for this annotation

Azure Pipelines / net - codeowners-linter - ci

.github/CODEOWNERS#L221

.github/CODEOWNERS(221,1): error : Error(s) on line 221 Source Line: /sdk/contentunderstanding/ @vkurpad, @yungshinlintw, @bojunehsu, @changjian-wang -vkurpad, is an invalid user. Ensure the user exists, is public member of Azure and has write permissions. -yungshinlintw, is an invalid user. Ensure the user exists, is public member of Azure and has write permissions. -bojunehsu, is an invalid user. Ensure the user exists, is public member of Azure and has write permissions.

# PRLabel: %Cognitive - Form Recognizer
/sdk/documentintelligence/ @vkurpad
/sdk/documentintelligence/ @vkurpad, @yungshinlintw, @bojunehsu

Check failure on line 224 in .github/CODEOWNERS

View check run for this annotation

Azure Pipelines / net - codeowners-linter - ci

.github/CODEOWNERS#L224

.github/CODEOWNERS(224,1): error : Error(s) on line 224 Source Line: /sdk/documentintelligence/ @vkurpad, @yungshinlintw, @bojunehsu -vkurpad, is an invalid user. Ensure the user exists, is public member of Azure and has write permissions. -yungshinlintw, is an invalid user. Ensure the user exists, is public member of Azure and has write permissions.

# PRLabel: %Cognitive - Form Recognizer
/sdk/formrecognizer/ @vkurpad
/sdk/formrecognizer/ @vkurpad, @yungshinlintw

# ServiceLabel: %Cognitive - Form Recognizer
# ServiceOwners: @vkurpad
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Local-only files and temporary scripts (not committed to git)
.local_only/

# User-specific configuration files (never commit appsettings.json - they may contain secrets)
**/appsettings.json
!**/appsettings.json.sample

# Sample output directories (generated by sample execution)
**/sample_output/

# Test recordings (SessionRecords) - should not be committed
**/SessionRecords/

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.AI.ContentUnderstanding", "src\Azure.AI.ContentUnderstanding.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{C2E8EBF5-F05A-22ED-9231-040E2E2D8446}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU
{C2E8EBF5-F05A-22ED-9231-040E2E2D8446}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C2E8EBF5-F05A-22ED-9231-040E2E2D8446}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C2E8EBF5-F05A-22ED-9231-040E2E2D8446}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C2E8EBF5-F05A-22ED-9231-040E2E2D8446}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Release History

## 1.0.0-beta.1 (Unreleased)

### Features Added
- Initial release of Azure AI Content Understanding client library for .NET
- Added `ContentUnderstandingClient` for analyzing documents, audio, and video content
- Added `AnalyzeResultOperation` class that extends `Operation<AnalyzeResult>` and provides access to the operation ID via the `Id` property

### Breaking Changes

### Bugs Fixed

### Other Changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
Add any shared properties you want for the projects under this package directory that need to be set before the auto imported Directory.Build.props
-->
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />
</Project>
260 changes: 260 additions & 0 deletions sdk/contentunderstanding/Azure.AI.ContentUnderstanding/README.md

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "net",
"TagPrefix": "net/contentunderstanding/Azure.AI.ContentUnderstanding",
"Tag": "net/contentunderstanding/Azure.AI.ContentUnderstanding_13b81776c9"
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import:
- ../../../.vscode/cspell.json
overrides:
- filename: '**/sdk/contentunderstanding/**/*.cs'
words:
- upca
- upce
- UPCA
- UPCE

Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Configure model deployment defaults

This sample demonstrates how to configure and retrieve default model deployment settings for your Microsoft Foundry resource. This is a **required one-time setup** before using prebuilt analyzers.

## About Model Deployment Configuration

Content Understanding prebuilt analyzers require specific GPT model deployments to function:

- **GPT-4.1** - Used by most prebuilt analyzers (e.g., `prebuilt-invoice`, `prebuilt-receipt`, `prebuilt-idDocument`)
- **GPT-4.1-mini** - Used by RAG analyzers (e.g., `prebuilt-documentSearch`, `prebuilt-audioSearch`, `prebuilt-videoSearch`)
- **text-embedding-3-large** - Used for semantic search and embeddings

This configuration is **per Microsoft Foundry resource** and persists across sessions. You only need to configure it once per Microsoft Foundry resource (or when you change deployment names).

## Prerequisites

To get started you'll need a **Microsoft Foundry resource**. See [README][README] for prerequisites and instructions.

You also need to have deployed the following models in Microsoft Foundry:
- GPT-4.1
- GPT-4.1-mini
- text-embedding-3-large

## Creating a `ContentUnderstandingClient`

The `ContentUnderstandingClient` is the main interface for interacting with the Content Understanding service. In this sample, you'll use the client to:
- Retrieve current model deployment defaults (`GetDefaultsAsync`)
- Update model deployment mappings (`UpdateDefaultsAsync`)

To create a new `ContentUnderstandingClient` you need the endpoint and credentials from your Microsoft Foundry resource. You can authenticate using either `DefaultAzureCredential` (recommended) or an API key.

### Using DefaultAzureCredential (Recommended)

```C# Snippet:CreateContentUnderstandingClient
string endpoint = "<endpoint>";
var credential = new DefaultAzureCredential();
var client = new ContentUnderstandingClient(new Uri(endpoint), credential);
```

### Using API Key

```C# Snippet:CreateContentUnderstandingClientApiKey
string endpoint = "<endpoint>";
string apiKey = "<apiKey>";
var client = new ContentUnderstandingClient(new Uri(endpoint), new AzureKeyCredential(apiKey));
```

> **⚠️ Security Warning**: API key authentication is not secure and is only recommended for testing purposes with test resources. For production, use `DefaultAzureCredential` or other secure authentication methods.

## Configure Model Deployments

Before you can use prebuilt analyzers, you need to map your deployed GPT models to the models required by the prebuilt analyzers:

```C# Snippet:ContentUnderstandingUpdateDefaults
// Map your deployed models to the models required by prebuilt analyzers
var modelDeployments = new Dictionary<string, string>
{
["gpt-4.1"] = "<your-gpt-4.1-deployment-name>",
["gpt-4.1-mini"] = "<your-gpt-4.1-mini-deployment-name>",
["text-embedding-3-large"] = "<your-text-embedding-3-large-deployment-name>"
};

var response = await client.UpdateDefaultsAsync(modelDeployments);
ContentUnderstandingDefaults updatedDefaults = response.Value;

Console.WriteLine("Model deployments configured successfully!");
foreach (var kvp in updatedDefaults.ModelDeployments)
{
Console.WriteLine($" {kvp.Key} → {kvp.Value}");
}
```

## Retrieve Current Defaults

You can retrieve the current default model deployment configuration:

```C# Snippet:ContentUnderstandingGetDefaults
var getResponse = await client.GetDefaultsAsync();
ContentUnderstandingDefaults defaults = getResponse.Value;

Console.WriteLine("Current model deployment mappings:");
if (defaults.ModelDeployments != null && defaults.ModelDeployments.Count > 0)
{
foreach (var kvp in defaults.ModelDeployments)
{
Console.WriteLine($" {kvp.Key} → {kvp.Value}");
}
}
else
{
Console.WriteLine(" No model deployments configured yet.");
}
```

## Next Steps

After configuring model deployments, you can use prebuilt analyzers. See:
- [Sample 01: Analyze a document from binary data][sample01] to analyze PDF files
- [Sample 02: Analyze a document from URL][sample02] to analyze documents from URLs

## Learn More

- [Content Understanding Documentation][cu-docs]
- [Model Deployment Configuration][model-deployment-docs]

[README]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/contentunderstanding/Azure.AI.ContentUnderstanding/README.md
[sample01]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/contentunderstanding/Azure.AI.ContentUnderstanding/samples/Sample01_AnalyzeBinary.md
[sample02]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/contentunderstanding/Azure.AI.ContentUnderstanding/samples/Sample02_AnalyzeUrl.md
[cu-docs]: https://learn.microsoft.com/azure/ai-services/content-understanding/
[model-deployment-docs]: https://learn.microsoft.com/azure/ai-services/content-understanding/quickstart/use-rest-api?tabs=portal%2Cdocument

Loading
Loading