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 @@ - + 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;