Skip to content

Commit 18e972d

Browse files
committed
CI: Update samples to include file path and document URL placeholders to make sure that they can compile
- Added placeholders for `<document_url>` in Sample04_CreateAnalyzer and Sample06_GetAnalyzer. - Included `<file_path>` placeholders in Sample05_CreateClassifier for binary analysis. - Updated Sample15_GrantCopyAuth to use explicit source and target resource identifiers and API keys. - Enhanced clarity in sample code for better user understanding.
1 parent ddcbe32 commit 18e972d

File tree

12 files changed

+157
-177
lines changed

12 files changed

+157
-177
lines changed

sdk/contentunderstanding/Azure.AI.ContentUnderstanding/samples/Sample04_CreateAnalyzer.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ Console.WriteLine($"Analyzer '{analyzerId}' created successfully!");
128128
After creating the analyzer, you can use it to analyze documents. **In production applications, analyzers are typically created once and reused for multiple document analyses.** They persist in your Content Understanding resource until explicitly deleted.
129129

130130
```C# Snippet:ContentUnderstandingUseCustomAnalyzer
131+
var documentUrl = new Uri("<document_url>");
131132
// Analyze a document using the custom analyzer
132133
var analyzeOperation = await client.AnalyzeAsync(
133134
WaitUntil.Completed,

sdk/contentunderstanding/Azure.AI.ContentUnderstanding/samples/Sample05_CreateClassifier.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ With `EnableSegment = false`, the entire 4-page document will be classified as o
9191

9292
```C# Snippet:ContentUnderstandingAnalyzeCategory
9393
// Analyze a document (EnableSegment=false means entire document is one category)
94+
string filePath = "<file_path>";
95+
byte[] fileBytes = File.ReadAllBytes(filePath);
9496
AnalyzeResultOperation analyzeOperation = await client.AnalyzeBinaryAsync(
9597
WaitUntil.Completed,
9698
analyzerId,
@@ -130,6 +132,8 @@ With `EnableSegment = true`, the analyzer will segment the document and return c
130132

131133
```C# Snippet:ContentUnderstandingAnalyzeCategoryWithSegments
132134
// Analyze a document (EnableSegment=true automatically segments by category)
135+
string filePath = "<file_path>";
136+
byte[] fileBytes = File.ReadAllBytes(filePath);
133137
AnalyzeResultOperation analyzeOperation = await client.AnalyzeBinaryAsync(
134138
WaitUntil.Completed,
135139
analyzerId,

sdk/contentunderstanding/Azure.AI.ContentUnderstanding/samples/Sample06_GetAnalyzer.md

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,16 @@ Console.WriteLine(invoiceAnalyzerJson);
7070
Create a custom analyzer, retrieve its information, and display the full JSON:
7171

7272
```C# Snippet:ContentUnderstandingGetCustomAnalyzer
73-
// First, create a custom analyzer (see Sample 04 for details)
73+
string endpoint = "<endpoint>";
74+
string apiKey = "<apiKey>"; // Set to null to use DefaultAzureCredential
75+
var client = !string.IsNullOrEmpty(apiKey)
76+
? new ContentUnderstandingClient(new Uri(endpoint), new AzureKeyCredential(apiKey))
77+
: new ContentUnderstandingClient(new Uri(endpoint), new DefaultAzureCredential());
78+
79+
// Generate a unique analyzer ID
7480
string analyzerId = $"my_custom_analyzer_{DateTimeOffset.UtcNow.ToUnixTimeSeconds()}";
7581

82+
// Define field schema with custom fields
7683
var fieldSchema = new ContentFieldSchema(
7784
new Dictionary<string, ContentFieldDefinition>
7885
{
@@ -88,11 +95,13 @@ var fieldSchema = new ContentFieldSchema(
8895
Description = "Test schema for GetAnalyzer sample"
8996
};
9097

98+
// Create analyzer configuration
9199
var config = new ContentAnalyzerConfig
92100
{
93101
ReturnDetails = true
94102
};
95103

104+
// Create the custom analyzer
96105
var analyzer = new ContentAnalyzer
97106
{
98107
BaseAnalyzerId = "prebuilt-document",
@@ -108,19 +117,21 @@ await client.CreateAnalyzerAsync(
108117
analyzerId,
109118
analyzer);
110119

111-
// Get information about the custom analyzer
112-
var response = await client.GetAnalyzerAsync(analyzerId);
113-
ContentAnalyzer retrievedAnalyzer = response.Value;
114-
115-
// Display full analyzer JSON
116-
var jsonOptions = new JsonSerializerOptions
120+
try
117121
{
118-
WriteIndented = true,
119-
DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull
120-
};
121-
string analyzerJson = JsonSerializer.Serialize(retrievedAnalyzer, jsonOptions);
122-
Console.WriteLine("Custom Analyzer:");
123-
Console.WriteLine(analyzerJson);
122+
// Get information about the custom analyzer
123+
var response = await client.GetAnalyzerAsync(analyzerId);
124+
ContentAnalyzer retrievedAnalyzer = response.Value;
125+
126+
// Display full analyzer JSON
127+
var jsonOptions = new JsonSerializerOptions
128+
{
129+
WriteIndented = true,
130+
DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull
131+
};
132+
string analyzerJson = JsonSerializer.Serialize(retrievedAnalyzer, jsonOptions);
133+
Console.WriteLine("Custom Analyzer:");
134+
Console.WriteLine(analyzerJson);
124135
```
125136

126137
## Next Steps

sdk/contentunderstanding/Azure.AI.ContentUnderstanding/samples/Sample06_GetAnalyzer/Program.cs

Lines changed: 58 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System;
55
using System.Collections.Generic;
6+
using System.IO;
67
using System.Linq;
78
using System.Text.Json;
89
using System.Threading.Tasks;
@@ -69,94 +70,76 @@ static async Task Main(string[] args)
6970
client = new ContentUnderstandingClient(endpointUri, credential);
7071
}
7172

73+
// === EXTRACTED SNIPPET CODE ===
74+
// Get information about a prebuilt analyzer
75+
var response = await client.GetAnalyzerAsync("prebuilt-documentSearch");
76+
ContentAnalyzer analyzer = response.Value;
77+
// Display full analyzer JSON
7278
var jsonOptions = new JsonSerializerOptions
7379
{
7480
WriteIndented = true,
7581
DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull
7682
};
77-
83+
string analyzerJson = JsonSerializer.Serialize(analyzer, jsonOptions);
84+
Console.WriteLine("Prebuilt-documentSearch Analyzer:");
85+
Console.WriteLine(analyzerJson);
86+
87+
// Get information about prebuilt-invoice analyzer
88+
var invoiceResponse = await client.GetAnalyzerAsync("prebuilt-invoice");
89+
ContentAnalyzer invoiceAnalyzer = invoiceResponse.Value;
90+
string invoiceAnalyzerJson = JsonSerializer.Serialize(invoiceAnalyzer, jsonOptions);
91+
Console.WriteLine("Prebuilt-invoice Analyzer:");
92+
Console.WriteLine(invoiceAnalyzerJson);
93+
Console.WriteLine();
94+
95+
// Create a custom analyzer and get its information
96+
Console.WriteLine("Creating a custom analyzer...");
97+
// Generate a unique analyzer ID
98+
string analyzerId = $"my_custom_analyzer_{DateTimeOffset.UtcNow.ToUnixTimeSeconds()}";
99+
// Define field schema with custom fields
100+
var fieldSchema = new ContentFieldSchema(
101+
new Dictionary<string, ContentFieldDefinition>
102+
{
103+
["company_name"] = new ContentFieldDefinition
104+
{
105+
Type = ContentFieldType.String,
106+
Method = GenerationMethod.Extract,
107+
Description = "Name of the company"
108+
}
109+
})
110+
{
111+
Name = "test_schema",
112+
Description = "Test schema for GetAnalyzer sample"
113+
};
114+
// Create analyzer configuration
115+
var config = new ContentAnalyzerConfig
116+
{
117+
ReturnDetails = true
118+
};
119+
// Create the custom analyzer
120+
var customAnalyzer = new ContentAnalyzer
121+
{
122+
BaseAnalyzerId = "prebuilt-document",
123+
Description = "Test analyzer for GetAnalyzer sample",
124+
Config = config,
125+
FieldSchema = fieldSchema
126+
};
127+
customAnalyzer.Models.Add("completion", "gpt-4.1");
128+
// Create the analyzer
129+
await client.CreateAnalyzerAsync(
130+
WaitUntil.Completed,
131+
analyzerId,
132+
customAnalyzer);
78133
try
79134
{
80-
// Get information about prebuilt-documentSearch analyzer
81-
Console.WriteLine("Getting information about prebuilt-documentSearch analyzer...");
82-
var documentSearchResponse = await client.GetAnalyzerAsync("prebuilt-documentSearch");
83-
ContentAnalyzer documentSearchAnalyzer = documentSearchResponse.Value;
84-
string documentSearchJson = JsonSerializer.Serialize(documentSearchAnalyzer, jsonOptions);
85-
Console.WriteLine("Prebuilt-documentSearch Analyzer:");
86-
Console.WriteLine(documentSearchJson);
87-
Console.WriteLine();
88-
89-
// Get information about prebuilt-invoice analyzer
90-
Console.WriteLine("Getting information about prebuilt-invoice analyzer...");
91-
var invoiceResponse = await client.GetAnalyzerAsync("prebuilt-invoice");
92-
ContentAnalyzer invoiceAnalyzer = invoiceResponse.Value;
93-
string invoiceJson = JsonSerializer.Serialize(invoiceAnalyzer, jsonOptions);
94-
Console.WriteLine("Prebuilt-invoice Analyzer:");
95-
Console.WriteLine(invoiceJson);
96-
Console.WriteLine();
97-
98-
// Create a custom analyzer and get its information
99-
Console.WriteLine("Creating a custom analyzer...");
100-
string analyzerId = $"my_custom_analyzer_{DateTimeOffset.UtcNow.ToUnixTimeSeconds()}";
101-
102-
var fieldSchema = new ContentFieldSchema(
103-
new Dictionary<string, ContentFieldDefinition>
104-
{
105-
["company_name"] = new ContentFieldDefinition
106-
{
107-
Type = ContentFieldType.String,
108-
Method = GenerationMethod.Extract,
109-
Description = "Name of the company"
110-
}
111-
})
112-
{
113-
Name = "test_schema",
114-
Description = "Test schema for GetAnalyzer sample"
115-
};
116-
117-
var config = new ContentAnalyzerConfig
118-
{
119-
ReturnDetails = true
120-
};
121-
122-
var customAnalyzer = new ContentAnalyzer
123-
{
124-
BaseAnalyzerId = "prebuilt-document",
125-
Description = "Test analyzer for GetAnalyzer sample",
126-
Config = config,
127-
FieldSchema = fieldSchema
128-
};
129-
customAnalyzer.Models.Add("completion", "gpt-4.1");
130-
131-
// Create the analyzer
132-
await client.CreateAnalyzerAsync(
133-
WaitUntil.Completed,
134-
analyzerId,
135-
customAnalyzer);
136-
137-
Console.WriteLine($"Custom analyzer '{analyzerId}' created successfully.");
138-
Console.WriteLine();
139-
140135
// Get information about the custom analyzer
141-
Console.WriteLine($"Getting information about custom analyzer '{analyzerId}'...");
142136
var customResponse = await client.GetAnalyzerAsync(analyzerId);
143137
ContentAnalyzer retrievedAnalyzer = customResponse.Value;
138+
// Display full analyzer JSON
144139
string customAnalyzerJson = JsonSerializer.Serialize(retrievedAnalyzer, jsonOptions);
145140
Console.WriteLine("Custom Analyzer:");
146141
Console.WriteLine(customAnalyzerJson);
147-
Console.WriteLine();
148-
149-
// Clean up: delete the analyzer
150-
Console.WriteLine($"Cleaning up: Deleting analyzer '{analyzerId}'...");
151-
await client.DeleteAnalyzerAsync(analyzerId);
152-
Console.WriteLine($"Analyzer '{analyzerId}' deleted successfully.");
153-
}
154-
catch (RequestFailedException ex)
155-
{
156-
Console.Error.WriteLine($"Error: {ex.Message}");
157-
Console.Error.WriteLine($"Status: {ex.Status}");
158-
Console.Error.WriteLine($"Error Code: {ex.ErrorCode}");
159-
Environment.Exit(1);
142+
// === END SNIPPET ===
160143
}
161144
catch (Exception ex)
162145
{

sdk/contentunderstanding/Azure.AI.ContentUnderstanding/samples/Sample06_GetAnalyzer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Sample06_GetAnalyzer
22

33
This sample demonstrates how to retrieve information about analyzers, including prebuilt analyzers and custom analyzers.
4-
For detailed documentation, see [Sample06_GetAnalyzer.md](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/contentunderstanding/Azure.AI.ContentUnderstanding/samples/Sample06_GetAnalyzer.md).
4+
For detailed documentation, see [Sample06_GetAnalyzer.md](../Sample06_GetAnalyzer.md).
55

66
## Prerequisites
77

sdk/contentunderstanding/Azure.AI.ContentUnderstanding/samples/Sample06_GetAnalyzer/Sample06_GetAnalyzer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3+
<IsPackable>false</IsPackable>
34
<OutputType>Exe</OutputType>
45
<TargetFramework>net8.0</TargetFramework>
56
<Nullable>enable</Nullable>
67
<LangVersion>latest</LangVersion>
7-
<IsPackable>false</IsPackable>
88
</PropertyGroup>
99

1010
<ItemGroup>

sdk/contentunderstanding/Azure.AI.ContentUnderstanding/samples/Sample15_GrantCopyAuth.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,35 +53,36 @@ See [Sample 01][sample01] for authentication examples using `DefaultAzureCredent
5353

5454
Create a source analyzer, grant copy authorization, and copy it to a target resource:
5555

56+
> **Note:** This snippet requires `using Azure.Identity;` for `DefaultAzureCredential`.
57+
5658
```C# Snippet:ContentUnderstandingGrantCopyAuth
5759
// Get source endpoint from configuration
5860
// Note: configuration is already loaded in Main method
59-
string sourceEndpoint = configuration["AZURE_CONTENT_UNDERSTANDING_ENDPOINT"] ?? throw new InvalidOperationException("AZURE_CONTENT_UNDERSTANDING_ENDPOINT is required");
60-
string? sourceKey = configuration["AZURE_CONTENT_UNDERSTANDING_KEY"];
61+
string sourceEndpoint = "https://source-resource.services.ai.azure.com/";
62+
string? sourceKey = "optional-source-api-key"; // Set to null to use DefaultAzureCredential
6163
6264
// Create source client
63-
var sourceClientOptions = new ContentUnderstandingClientOptions();
6465
ContentUnderstandingClient sourceClient = !string.IsNullOrEmpty(sourceKey)
65-
? new ContentUnderstandingClient(new Uri(sourceEndpoint), new AzureKeyCredential(sourceKey), sourceClientOptions)
66-
: new ContentUnderstandingClient(new Uri(sourceEndpoint), new DefaultAzureCredential(), sourceClientOptions);
66+
? new ContentUnderstandingClient(new Uri(sourceEndpoint), new AzureKeyCredential(sourceKey))
67+
: new ContentUnderstandingClient(new Uri(sourceEndpoint), new DefaultAzureCredential());
6768

68-
// Generate unique analyzer IDs
69-
string sourceAnalyzerId = $"my_analyzer_source_{DateTimeOffset.UtcNow.ToUnixTimeSeconds()}";
70-
string targetAnalyzerId = $"my_analyzer_target_{DateTimeOffset.UtcNow.ToUnixTimeSeconds()}";
69+
// Source analyzer ID (must already exist in the source resource)
70+
string sourceAnalyzerId = "my_source_analyzer_id_in_the_source_resource";
71+
// Target analyzer ID (will be created during copy)
72+
string targetAnalyzerId = "my_target_analyzer_id_in_the_target_resource";
7173

7274
// Get source and target resource information from configuration
73-
string sourceResourceId = configuration["AZURE_CONTENT_UNDERSTANDING_SOURCE_RESOURCE_ID"] ?? throw new InvalidOperationException("AZURE_CONTENT_UNDERSTANDING_SOURCE_RESOURCE_ID is required");
74-
string sourceRegion = configuration["AZURE_CONTENT_UNDERSTANDING_SOURCE_REGION"] ?? throw new InvalidOperationException("AZURE_CONTENT_UNDERSTANDING_SOURCE_REGION is required");
75-
string targetEndpoint = configuration["AZURE_CONTENT_UNDERSTANDING_TARGET_ENDPOINT"] ?? throw new InvalidOperationException("AZURE_CONTENT_UNDERSTANDING_TARGET_ENDPOINT is required");
76-
string targetResourceId = configuration["AZURE_CONTENT_UNDERSTANDING_TARGET_RESOURCE_ID"] ?? throw new InvalidOperationException("AZURE_CONTENT_UNDERSTANDING_TARGET_RESOURCE_ID is required");
77-
string targetRegion = configuration["AZURE_CONTENT_UNDERSTANDING_TARGET_REGION"] ?? throw new InvalidOperationException("AZURE_CONTENT_UNDERSTANDING_TARGET_REGION is required");
78-
string? targetKey = configuration["AZURE_CONTENT_UNDERSTANDING_TARGET_KEY"];
75+
string sourceResourceId = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{name}";
76+
string sourceRegion = "eastus"; // Replace with actual source region
77+
string targetEndpoint = "https://target-resource.services.ai.azure.com/";
78+
string targetResourceId = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{name}";
79+
string targetRegion = "westus"; // Replace with actual target region
80+
string? targetKey = "optional-target-api-key"; // Set to null to use DefaultAzureCredential
7981
8082
// Create target client
81-
var targetClientOptions = new ContentUnderstandingClientOptions();
8283
ContentUnderstandingClient targetClient = !string.IsNullOrEmpty(targetKey)
83-
? new ContentUnderstandingClient(new Uri(targetEndpoint), new AzureKeyCredential(targetKey), targetClientOptions)
84-
: new ContentUnderstandingClient(new Uri(targetEndpoint), new DefaultAzureCredential(), targetClientOptions);
84+
? new ContentUnderstandingClient(new Uri(targetEndpoint), new AzureKeyCredential(targetKey))
85+
: new ContentUnderstandingClient(new Uri(targetEndpoint), new DefaultAzureCredential());
8586

8687
// Step 1: Create the source analyzer
8788
var sourceConfig = new ContentAnalyzerConfig

sdk/contentunderstanding/Azure.AI.ContentUnderstanding/samples/Sample15_GrantCopyAuth/Program.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ static async Task Main(string[] args)
7575
string sourceEndpoint = configuration["AZURE_CONTENT_UNDERSTANDING_ENDPOINT"] ?? throw new InvalidOperationException("AZURE_CONTENT_UNDERSTANDING_ENDPOINT is required");
7676
string? sourceKey = configuration["AZURE_CONTENT_UNDERSTANDING_KEY"];
7777
// Create source client
78-
var sourceClientOptions = new ContentUnderstandingClientOptions();
7978
ContentUnderstandingClient sourceClient = !string.IsNullOrEmpty(sourceKey)
80-
? new ContentUnderstandingClient(new Uri(sourceEndpoint), new AzureKeyCredential(sourceKey), sourceClientOptions)
81-
: new ContentUnderstandingClient(new Uri(sourceEndpoint), new DefaultAzureCredential(), sourceClientOptions);
82-
// Generate unique analyzer IDs
83-
string sourceAnalyzerId = $"my_analyzer_source_{DateTimeOffset.UtcNow.ToUnixTimeSeconds()}";
84-
string targetAnalyzerId = $"my_analyzer_target_{DateTimeOffset.UtcNow.ToUnixTimeSeconds()}";
79+
? new ContentUnderstandingClient(new Uri(sourceEndpoint), new AzureKeyCredential(sourceKey))
80+
: new ContentUnderstandingClient(new Uri(sourceEndpoint), new DefaultAzureCredential());
81+
// Source analyzer ID (must already exist in the source resource)
82+
string sourceAnalyzerId = "my_source_analyzer_id_in_the_source_resource";
83+
// Target analyzer ID (will be created during copy)
84+
string targetAnalyzerId = "my_target_analyzer_id_in_the_target_resource";
8585
// Get source and target resource information from configuration
8686
string sourceResourceId = configuration["AZURE_CONTENT_UNDERSTANDING_SOURCE_RESOURCE_ID"] ?? throw new InvalidOperationException("AZURE_CONTENT_UNDERSTANDING_SOURCE_RESOURCE_ID is required");
8787
string sourceRegion = configuration["AZURE_CONTENT_UNDERSTANDING_SOURCE_REGION"] ?? throw new InvalidOperationException("AZURE_CONTENT_UNDERSTANDING_SOURCE_REGION is required");
@@ -90,10 +90,9 @@ static async Task Main(string[] args)
9090
string targetRegion = configuration["AZURE_CONTENT_UNDERSTANDING_TARGET_REGION"] ?? throw new InvalidOperationException("AZURE_CONTENT_UNDERSTANDING_TARGET_REGION is required");
9191
string? targetKey = configuration["AZURE_CONTENT_UNDERSTANDING_TARGET_KEY"];
9292
// Create target client
93-
var targetClientOptions = new ContentUnderstandingClientOptions();
9493
ContentUnderstandingClient targetClient = !string.IsNullOrEmpty(targetKey)
95-
? new ContentUnderstandingClient(new Uri(targetEndpoint), new AzureKeyCredential(targetKey), targetClientOptions)
96-
: new ContentUnderstandingClient(new Uri(targetEndpoint), new DefaultAzureCredential(), targetClientOptions);
94+
? new ContentUnderstandingClient(new Uri(targetEndpoint), new AzureKeyCredential(targetKey))
95+
: new ContentUnderstandingClient(new Uri(targetEndpoint), new DefaultAzureCredential());
9796
// Step 1: Create the source analyzer
9897
var sourceConfig = new ContentAnalyzerConfig
9998
{

sdk/contentunderstanding/Azure.AI.ContentUnderstanding/tests/samples/Sample04_CreateAnalyzer.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ await client.CreateAnalyzerAsync(
232232
{
233233
#region Snippet:ContentUnderstandingUseCustomAnalyzer
234234
#if SNIPPET
235+
var documentUrl = new Uri("<document_url>");
235236
// Analyze a document using the custom analyzer
236237
var analyzeOperation = await client.AnalyzeAsync(
237238
WaitUntil.Completed,

sdk/contentunderstanding/Azure.AI.ContentUnderstanding/tests/samples/Sample05_CreateClassifier.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ await client.CreateAnalyzerAsync(
201201
#region Snippet:ContentUnderstandingAnalyzeCategory
202202
#if SNIPPET
203203
// Analyze a document (EnableSegment=false means entire document is one category)
204+
string filePath = "<file_path>";
205+
byte[] fileBytes = File.ReadAllBytes(filePath);
204206
AnalyzeResultOperation analyzeOperation = await client.AnalyzeBinaryAsync(
205207
WaitUntil.Completed,
206208
analyzerId,
@@ -316,6 +318,8 @@ await client.CreateAnalyzerAsync(
316318
#region Snippet:ContentUnderstandingAnalyzeCategoryWithSegments
317319
#if SNIPPET
318320
// Analyze a document (EnableSegment=true automatically segments by category)
321+
string filePath = "<file_path>";
322+
byte[] fileBytes = File.ReadAllBytes(filePath);
319323
AnalyzeResultOperation analyzeOperation = await client.AnalyzeBinaryAsync(
320324
WaitUntil.Completed,
321325
analyzerId,

0 commit comments

Comments
 (0)