Skip to main content
All docs
V25.1
  • ProofreadRequest(String) Constructor

    Initializes a new instance of the ProofreadRequest class with specified settings.

    Namespace: DevExpress.AIIntegration.Extensions

    Assembly: DevExpress.AIIntegration.v25.1.dll

    NuGet Package: DevExpress.AIIntegration

    Declaration

    public ProofreadRequest(
        string text
    )

    Parameters

    Name Type Description
    text String

    The text to be managed. This value is assigned to the Text property.

    Remarks

    The following example registers an Azure OpenAI client and uses the AI-powered extension to proofread originalText in a .NET console application:

    using Azure;
    using Azure.AI.OpenAI;
    using Microsoft.Extensions.AI;
    using DevExpress.AIIntegration;
    using DevExpress.AIIntegration.Extensions;
    
    SetEnvironmentVariables();
    
    // Register an Azure OpenAI client
    AIExtensionsContainerDefault defaultAIExtensionsContainer = RegisterAzureOpenAIClient(
        Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT"),
        Environment.GetEnvironmentVariable("AZURE_OPENAI_APIKEY")
    );
    
    string originalText = "DevExpress AI APIs allaw to yuo register and used multiple AI services within WinForms WPF or Blazor aplication.";
    var response = await defaultAIExtensionsContainer.ProofreadAsync(
        new ProofreadRequest(originalText)
    );
    
    Console.WriteLine(response);
    
    /* Output:
     * DevExpress AI APIs allow you to register and use multiple AI services within WinForms, WPF, or Blazor applications.
     */
    
    AIExtensionsContainerDefault RegisterAzureOpenAIClient(string azureOpenAIEndpoint, string azureOpenAIKey) {
        IChatClient client = new Azure.AI.OpenAI.AzureOpenAIClient(new Uri(azureOpenAIEndpoint),
            new System.ClientModel.ApiKeyCredential(azureOpenAIKey)).GetChatClient("gpt-4o-mini").AsIChatClient();
    
        return AIExtensionsContainerConsole.CreateDefaultAIExtensionContainer(client);
    }
    
    void SetEnvironmentVariables() {
        Environment.SetEnvironmentVariable("AZURE_OPENAI_ENDPOINT", {SPECIFY_YOUR_AZURE_ENDPOINT});
        Environment.SetEnvironmentVariable("AZURE_OPENAI_APIKEY", {SPECIFY_YOU_AZURE_KEY});
    }
    
    See Also