Skip to content
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4a5a604
[SDK changes] Changes for build
chienyuanchang Dec 4, 2025
ea7c52d
add package review
chienyuanchang Dec 4, 2025
4ca401c
add changelog
chienyuanchang Dec 4, 2025
8ff33e4
[SDK changes] Temp fix for keyFrameTimesMs
chienyuanchang Dec 4, 2025
beafb7e
check in samples
chienyuanchang Dec 5, 2025
d502f38
[SDK spec update] update commit sha
chienyuanchang Dec 5, 2025
e63f04f
[SDK-UPDATE] 5877ae086b6090761a921421ec6dc712baf3268b
chienyuanchang Dec 5, 2025
76dd016
[SDK-FIX][SERVICE-FIX] KeyFrameTimesMs
chienyuanchang Dec 5, 2025
223cc07
[SDK-FIX] result.body for analyzer functions
chienyuanchang Dec 5, 2025
fa0e44a
update sample files
chienyuanchang Dec 5, 2025
63fbeda
add gitignore
chienyuanchang Dec 5, 2025
f823bdc
require files for sample generation
chienyuanchang Dec 5, 2025
726d94f
update gitignore
chienyuanchang Dec 5, 2025
3bf554f
[SDK-FIX] null guard fixes for deserializer functions
chienyuanchang Dec 5, 2025
184ec98
get the raw response
chienyuanchang Dec 5, 2025
207638b
[SDK-SPEC] update commit sha
chienyuanchang Dec 6, 2025
a01b485
[SDK-UPDATE] 4af871c7b6129cc1e2537259c9a73789e55c0703
chienyuanchang Dec 6, 2025
62ffa0b
[SDK-FIX][SERVICE-FIX] KeyFrameTimesMs
chienyuanchang Dec 6, 2025
53a1552
rename sample env
chienyuanchang Dec 6, 2025
e28c357
[Sample] use npx dev-tool samples publish -f
chienyuanchang Dec 6, 2025
dab8429
restore pnpm-lock.yaml
chienyuanchang Dec 6, 2025
c8ceba4
add ci.yml
chienyuanchang Dec 8, 2025
3730cff
[SDK-FORMAT] pnpm lint:fix and pnpm format
chienyuanchang Dec 8, 2025
9e827f5
resotre pnpm-lock.yaml
chienyuanchang Dec 8, 2025
19f2e6b
revert keyFrameTimesMs to have independent commit
chienyuanchang Dec 8, 2025
55318b0
[SERVICE-FIX] KeyFrameTimesMs
chienyuanchang Dec 8, 2025
720ba79
move src code to generated
chienyuanchang Dec 9, 2025
93d7ecd
add src
chienyuanchang Dec 9, 2025
665f1cf
[SDK-FIX] needed changes
chienyuanchang Dec 9, 2025
0981234
[SERVICE-FIX] KeyFrameTimesMs
chienyuanchang Dec 9, 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
14 changes: 14 additions & 0 deletions sdk/contentunderstanding/ai-content-understanding-rest/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Sample and test output files (any directory starting with these names)
**/test_output*/
**/test-output*/
**/sample_output*/
**/sample-output*/

# Node / JavaScript
lib/
build/
.parcel-cache/
pnpm-debug.log*

# Local-only scripts/config
.local_only/
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Release History

## 1.0.0-beta.1 (2025-12-04)

### Features Added

Initial release of the @azure-rest/ai-content-understanding package
160 changes: 160 additions & 0 deletions sdk/contentunderstanding/ai-content-understanding-rest/env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# Azure AI Content Understanding Test Configuration
# Copy this file to .env and fill in your actual values

# ============================================================================
# Required Configuration
# ============================================================================

# The endpoint URL of your Microsoft Foundry resource
# Used by all samples
AZURE_CONTENT_UNDERSTANDING_ENDPOINT=https://your-resource.services.ai.azure.com/

# ============================================================================
# Authentication Configuration
# ============================================================================

# Option 1: API Key Authentication
# Uncomment and set your API key if using key-based authentication
# Used by all samples (optional - DefaultAzureCredential will be used if not set)
AZURE_CONTENT_UNDERSTANDING_KEY=

# Option 2: DefaultAzureCredential (Recommended for local development)
# If AZURE_CONTENT_UNDERSTANDING_KEY is not set, the tests will use DefaultAzureCredential
# Set one of the following to enable the corresponding authentication method:

# Use Azure CLI authentication (az login)
# AZURE_TEST_USE_CLI_AUTH=true

# Use Azure PowerShell authentication
# AZURE_TEST_USE_PWSH_AUTH=true

# Use Azure Developer CLI authentication (azd login)
# AZURE_TEST_USE_AZD_AUTH=true

# ============================================================================
# Test Execution Configuration
# ============================================================================

# Enable live test mode (set to true to run tests against real Azure resources)
# Default: false
AZURE_TEST_RUN_LIVE=false

# Skip recording when running live tests (set to true to skip recording)
# Default: false
AZURE_SKIP_LIVE_RECORDING=false

# ============================================================================
# Sanitization Configuration (for test recordings)
# ============================================================================
# These values are used for sanitizing sensitive information in test recordings
# Set these if you want to sanitize specific values in recordings

# CONTENTUNDERSTANDING_SUBSCRIPTION_ID=00000000-0000-0000-0000-000000000000
# CONTENTUNDERSTANDING_TENANT_ID=00000000-0000-0000-0000-000000000000
# CONTENTUNDERSTANDING_CLIENT_ID=00000000-0000-0000-0000-000000000000
# CONTENTUNDERSTANDING_CLIENT_SECRET=your-client-secret

# ============================================================================
# Model Deployment Configuration
# ============================================================================
# Required for prebuilt analyzers:
# - prebuilt-documentSearch, prebuilt-audioSearch, prebuilt-videoSearch require GPT-4.1-mini and text-embedding-3-large
# - prebuilt-invoice, prebuilt-receipt, and others require GPT-4.1 and text-embedding-3-large
# Deploy these models in Microsoft Foundry and specify their deployment names here
# By convention, deployment names typically match the model name
# but you can use any name you chose during deployment
# Learn more: https://learn.microsoft.com/en-us/azure/ai-studio/how-to/deploy-models-openai

# GPT-4.1 deployment (required for prebuilt-invoice, prebuilt-receipt, etc., along with text-embedding-3-large)
GPT_4_1_DEPLOYMENT=your-gpt-4.1-deployment

# GPT-4.1-mini deployment (required for prebuilt-documentSearch, prebuilt-audioSearch, prebuilt-videoSearch)
GPT_4_1_MINI_DEPLOYMENT=your-gpt-4.1-mini-deployment

# Text-embedding-3-large deployment (required for prebuilt-documentSearch, prebuilt-audioSearch, prebuilt-videoSearch)
TEXT_EMBEDDING_3_LARGE_DEPLOYMENT=your-text-embedding-3-large-deployment

# ============================================================================
# Custom Model Training Configuration
# ============================================================================
# These variables are used by create_analyzer_with_labels.py sample

# IMPORTANT: Before running the sample, copy the training files from
# sdk/contentunderstanding/azure-ai-contentunderstanding/samples/sample_files/training_samples/
# into your Azure Blob Storage container

# SAS URL to Azure Blob Storage container containing training files
# Required for create_analyzer_with_labels.py
# Format: https://<storage-account>.blob.core.windows.net/<container>?<sas-token>
# SAS Token Requirements: Must have 'read' and 'list' permissions
# Example: https://mystorageaccount.blob.core.windows.net/training-data?sp=rl&st=2024-01-01T00:00:00Z&se=2024-12-31T23:59:59Z&spr=https&sv=2022-11-02&sr=c&sig=...
CONTENT_UNDERSTANDING_STORAGE_CONTAINER_SAS_URL=

# Optional: Prefix (folder path) to filter blobs within the container
# Use this to organize training files in subdirectories
# If empty, all files in the container will be used
# Example: "training_data/" or "irs_1040_samples/"
# Note: Prefix acts as a folder path filter - only files starting with this path will be included
CONTENT_UNDERSTANDING_STORAGE_PREFIX=

# Optional: Path to a file listing specific blobs to include in training
# If empty, all files in the container (or prefix) will be used
# Example: "filelist.jsonl"
# Format: Each line should contain a blob name relative to the container root
CONTENT_UNDERSTANDING_FILE_LIST_PATH=

# ============================================================================
# Cross-Subscription Copy Configuration
# ============================================================================
# These variables are used by grant_copy_auth.py sample for copying analyzers
# between different Azure subscriptions or regions

# IMPORTANT: Both source and target AI Foundry Resources require
# "Cognitive Services User" role for cross-subscription copy operations.
# Ensure your credentials have this role on both resources.

# Source Azure Resource Manager resource ID (where the analyzer currently exists)
# Required for grant_copy_auth.py
# Format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{name}
# Example: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.CognitiveServices/accounts/my-source-resource
AZURE_CONTENT_UNDERSTANDING_SOURCE_RESOURCE_ID=

# Source Azure region
# Required for grant_copy_auth.py
# Example: "westus3" or "eastus"
AZURE_CONTENT_UNDERSTANDING_SOURCE_REGION=

# Target endpoint for cross-subscription copy
# Required for grant_copy_auth.py
# Format: https://{resource-name}.services.ai.azure.com/
# Example: https://my-target-resource.services.ai.azure.com/
AZURE_CONTENT_UNDERSTANDING_TARGET_ENDPOINT=

# Target Azure Resource Manager resource ID (where you want to copy the analyzer to)
# Required for grant_copy_auth.py
# Format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{name}
# Example: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.CognitiveServices/accounts/my-target-resource
AZURE_CONTENT_UNDERSTANDING_TARGET_RESOURCE_ID=

# Target Azure region
# Required for grant_copy_auth.py
# Example: "swedencentral" or "eastus"
AZURE_CONTENT_UNDERSTANDING_TARGET_REGION=

# Optional: Target API key if different from source
# If not set, DefaultAzureCredential will be used for target as well
AZURE_CONTENT_UNDERSTANDING_TARGET_KEY=

# ============================================================================
# Usage Instructions
# ============================================================================
# 1. Copy this file to .env:
# cp env.sample .env
#
# 2. Edit .env and fill in your actual values
#
# 3. The .env file is automatically loaded by the tests via conftest.py
#
# 4. Make sure .env is in your .gitignore to avoid committing secrets


Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@azure-rest/ai-content-understanding!ErrorResponse:interface": "Azure.Core.Foundations.ErrorResponse",
"@azure-rest/ai-content-understanding!ContentAnalyzerAnalyzeOperationStatus:interface": "ContentUnderstanding.ContentAnalyzerAnalyzeOperationStatus",
"@azure-rest/ai-content-understanding!UsageDetails:interface": "ContentUnderstanding.UsageDetails",
"@azure-rest/ai-content-understanding!CopyAnalyzerRequest:interface": "ClientCustomizations.copyAnalyzer.Request.anonymous",
"@azure-rest/ai-content-understanding!CopyRequest1:interface": "ClientCustomizations.copy.Request.anonymous",
"@azure-rest/ai-content-understanding!ResourceOperationStatusContentAnalyzerContentAnalyzerError:interface": "Azure.Core.ResourceOperationStatus",
"@azure-rest/ai-content-understanding!ContentAnalyzer:interface": "ContentUnderstanding.ContentAnalyzer",
"@azure-rest/ai-content-understanding!ContentAnalyzerConfig:interface": "ContentUnderstanding.ContentAnalyzerConfig",
Expand Down Expand Up @@ -93,7 +93,7 @@
"@azure-rest/ai-content-understanding!ContentUnderstandingClient#deleteResult:member(1)": "ClientCustomizations.ContentUnderstandingClient.deleteResult",
"@azure-rest/ai-content-understanding!ContentUnderstandingClient#deleteAnalyzer:member(1)": "ClientCustomizations.ContentUnderstandingClient.deleteAnalyzer",
"@azure-rest/ai-content-understanding!ContentUnderstandingClient#createAnalyzer:member(1)": "ClientCustomizations.ContentUnderstandingClient.createAnalyzer",
"@azure-rest/ai-content-understanding!ContentUnderstandingClient#copyAnalyzer:member(1)": "ClientCustomizations.ContentUnderstandingClient.copyAnalyzer",
"@azure-rest/ai-content-understanding!ContentUnderstandingClient#copyAnalyzer:member(1)": "ClientCustomizations.ContentUnderstandingClient.copy",
"@azure-rest/ai-content-understanding!ContentUnderstandingClient#analyzeBinary:member(1)": "ClientCustomizations.ContentUnderstandingClient.analyzeBinary",
"@azure-rest/ai-content-understanding!ContentUnderstandingClient#analyze:member(1)": "ClientCustomizations.ContentUnderstandingClient.analyze"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,36 @@
"./api": "./src/api/index.ts",
"./models": "./src/models/index.ts"
},
"dialects": ["esm", "commonjs"],
"esmDialects": ["browser", "react-native"],
"dialects": [
"esm",
"commonjs"
],
"esmDialects": [
"browser",
"react-native"
],
"selfLink": false,
"project": "../../../tsconfig.src.build.json"
},
"type": "module",
"browser": "./dist/browser/index.js",
"react-native": "./dist/react-native/index.js",
"keywords": ["node", "azure", "cloud", "typescript", "browser", "isomorphic"],
"keywords": [
"node",
"azure",
"cloud",
"typescript",
"browser",
"isomorphic"
],
"author": "Microsoft Corporation",
"license": "MIT",
"files": ["dist/", "!dist/**/*.d.*ts.map", "README.md", "LICENSE"],
"files": [
"dist/",
"!dist/**/*.d.*ts.map",
"README.md",
"LICENSE"
],
"sdk-type": "client",
"repository": "github:Azure/azure-sdk-for-js",
"bugs": {
Expand All @@ -39,7 +57,16 @@
"path": "src/api/contentUnderstandingContext.ts",
"prefix": "userAgentInfo"
}
]
],
"sampleConfiguration": {
"skipFolder": false,
"disableDocsMs": true,
"productName": "Azure Content Understanding",
"productSlugs": [
"azure"
],
"apiRefLink": "https://learn.microsoft.com/javascript/api/"
}
},
"dependencies": {
"@azure/core-util": "^1.12.0",
Expand Down Expand Up @@ -88,5 +115,65 @@
"test:node:esm": "dev-tool run test:vitest --esm",
"test": "npm run test:node && npm run test:browser",
"update-snippets": "dev-tool run update-snippets"
}
},
"exports": {
"./package.json": "./package.json",
".": {
"browser": {
"types": "./dist/browser/index.d.ts",
"default": "./dist/browser/index.js"
},
"react-native": {
"types": "./dist/react-native/index.d.ts",
"default": "./dist/react-native/index.js"
},
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
},
"./api": {
"browser": {
"types": "./dist/browser/api/index.d.ts",
"default": "./dist/browser/api/index.js"
},
"react-native": {
"types": "./dist/react-native/api/index.d.ts",
"default": "./dist/react-native/api/index.js"
},
"import": {
"types": "./dist/esm/api/index.d.ts",
"default": "./dist/esm/api/index.js"
},
"require": {
"types": "./dist/commonjs/api/index.d.ts",
"default": "./dist/commonjs/api/index.js"
}
},
"./models": {
"browser": {
"types": "./dist/browser/models/index.d.ts",
"default": "./dist/browser/models/index.js"
},
"react-native": {
"types": "./dist/react-native/models/index.d.ts",
"default": "./dist/react-native/models/index.js"
},
"import": {
"types": "./dist/esm/models/index.d.ts",
"default": "./dist/esm/models/index.js"
},
"require": {
"types": "./dist/commonjs/models/index.d.ts",
"default": "./dist/commonjs/models/index.js"
}
}
},
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"module": "./dist/esm/index.js"
}
Loading