VISEOIberia.AI.Document 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package VISEOIberia.AI.Document --version 1.0.0
                    
NuGet\Install-Package VISEOIberia.AI.Document -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="VISEOIberia.AI.Document" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="VISEOIberia.AI.Document" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="VISEOIberia.AI.Document" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add VISEOIberia.AI.Document --version 1.0.0
                    
#r "nuget: VISEOIberia.AI.Document, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package VISEOIberia.AI.Document@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=VISEOIberia.AI.Document&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=VISEOIberia.AI.Document&version=1.0.0
                    
Install as a Cake Tool

VISEOIberia.AI.Document

This package allows you to analyze documents page by page using Azure OpenAI. For each page, it extracts textual content and generates semantic descriptions of any images, effectively combining OCR capabilities with multimodal AI. Ideal for intelligent document processing pipelines, it transforms scanned or image-based documents into structured, enriched data using the power of Azure OpenAI models.

Dependency Injection


var builder = WebApplication.CreateBuilder(args);

var documentAnalyzerOptions = new DocumentAnalyzerOptions() 
{
    Identifier = "my-application",
    AzureOpenAI = new AzureOpenAIOptions() 
    {
        Endpoint = "https://your-azure-openai-endpoint.openai.azure.com",
        Key = "your-azure-openai-key",
        Model = "gpt-4o",
        Temperature = 0.2f,
        MaxOutputTokens = 1000
    },
    Prompt = new PromptOptions()
    {
        System = @"
You are an assistant. 
Your only task is to act as an advanced OCR for documents.
You must not interpret, translate, summarize, or add any additional information.",
        Action = @"
This is an image of a page from a document. 
Your task is to extract all visible content exactly as it appears, preserving the original order and flow. 
You must preserve the original language of the document. 
Do not translate, interpret, or summarize any content.
- Extract all text like an OCR, line by line, in the same reading order.
- If there is a logo, replace it with a simple description.
- If there is an embedded image or illustration, replace it with a detailed description.
- If there is a chart, replace it with a detailed description of the chart.
- If there is a table, replace it with a Markdown-formatted table at the same position, and add a brief description in brackets below it.
- If there is a diagram (flowchart, Gantt, ER, class, etc.), insert it at that point as Mermaid code and add a brief description in brackets below."
    }
};

builder.Services.AddDocumentAnalyzer(documentAnalyzerOptions);

Usage

public class MyService
{
    private IDocumentAnalyzer _documentAnalyzer;

    public MyService(IDocumentAnalyzer documentAnalyzer)
    {
        _documentAnalyzer = documentAnalyzer;
    }
    
    public async Task MyMethod()
    {
        var file = new File() 
        {
            Name = "document",
            Extension = "pdf",
            Stream = new MemoryStream(File.ReadAllBytes("path/to/your/document.pdf"))
        };
        
        var analysis = await _document.Analyzer.AnalyzeAsync(file);    
    }
}

Response

{
  "Title": "Lorem ipsum",
  "Pages": [
    {
      "Number": 1,
      "Content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
      "Status": "Success",
      "Costs": {
        "InputTokens": 150,
        "OutputTokens": 120
      }
    },
    {
      "Number": 2,
      "Content": "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
      "Status": "Success",
      "Costs": {
        "InputTokens": 200,
        "OutputTokens": 180
      }
    },
    {
      "Number": 3,
      "Content": "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
      "Status": "Success",
      "Costs": {
        "InputTokens": 200,
        "OutputTokens": 180
      }
    }
  ]
}
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.7 512 7/22/2025
1.1.6 95 7/18/2025
1.1.5 103 7/12/2025
1.1.4 151 7/9/2025
1.1.3 145 7/3/2025
1.1.2 133 6/26/2025
1.1.1 132 6/26/2025
1.1.0 144 6/25/2025
1.0.7 157 6/25/2025
1.0.6 150 6/24/2025
1.0.5 145 6/24/2025
1.0.4 145 6/23/2025
1.0.3 154 6/17/2025
1.0.2 151 5/29/2025
1.0.1 146 5/29/2025
1.0.0 151 5/29/2025