Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
be4d761
Configurations: 'specification/ai/ContentUnderstanding/tspconfig.yam…
azure-sdk Dec 3, 2025
876170a
Merge remote-tracking branch 'origin/main' into sdkauto/azure-ai-cont…
yungshinlintw Dec 4, 2025
c8df6ad
SDK-GEN: Re-generate SDK based on commmit e11e268a65224bd90f3aa450d44…
yungshinlintw Dec 4, 2025
72993cc
Add sample tests for configuring defaults and analyzing binary docume…
Dec 4, 2025
e34b5f8
[ContentUnderstanding] Add Java samples (Sample00-Sample04) converted…
Dec 5, 2025
a9bd363
[ContentUnderstanding] Add Sample05 and Sample06
Dec 5, 2025
2d284fb
[ContentUnderstanding] Add Sample07 and Sample08
Dec 5, 2025
d180a18
[ContentUnderstanding] Fix Sample08 update conflict issue
Dec 5, 2025
3495c1f
[ContentUnderstanding] Add Sample09_DeleteAnalyzer
Dec 5, 2025
5be60e5
[ContentUnderstanding] Fix Sample09 and remove incompatible Sample10-16
Dec 5, 2025
fc4a36b
Add Sample10_AnalyzeConfigs and Sample11_AnalyzeReturnRawJson
Dec 5, 2025
a101b28
Add Sample12_GetResultFile and Sample13_DeleteResult
Dec 5, 2025
cbdc2ad
Add Sample14_CopyAnalyzer, Sample15_GrantCopyAuth, and Sample16_Creat…
Dec 5, 2025
92711c7
Refactor Content Understanding Samples to Use Updated Environment Var…
Dec 5, 2025
984b4df
Update Content Understanding Samples to Use DefaultAzureCredential fo…
Dec 8, 2025
24a9ff7
Update analyzer copy endpoint to use simplified path and expand expec…
Dec 8, 2025
5fefcc3
Enhance verification steps in Sample14_CopyAnalyzer to ensure accurat…
Dec 9, 2025
651ce86
Refactor Content Understanding Samples to Support API Key and Default…
Dec 10, 2025
aad4f2e
Refactor Content Understanding Samples to Use Single Line for Client …
Dec 10, 2025
9dd7d8a
Add samples for content understanding SDK
Dec 11, 2025
fedf711
Update assets.json to include specific tag for content understanding SDK
Dec 12, 2025
dd8ebf3
Update sample file paths and add new sample documents for content und…
Dec 12, 2025
8467d24
Disable JaCoCo coverage and Checkstyle for beta.1 - tests under devel…
Dec 12, 2025
420cb89
Fix JaCoCo coverage values: use 0 instead of 0.00
Dec 12, 2025
e2af7aa
Add UPCA and UPCE barcode terms to spelling dictionary
Dec 12, 2025
451a119
Enable Record/Playback test mode for Sample tests
Dec 17, 2025
bea9203
Fix surefire include pattern to only match generated/Sample*.java
Dec 17, 2025
61fc2a3
Fix double-slash issue in test recordings for Content Understanding
Dec 17, 2025
7b55d95
Fix double-slash issue in test recordings: update assets.json to new …
Dec 17, 2025
760866c
Strip trailing slash from endpoint to prevent double-slash in URLs
Dec 17, 2025
12b2364
Merge branch 'main' of https://github.com/azure-sdk/azure-sdk-for-jav…
Jan 6, 2026
1c490eb
Customize Content Understanding Java SDK to match .NET SDK patterns
Jan 8, 2026
022040a
Update tests/samples to use convenience methods (getValue, getFieldOr…
Jan 8, 2026
2279e7f
Fix Sample03 InvoiceDate type casting - DateField returns LocalDate n…
Jan 8, 2026
1433066
Fix CopyAnalyzer API issues and add test recordings
Jan 8, 2026
9cf932e
Update README.md with comprehensive documentation
Jan 9, 2026
3e586c8
Add cspell.json with custom words for spell checking
Jan 9, 2026
316b6e9
Add azure-ai-contentunderstanding to version_client.txt
Jan 9, 2026
45f30f2
Add customization to fix copyAnalyzer API path
Jan 9, 2026
f9369bc
Remove incompatible generated samples and tests
Jan 9, 2026
7155b72
Stop hiding beginAnalyze methods to fix sample compilation
Jan 9, 2026
1ce5028
Use ClientLogger for exception throwing to fix checkstyle linting errors
Jan 9, 2026
50b979b
TEST: Add test resource creation files and also tests.yml for CI
yungshinlintw Jan 12, 2026
1512c2e
Address PR review feedback for azure-ai-contentunderstanding SDK
changjian-wang Jan 12, 2026
c10fdf5
Merge branch 'sdkauto/azure-ai-contentunderstanding-5634426' of https…
Jan 12, 2026
a171886
Add sample test for updating default configuration in Content Underst…
changjian-wang Jan 12, 2026
c26e48d
Update assets.json to match renamed Sample00_UpdateDefaults test
Jan 12, 2026
fd183d3
README: Fix incorrect reference
yungshinlintw Jan 12, 2026
99305b6
Address PR review comments: use environment variables for model deplo…
Jan 12, 2026
a313f62
Update README.md with model deployment environment variables
Jan 12, 2026
355133d
Fix CI linting errors: update convenience methods to return typed obj…
Jan 12, 2026
31790c3
Update test recordings for Sample00, Sample08, Sample14
Jan 12, 2026
9071184
Update Sample12 to use getResultFile convenience method instead of ge…
Jan 16, 2026
fc3c0c5
Update Sample15 to use grantCopyAuthorization convenience method inst…
Jan 16, 2026
3327a1a
Fix Step 3 comment to show correct beginCopyAnalyzer convenience meth…
Jan 16, 2026
a5b42b9
Address PR review comments and standardize environment variables
Jan 16, 2026
cbe3663
README: Update sample running instructions
yungshinlintw Jan 22, 2026
742d729
README: Update sample running instruction
yungshinlintw Jan 22, 2026
39e9e16
Refactor sample code to use environment variables for endpoint config…
yungshinlintw Jan 22, 2026
420e707
CI: Update pom.xml version
yungshinlintw Jan 22, 2026
13edc5e
SAMPLE: Update invoice sample
yungshinlintw Jan 22, 2026
7471695
CI: Fix cspell issue
yungshinlintw Jan 22, 2026
917ac66
README: Update sample instruction
yungshinlintw Jan 22, 2026
914bc3c
SAMPLE: Simplify CreateAnalyzer sample
yungshinlintw Jan 22, 2026
03eaccc
SAMPLE: Refactor analyzer creation in samples for improved readabilit…
yungshinlintw Jan 22, 2026
9d328fd
CI: UPdatecseppl.json for compiler instructions in README
yungshinlintw Jan 22, 2026
d5dafec
SAMPLE: Clean up messages
yungshinlintw Jan 23, 2026
83b1f65
SAMPLE/TEST: Generated unused generated tests
yungshinlintw Jan 23, 2026
b9f5c4a
SDK-GEN: Update with latest commit for TypeSpec to address copyAnalyz…
yungshinlintw Jan 23, 2026
c3c2dc7
TEST: Upload recording
yungshinlintw Jan 23, 2026
3e35e3b
SAMPLE: Update environment variable names in GrantCopyAuth sample for…
yungshinlintw Jan 23, 2026
0f2d991
SDK-CUSTOMIZATION: Introduce simplified beginAnalyze methods in Conte…
yungshinlintw Jan 23, 2026
432099a
TEST: Update recording in assets.json to reflect new tag version for …
yungshinlintw Jan 23, 2026
dd5891a
Refactor content understanding samples and tests for classifier creat…
Jan 23, 2026
c7b2771
Merge branch 'sdkauto/azure-ai-contentunderstanding-5634426' of https…
Jan 23, 2026
ff01c09
Refactor assertions in sample tests to use static imports for improve…
Jan 23, 2026
d6e4a08
Add async samples for deleting analysis results, copying analyzers, g…
Jan 23, 2026
1887270
Refactor sample tests to remove async suffix from method names and up…
wangchangjian1130 Jan 23, 2026
2be9c6c
Update classifier creation samples to include 'true' for enableSegmen…
wangchangjian1130 Jan 23, 2026
6d69aa2
Add retry mechanism for getResultFile in Sample12 tests and samples
wangchangjian1130 Jan 23, 2026
e8e24dc
Update asset tag in assets.json to reflect latest version
wangchangjian1130 Jan 23, 2026
d8f204f
Update assets.json tag and modify training data SAS URL handling in a…
wangchangjian1130 Jan 23, 2026
f459825
AGENT: Add agents for compiling CU SDK in place , run samples, and ru…
yungshinlintw Jan 26, 2026
d3bae81
SAMPLE: Update async sample to use reactive pattern. Add a create-cu-…
yungshinlintw Jan 26, 2026
b9385b6
SAMPLE: Fix CI issue
yungshinlintw Jan 27, 2026
7f006a6
SAMPLE: Fix CI issue in skill md file
yungshinlintw Jan 27, 2026
4e96ff4
Refactor samples to use reactive pattern for polling results
Jan 27, 2026
7c331a6
Update assets.json with new session recordings tag
Jan 27, 2026
aef157d
Update assets.json with Sample16 labeled training data recordings
Jan 27, 2026
cf0f7e2
Add SDK skills for recording and playback testing
Jan 27, 2026
eb41383
Add SDK skills for recording and playback testing
Jan 27, 2026
4e2285f
Refactor README and SKILL.md files to streamline content and remove o…
Jan 27, 2026
7d9e2a0
SAMPLE: Update Sample 02 to run video/audio/image too
yungshinlintw Jan 27, 2026
0cf7bf3
SKILL: Add sample quality review skill
yungshinlintw Jan 27, 2026
6b4d455
CI: Fix CI issues
yungshinlintw Jan 27, 2026
6879383
CUSTOMIZATION: Update TypeSpec commit id and generate beginAnalyze[B…
yungshinlintw Jan 30, 2026
b2e11c0
Merge branch 'main' into sdkauto/azure-ai-contentunderstanding-5634426
yungshinlintw Jan 30, 2026
d6968ee
Add assertions and BEGIN/END markers to Sample00_UpdateDefaults tests
Jan 30, 2026
7a4ed28
Merge branch 'sdkauto/azure-ai-contentunderstanding-5634426' of https…
Jan 30, 2026
5a361b1
Update test recordings for Sample tests
Jan 30, 2026
f29e243
Update README.md to include full URLs for skills documentation
wangchangjian1130 Jan 30, 2026
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
1 change: 1 addition & 0 deletions eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ com.azure:azure-ai-agents-persistent;1.0.0-beta.2;1.0.0-beta.3
com.azure:azure-ai-agents;1.0.0-beta.1;1.0.0-beta.2
com.azure:azure-ai-anomalydetector;3.0.0-beta.5;3.0.0-beta.6
com.azure:azure-ai-contentsafety;1.0.17;1.1.0-beta.1
com.azure:azure-ai-contentunderstanding;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-ai-documentintelligence;1.0.7;1.1.0-beta.1
com.azure:azure-ai-documenttranslator;1.0.0-beta.1;1.0.0-beta.2
com.azure:azure-ai-formrecognizer;4.1.13;4.2.0-beta.1
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<module>sdk/containerservicefleet</module>
<module>sdk/containerservicesafeguards</module>
<module>sdk/contentsafety</module>
<module>sdk/contentunderstanding</module>
<module>sdk/core</module>
<module>sdk/core-v2</module>
<module>sdk/cosmos</module>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Azure SDK Agent Skills

This directory contains GitHub Copilot Agent Skills for Azure SDK development. These skills are designed to be **cross-language compatible** and can be adapted for Java, Python, .NET, and JavaScript SDKs.

## 📐 Design Principles

### 1. Progressive Disclosure

```
sdk-{action}[-{qualifier}]
```

| Pattern | Examples |
|---------|----------|
| `sdk-{action}` | `sdk-compile`, `sdk-test`, `sdk-setup-env` |
| `sdk-{action}-{qualifier}` | `sdk-test-record`, `sdk-test-playback` |
| `{lang}-{service}-{action}` | `java-cu-create-async-sample` (language-specific) |

### 3. Directory Structure

Skills should define **what to do**, not **how to do it**:

| Abstraction | Content | Example |
|-------------|---------|---------|
| SKILL.md | Universal description, workflow, checklist | "Compile SDK" |
| scripts/ | Language-specific implementation | `compile.sh` (mvn/pip/dotnet/npm) |

## 📦 Available Skills

### Core SDK Skills

| Skill | Description | Priority |
|-------|-------------|----------|
| [`sdk-setup-env`](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/contentunderstanding/azure-ai-contentunderstanding/.github/skills/sdk-setup-env/) | Load environment variables from .env file | P0 |
| [`sdk-compile`](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/contentunderstanding/azure-ai-contentunderstanding/.github/skills/sdk-compile/) | Compile SDK source code | P0 |
| [`sdk-test-record`](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/contentunderstanding/azure-ai-contentunderstanding/.github/skills/sdk-test-record/) | Run tests in RECORD mode | P0 |
| [`sdk-test-playback`](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/contentunderstanding/azure-ai-contentunderstanding/.github/skills/sdk-test-playback/) | Run tests in PLAYBACK mode | P0 |
| [`sdk-push-recordings`](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/contentunderstanding/azure-ai-contentunderstanding/.github/skills/sdk-push-recordings/) | Push session recordings to assets repo | P1 |
| [`sdk-run-sample`](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/contentunderstanding/azure-ai-contentunderstanding/.github/skills/sdk-run-sample/) | Run a single sample | P1 |
| [`sdk-run-all-samples`](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/contentunderstanding/azure-ai-contentunderstanding/.github/skills/sdk-run-all-samples/) | Run all samples | P2 |

### Workflow Skills

| Skill | Description | Steps |
|-------|-------------|-------|
| [`sdk-workflow-record-push`](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/contentunderstanding/azure-ai-contentunderstanding/.github/skills/sdk-workflow-record-push/) | Complete RECORD and PUSH workflow | setup → compile → record → push → playback |

### Language-Specific Skills

| Skill | Language | Description |
|-------|----------|-------------|
| [`java-cu-create-async-sample`](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/contentunderstanding/azure-ai-contentunderstanding/.github/skills/java-cu-create-async-sample/) | Java | Create async samples with reactive patterns |

## 🚀 Quick Start

### 1. Setup Environment

```bash
# Use sdk-compile skill
.github/skills/sdk-compile/scripts/compile.sh
```

### 3. Run Tests

```bash
# Push to Azure SDK Assets repo
.github/skills/sdk-push-recordings/scripts/push-recordings.sh
```

## 🔧 Language-Specific Commands

| Action | Java | Python | .NET | JavaScript |
|--------|------|--------|------|------------|
| Compile | `mvn compile` | `pip install -e .` | `dotnet build` | `npm run build` |
| Test Record | `mvn test -DAZURE_TEST_MODE=RECORD` | `pytest --azure-test-mode=record` | `dotnet test /p:TestMode=Record` | `npm test -- --test-mode=record` |
| Test Playback | `mvn test -DAZURE_TEST_MODE=PLAYBACK` | `pytest --azure-test-mode=playback` | `dotnet test /p:TestMode=Playback` | `npm test -- --test-mode=playback` |
| Push Recordings | `test-proxy push -a assets.json` | `test-proxy push -a assets.json` | `test-proxy push -a assets.json` | `test-proxy push -a assets.json` |

## 📝 Contributing

When creating new skills:

1. **Follow naming convention**: `sdk-{action}[-{qualifier}]`
2. **Include SKILL.md**: With YAML front matter (name, description)
3. **Keep description under 1024 chars**: Copilot uses it for relevance matching
4. **Single responsibility**: One skill does one thing
5. **Self-contained**: Include all needed scripts/templates
6. **Cross-language when possible**: Language-specific only when necessary
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
---
name: java-cu-create-async-sample
description: |
Creates or updates async samples for Content Understanding SDK with reactive patterns.

This skill helps you:
- Convert sync samples to async versions
- Apply reactive patterns (Mono/Flux, flatMap, doOnNext, subscribe)
- Ensure 100% functionality parity between sync and async
- Report any non-portable code

Trigger phrases: "create async sample", "convert to async", "sync to async", "generate async version"
---

# Java CU Create Async Sample

This skill creates or updates async samples for the Content Understanding SDK, ensuring they use proper reactive patterns and maintain 100% functionality parity with their sync counterparts.

## Workflow

### Step 1: Enumerate Sync Samples

1. List all sync samples in `src/samples/java/com/azure/ai/contentunderstanding/samples/`
2. Filter for files matching pattern: `Sample*.java` (excluding `*Async.java`)
3. For each sync sample, identify the corresponding async sample (if exists):
- Sync: `SampleXX_Name.java`
- Async: `SampleXX_NameAsync.java`

### Step 2: Read Reference Documentation

Before converting, read the async-patterns.md reference document in the `references/` directory for:

- Reactive programming concepts (Mono, Flux, flatMap, doOnNext, subscribe)
- Conversion patterns and examples
- Common pitfalls to avoid

### Step 3: Convert Each Sample

For each sync sample:

1. **Read the sync sample** to understand its functionality
2. **Check if async version exists**:
- If exists: Read and compare with sync version
- If missing: Create new async version
3. **Identify conversion points**:
- Client: `ContentUnderstandingClient` → `ContentUnderstandingAsyncClient`
- Methods: Direct calls → Reactive chains
- Return types: Direct values → `Mono<T>` or `Flux<T>`
- PollerFlux: Use reactive pattern (`.last().flatMap().subscribe()`)
4. **Apply reactive patterns** (see the async-patterns.md reference document):
- Use `flatMap()` for sequential async operations
- Use `doOnNext()` for side effects (printing)
- Use `subscribe()` to start execution
- Add `TimeUnit.sleep()` to prevent premature exit
5. **Verify functionality parity**:
- Same operations in same order
- Same output messages
- Same error handling
- Same helper methods

### Step 4: Report Issues

If something cannot be ported:

1. **Document the issue** clearly
2. **Explain why** it cannot be ported
3. **Ask the user** for guidance if needed

## Conversion Patterns

### Pattern 1: Simple Operations (Mono)

**Sync:**

```java
ContentUnderstandingDefaults defaults = client.getDefaults();
System.out.println("Defaults: " + defaults);
```

**Async:**

```java
client.getDefaults()
.doOnNext(defaults -> System.out.println("Defaults: " + defaults))
.subscribe();
```

### Pattern 2: Sequential Operations

**Sync:**

```java
ContentUnderstandingDefaults current = client.getDefaults();
ContentUnderstandingDefaults updated = client.updateDefaults(map);
ContentUnderstandingDefaults verified = client.getDefaults();
```

**Async:**

```java
client.getDefaults()
.flatMap(current -> client.updateDefaults(map))
.flatMap(updated -> client.getDefaults())
.doOnNext(verified -> System.out.println("Verified: " + verified))
.subscribe();
```

### Pattern 3: PollerFlux Operations

**Sync:**

```java
SyncPoller<Status, Result> poller = client.beginAnalyze(...);
Result result = poller.getFinalResult();
```

**Async:**

```java
PollerFlux<Status, Result> poller = client.beginAnalyze(...);
poller.last()
.flatMap(pollResponse -> {
if (pollResponse.getStatus().isComplete()) {
return pollResponse.getFinalResult();
} else {
return Mono.error(new RuntimeException("Operation failed"));
}
})
.subscribe(result -> {
// Process result
});
```

### Pattern 4: Error Handling

**Sync:**

```java
try {
ContentUnderstandingDefaults defaults = client.getDefaults();
} catch (Exception e) {
System.err.println("Error: " + e.getMessage());
}
```

**Async:**

```java
client.getDefaults()
.doOnError(error -> System.err.println("Error: " + error.getMessage()))
.subscribe(
result -> { /* success */ },
error -> System.exit(1)
);
```

## Naming Conventions

- Sync sample: `SampleXX_Name.java`
- Async sample: `SampleXX_NameAsync.java`
- Package: `com.azure.ai.contentunderstanding.samples`
- Class name matches file name

## Required Imports for Async Samples

```java
import reactor.core.publisher.Mono;
import java.util.concurrent.TimeUnit;
```

## Validation Checklist

Before finalizing an async sample, verify:

- [ ] Uses `ContentUnderstandingAsyncClient` (not sync client)
- [ ] No `.block()` calls (except in retry loops if necessary)
- [ ] Uses reactive chaining (`flatMap`, `then`) for sequential operations
- [ ] Uses `doOnNext()` for side effects (printing)
- [ ] Uses `subscribe()` to start execution
- [ ] Includes `TimeUnit.sleep()` to prevent premature exit
- [ ] Same functionality as sync version (100% parity)
- [ ] Same output messages and formatting
- [ ] Same helper methods (if any)
- [ ] Same error handling behavior
- [ ] Same comments and documentation

## Non-Portable Patterns

Report these as issues:

1. **Blocking operations in loops**: May need special handling
2. **Synchronous file I/O**: May need to wrap in `Mono.fromCallable()`
3. **Thread.sleep()**: Should use `TimeUnit.sleep()` in reactive context
4. **Complex state management**: May need refactoring for reactive patterns

## Questions to Ask

If encountering non-portable code, ask:

1. "How should we handle [specific blocking operation] in the async version?"
2. "Should [specific pattern] be refactored for reactive programming?"
3. "Is [specific functionality] required to be synchronous, or can it be async?"

## Output

After processing all samples, provide:

1. **Summary**: Total sync samples, async samples created/updated
2. **Issues**: List of any non-portable code with explanations
3. **Questions**: Any questions that need user input
Loading
Loading