Skip to content

Instantly share code, notes, and snippets.

@cobysy
Created October 17, 2025 20:06
Show Gist options
  • Save cobysy/3ebb85868327808e4a1db54b0756f9f5 to your computer and use it in GitHub Desktop.
Save cobysy/3ebb85868327808e4a1db54b0756f9f5 to your computer and use it in GitHub Desktop.
// see https://learn.microsoft.com/en-us/rest/api/aiservices/document-models/analyze-document-from-stream?view=rest-aiservices-v4.0%20(2024-11-30)&tabs=HTTP
// for parameters
var analyzeDocumentOptions = new AnalyzeDocumentOptions(
"prebuilt-layout",
binaryData)
{
OutputContentFormat = DocumentContentFormat.Markdown
};
var layoutResult = (await this.client.AnalyzeDocumentAsync(
WaitUntil.Completed,
analyzeDocumentOptions)).Value;
var markdown = layoutResult.Content;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment