Skip to content

Commit 24acb88

Browse files
authored
Merge pull request #2 from DevExpress-Examples/web-api-update-readme
update readme
2 parents f6f0e36 + 4d7d991 commit 24acb88

File tree

1 file changed

+26
-17
lines changed

1 file changed

+26
-17
lines changed

README.md

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,49 @@
11
<!-- default badges list -->
2-
![](https://img.shields.io/endpoint?url=https://codecentral.devexpress.com/api/v1/VersionRange/794940392/25.2.3%2B)
32
[![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/T1231021)
43
[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)
54
[![](https://img.shields.io/badge/💬_Leave_Feedback-feecdd?style=flat-square)](#does-this-example-address-your-development-requirementsobjectives)
65
<!-- default badges end -->
7-
# Office File API – Integrate AI
6+
# Office File API – Integrate DevExpress AI-powered Extensions
87

9-
The following project integrates AI capabilities into a DevExpress-powered Office File API Web API application. This project uses the following AI services:
10-
* OpenAI API generates descriptions for images, charts and hyperlinks in Microsoft Word and Excel files.
11-
* Azure AI Language API detects the language for text paragraphs in Word files.
12-
* Azure AI Translator API translates paragraph text to the chosen language in Word files.
8+
This project integrates AI capabilities into a Web application that handles user documents. DevExpress Office File API and DevExpress AI-powered Extensions work together to implement the following functionality:
9+
10+
* Generate descriptions for images, charts, and hyperlinks in office files (Word and Excel).
11+
* Summarize, translate, and proofread office files (Word, PDF, and PowerPoint).
1312

1413
> [!note]
15-
> Before you incorporate this solution in your app, please be sure to read and understand terms and conditions of using AI services.
14+
> DevExpress does not offer a REST API or ship any built-in LLMs/SLMs. Instead, we follow the BYOL ("bring your own license") principle. To use these features, you need to have an active subscription to AI services (e.g., Azure, Open AI, Google Gemini, Mistral AI, etc.) and obtain the REST API endpoint, key, and model deployment name. These variables must be specified at runtime to enable DevExpress AI-powered Extensions in your application.
1615
1716
## Implementation Details
1817

19-
The project uses the [Azure.AI.OpenAI](https://www.nuget.org/packages/Azure.AI.OpenAI/), [Azure.AI.TextAnalytics](https://www.nuget.org/packages/Azure.AI.TextAnalytics) and [Azure.AI.Translation.Text](https://www.nuget.org/packages/Azure.AI.Translation.Text) NuGet packages. Azure.AI.OpenAI adapts OpenAI's REST APIs for use in non-Azure OpenAI development. Azure.AI.TextAnalytics and Azure.AI.Translation.Text require an Azure subscription. Once you obtain it, create a [Language resource](https://learn.microsoft.com/en-us/azure/ai-services/language-service/language-detection/quickstart?tabs=windows&pivots=programming-language-csharp#create-an-azure-resource) and a [Translator resource](https://learn.microsoft.com/en-us/azure/ai-services/translator/create-translator-resource) (or a single [multi-service resource](https://learn.microsoft.com/en-us/azure/ai-services/multi-service-resource?tabs=windows&pivots=azportal)) in the Azure portal to get your keys and endpoints for client authentication.
18+
DevExpress AI-powered extensions run inside an [AIExtensionsContainerDefault](https://docs.devexpress.com/CoreLibraries/DevExpress.AIIntegration.AIExtensionsContainerDefault) container that manages registered AI clients.
19+
20+
The [IChatClient](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.ai.ichatclient) interface serves as the central mechanism for language model interaction. The `AddDevExpressAIConsole` method registers a chat client in the application.
21+
22+
23+
The [RegisterAIDocProcessingService(AIExtensionsContainerSettings)](https://docs.devexpress.com/OfficeFileAPI/DevExpress.AIIntegration.Docs.AIDocProcessingExtensions.RegisterAIDocProcessingService(DevExpress.AIIntegration.AIExtensionsContainerSettings)) method registers document-processing AI extensions in a dependency injection container.
24+
25+
The table below lists controllers that use DevExpress AI-powered extensions and corresponding registration methods.
2026

21-
`OpenAIController` includes endpoints to generate image, chart and hyperlink descriptions. The `OpenAIClientImageHelper` class sends a request to describe an image and obtains a string with a response. The `OpenAIClientHyperlinkHelper` class sends a request to describe an hyperlink and obtains a string with a response. The `OpenAIClientImageHelper.DescribeImageAsync` and `OpenAIClientHyperlinkHelper.DescribeHyperlinkAsync` methods are executed within the corresponding endpoints.
22-
For Excel files, charts are converted to images to obtain relevant descriptions.
27+
| Controller | Description | API |
28+
|--|----|--|
29+
| `AccessibilityController` | Endpoints that generate image, chart, and hyperlink and descriptions.<br/> In Excel files, charts are converted to images to obtain relevant descriptions. | [GenerateImageDescriptionAsync](https://docs.devexpress.com/CoreLibraries/DevExpress.AIIntegration.AIIntegration.GenerateImageDescriptionAsync(IAIExtensionsContainer--GenerateImageDescriptionRequest--CancellationToken))<br/>[CustomPromptAsync](https://docs.devexpress.com/CoreLibraries/DevExpress.AIIntegration.AIIntegration.CustomPromptAsync(IAIExtensionsContainer--CustomPromptRequest--CancellationToken)) |
30+
| `SummarizeController` | Endpoints that produce a concise summary for an entire document/presentation or selected parts (slides, pages, sections). | [SummarizeAsync](https://docs.devexpress.com/OfficeFileAPI/DevExpress.AIIntegration.Docs.IAIDocProcessingService.SummarizeAsync.overloads) |
31+
| `ProofreadController` | Endpoints that review grammar, spelling, and style in an entire document/presentation or selected parts (slides, pages, sections). | [ProofreadAsync](https://docs.devexpress.com/OfficeFileAPI/DevExpress.AIIntegration.Docs.IAIDocProcessingService.ProofreadAsync.overloads) |
32+
| `TranslateController` | Endpoints that translate a document/presentation or its selected parts (slides, pages, sections). | [TranslateAsync](https://docs.devexpress.com/OfficeFileAPI/DevExpress.AIIntegration.Docs.IAIDocProcessingService.TranslateAsync.overloads) |
2333

24-
`LanguageController` includes the endpoint to detect the language for text paragraphs and generate paragraph transaltions. The `AzureAILanguageHelper` class sends a request to detect the language of the specified text and returns the language name in the "ISO 693-1" format. The `AzureAITranslationHelper` class sends a request to translate the given text to the specified language and returns the transaled text string. The `AzureAILanguageHelper.DetectTextLanguage` and `AzureAITranslationHelper.TranslateText` methods are executed in the `GenerateLanguageSettingsForParagraphs` endpoint.
2534

2635
## Files to Review
2736

28-
* [OpenAIController.cs](./CS/Controllers/OpenAIController.cs)
29-
* [LanguageController.cs](./CS/Controllers/LanguageController.cs)
30-
* [OpenAIClientImageHelper.cs](./CS/BusinessObjects/OpenAIClientImageHelper.cs)
31-
* [OpenAIClientHyperlinkHelper.cs](./CS/BusinessObjects/OpenAIClientHyperlinkHelper.cs)
32-
* [AzureAILanguageHelper.cs](./CS/BusinessObjects/AzureAILanguageHelper.cs)
33-
* [AzureAITranslationHelper.cs](./CS/BusinessObjects/AzureAITranslationHelper.cs)
37+
* [Program.cs](./CS/Program.cs)
38+
* [AccessibilityController.cs](./CS/Controllers/AccessibilityController.cs)
39+
* [SummarizeController.cs](./CS/Controllers/SummarizeController.cs)
40+
* [ProofreadController.cs](./CS/Controllers/ProofreadController.cs)
41+
* [TranslateController.cs](./CS/Controllers/TranslateController.cs)
3442
* [Helpers.cs](./CS/BusinessObjects/Helpers.cs)
3543

3644
## Documentation
3745

46+
* [AI-powered Extensions for DevExpress Office File API](https://docs.devexpress.com/OfficeFileAPI/405645/ai-powered-extensions)
3847
* [Office File API — Enhance Accessibility in Office Documents (Word & Excel) using OpenAI Models](https://community.devexpress.com/blogs/office/archive/2024/05/08/enhance-accessibility-in-office-documents-word-and-excel-using-artificial-intelligence-system.aspx)
3948
* [Office File API — Enhance Accessibility in Office Documents using OpenAI Models (Part 2)](https://community.devexpress.com/blogs/office/archive/2024/06/03/office-file-api-enhance-accessibility-in-office-documents-word-amp-excel-using-openai-models-part-2.aspx)
4049
<!-- feedback -->

0 commit comments

Comments
 (0)