### Install DoclingSharp via NuGet Source: https://github.com/stevekoeniger/doclingsharp/blob/master/README.md Installs the DoclingSharp library into your .NET project using the NuGet package manager. Ensure you have .NET 8+ and access to the NuGet feed. ```bash dotnet add package DoclingSharp ``` -------------------------------- ### Manual DoclingClient and DocumentChunker Initialization Source: https://github.com/stevekoeniger/doclingsharp/blob/master/README.md Provides an example of manually initializing DoclingClient and DocumentChunker instances with explicit options and an HttpClientFactory. This approach is useful for scenarios where automatic DI is not preferred or available. ```csharp var options = new DoclingOptions { DoclingAddress = new Uri("http://localhost:5001"), ChunkMaxCharacters = 2048, ChunkCharacterOverlap = 128 }; var httpClientFactory = ...; // get via DI or manually var doclingClient = new DoclingClient(httpClientFactory, Options.Create(options)); var doclingClient = new DoclingClient(httpClientFactory, Options.Create(options)); var documentChunker = new DocumentChunker(options); var file = File.OpenRead("example.pdf"); var result = await doclingClient.ExtractDocumentContentAsync(file); var chunks = doclingClient.ChunkDocument(result.Markdown); ``` -------------------------------- ### Configure DoclingSharp Services in .NET Source: https://github.com/stevekoeniger/doclingsharp/blob/master/README.md Configures the DoclingSharp services, including DoclingClient and DocumentChunker, by registering them with the .NET dependency injection container. This setup requires specifying the Docling API address and chunking parameters. ```csharp builder.Services.AddDocling(c => { c.DoclingAddress = new Uri("http://localhost:5001"); c.ChunkMaxCharacters = 2048; c.ChunkCharacterOverlap = 128; }); ``` -------------------------------- ### Extract Document Content with DoclingClient Source: https://github.com/stevekoeniger/doclingsharp/blob/master/README.md Demonstrates how to use the DoclingClient to extract content from an uploaded IFormFile. The extracted content, including Markdown, is then processed further. ```csharp // Extract content from an uploaded IFormFile var result = await _doclingClient.ExtractDocumentContentAsync(file); // Split the content into chunks for embedding or further processing var documentChunks = _documentChunker.ChunkDocument(result.Markdown); // Pass the chunks to your embedding engine ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.