Skip to content

Commit 8590922

Browse files
Merge pull request #290 from graemefoster/feature/ga-for-document-intelligence
fix: Updated to GA of Document Intelligence - beta does not work against all Azure regions
2 parents c9d3be8 + 46898c1 commit 8590922

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

App/kernel-memory/Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<ItemGroup>
66
<PackageVersion Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.2" />
77
<PackageVersion Include="AWSSDK.S3" Version="3.7.310.4" />
8-
<PackageVersion Include="Azure.AI.DocumentIntelligence" Version="1.0.0-beta.2" />
8+
<PackageVersion Include="Azure.AI.DocumentIntelligence" Version="1.0.0" />
99
<PackageVersion Include="Azure.AI.FormRecognizer" Version="4.1.0" />
1010
<PackageVersion Include="Azure.Core" Version="1.42.0" />
1111
<PackageVersion Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.3.1" />

App/kernel-memory/service/Core/DataFormats/Pdf/PdfMarkdownDecoder.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ public async Task<FileContent> DecodeAsync(string filename, CancellationToken ca
3838

3939
public async Task<FileContent> DecodeAsync(BinaryData data, CancellationToken cancellationToken = default)
4040
{
41-
var content = new AnalyzeDocumentContent() { Base64Source = data };
41+
var analyzeDocumentOptions = new AnalyzeDocumentOptions("prebuilt-layout", data)
42+
{
43+
OutputContentFormat = DocumentContentFormat.Markdown
44+
};
4245

4346
//this invocation should be blocking during process
4447
DocumentIntelligenceClientOptions options = new()
@@ -49,7 +52,7 @@ public async Task<FileContent> DecodeAsync(BinaryData data, CancellationToken ca
4952
this._client = new DocumentIntelligenceClient(new Uri(this._endpoint), new AzureKeyCredential(this._apiKey), options);
5053

5154
Operation<AnalyzeResult> operation = null;
52-
operation = await this._client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", content, outputContentFormat: ContentFormat.Markdown, cancellationToken: cancellationToken).ConfigureAwait(false);
55+
operation = await this._client.AnalyzeDocumentAsync(WaitUntil.Completed, analyzeDocumentOptions, cancellationToken).ConfigureAwait(false);
5356

5457
AnalyzeResult result = operation.Value;
5558

0 commit comments

Comments
 (0)