From 806e19fe96e592de08e553d1475f1a76f79fdff4 Mon Sep 17 00:00:00 2001 From: Graeme Foster Date: Tue, 1 Apr 2025 16:33:18 +0800 Subject: [PATCH 1/2] Updated to GA of Document Intelligence - preview does not work in all regions --- App/kernel-memory/Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/App/kernel-memory/Directory.Packages.props b/App/kernel-memory/Directory.Packages.props index 78eea99d..e3e39b2b 100644 --- a/App/kernel-memory/Directory.Packages.props +++ b/App/kernel-memory/Directory.Packages.props @@ -5,7 +5,7 @@ - + From 46898c12c100e02e18f2668e9e103ccca211786a Mon Sep 17 00:00:00 2001 From: Graeme Foster Date: Wed, 2 Apr 2025 12:21:43 +0800 Subject: [PATCH 2/2] Changes so container builds --- .../service/Core/DataFormats/Pdf/PdfMarkdownDecoder.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/App/kernel-memory/service/Core/DataFormats/Pdf/PdfMarkdownDecoder.cs b/App/kernel-memory/service/Core/DataFormats/Pdf/PdfMarkdownDecoder.cs index a358d6fa..9e84fcc4 100644 --- a/App/kernel-memory/service/Core/DataFormats/Pdf/PdfMarkdownDecoder.cs +++ b/App/kernel-memory/service/Core/DataFormats/Pdf/PdfMarkdownDecoder.cs @@ -38,7 +38,10 @@ public async Task DecodeAsync(string filename, CancellationToken ca public async Task DecodeAsync(BinaryData data, CancellationToken cancellationToken = default) { - var content = new AnalyzeDocumentContent() { Base64Source = data }; + var analyzeDocumentOptions = new AnalyzeDocumentOptions("prebuilt-layout", data) + { + OutputContentFormat = DocumentContentFormat.Markdown + }; //this invocation should be blocking during process DocumentIntelligenceClientOptions options = new() @@ -49,7 +52,7 @@ public async Task DecodeAsync(BinaryData data, CancellationToken ca this._client = new DocumentIntelligenceClient(new Uri(this._endpoint), new AzureKeyCredential(this._apiKey), options); Operation operation = null; - operation = await this._client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", content, outputContentFormat: ContentFormat.Markdown, cancellationToken: cancellationToken).ConfigureAwait(false); + operation = await this._client.AnalyzeDocumentAsync(WaitUntil.Completed, analyzeDocumentOptions, cancellationToken).ConfigureAwait(false); AnalyzeResult result = operation.Value;