Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion App/kernel-memory/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ItemGroup>
<PackageVersion Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.2" />
<PackageVersion Include="AWSSDK.S3" Version="3.7.310.4" />
<PackageVersion Include="Azure.AI.DocumentIntelligence" Version="1.0.0-beta.2" />
<PackageVersion Include="Azure.AI.DocumentIntelligence" Version="1.0.0" />
<PackageVersion Include="Azure.AI.FormRecognizer" Version="4.1.0" />
<PackageVersion Include="Azure.Core" Version="1.42.0" />
<PackageVersion Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.3.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ public async Task<FileContent> DecodeAsync(string filename, CancellationToken ca

public async Task<FileContent> 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()
Expand All @@ -49,7 +52,7 @@ public async Task<FileContent> DecodeAsync(BinaryData data, CancellationToken ca
this._client = new DocumentIntelligenceClient(new Uri(this._endpoint), new AzureKeyCredential(this._apiKey), options);

Operation<AnalyzeResult> 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;

Expand Down