Skip to main content
All docs
V25.1
  • RequestOptions.Context Property

    Gets or sets the context that guides the AI model in generating relevant responses.

    Namespace: DevExpress.AIIntegration.Extensions

    Assembly: DevExpress.AIIntegration.v25.1.dll

    NuGet Package: DevExpress.AIIntegration

    Declaration

    public string Context { get; set; }

    Property Value

    Type Description
    String

    The context.

    Remarks

    The following code snippet uses the AI-powered extension to shorten originalText and obtain the result in English, regardless of the language used in the original text:

    string originalText = "Alice fing an sich zu langweilen; sie saß schon lange...";
    ShortenRequest request = new ShortenRequest(originalText);
    // Specify the context
    request.Options.Context = "Alice's Adventures in Wonderland";
    // Specify additional instructions
    request.Options.PromptAugmentation = "Always translate the result into English.";
    var response = await defaultAIExtensionsContainer.ShortenAsync(request);
    
    See Also