The following project integrates AI capabilities into a DevExpress-powered Office File API Web API application. OpenAI API is used to generate descriptions for images, charts and hyperlinks in Microsoft Word and Excel files.
Note
Before you incorporate this solution in your app, please be sure to read and understand OpenAI's license agreement and terms of use.
The project uses the Azure.AI.OpenAI package which adapts OpenAI's REST APIs so it can be used in non-Azure OpenAI development.
The OpenAIClientImageHelper
class sends a request to describe an image and obtain a string with a response. The OpenAIClientHyperlinkHelper
class sends a request to describe an hyperlink and obtain a string with a response. The OpenAIClientImageHelper.DescribeImageAsync
and OpenAIClientHyperlinkHelper.DescribeHyperlinkAsync
methods are executed within corresponding endpoints.
For Excel files, charts are converted to images to obtain a relevant description.