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

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

    Namespace: DevExpress.AIIntegration.Extensions

    Assembly: DevExpress.AIIntegration.v25.1.dll

    NuGet Package: DevExpress.AIIntegration

    Declaration

    public ExtractiveSummaryRequest(
        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 Text Analytics client and uses the AI-powered extension to generate a summary for originalText:

    using Azure;
    using Azure.AI.TextAnalytics;
    using DevExpress.AIIntegration;
    using DevExpress.AIIntegration.Extensions;
    
    AIExtensionsContainerDefault defaultAIExtensionsContainer;
    
    RegisterTextAnalyticsService(
        Environment.GetEnvironmentVariable("AZURE_TEXT_ANALYTICS_ENDPOINT"),
        Environment.GetEnvironmentVariable("AZURE_TEXT_ANALYTICS_API_KEY")
    );
    
    string originalText = "This must be a long text...";
    var response = await defaultAIExtensionsContainer.ExtractiveSummaryAsync(
        new ExtractiveSummaryRequest(originalText) { Language = "de", MaxSentences = 5 }
    );
    
    Console.WriteLine(response);
    
    void RegisterTextAnalyticsService(string azureTextAnalyticsEndpoint, string azureTextAnalyticsAIKey)
    {
        defaultAIExtensionsContainer = new AIExtensionsContainerDefault();
        var textAnalyticsClient = new TextAnalyticsClient(
            new Uri(azureTextAnalyticsEndpoint),
            new AzureKeyCredential(azureTextAnalyticsAIKey)
        );
        defaultAIExtensionsContainer.RegisterTextAnalyticsAzureAIService(textAnalyticsClient);
    }
    
    See Also