Skip to main content
All docs
V26.1
  • PromptToExpressionBehavior.Temperature Property

    Gets or sets the balance between creativity and consistency in AI responses. This is a dependency property.

    Namespace: DevExpress.AIIntegration.Wpf

    Assembly: DevExpress.AIIntegration.Wpf.v26.1.dll

    Declaration

    public float? Temperature { get; set; }

    Property Value

    Type Description
    Nullable<Single>

    The balance between creativity (1.0) and consistency (0) in AI responses.

    Remarks

    The Temperature property controls the randomness of the output. The lower the temperature (starting with 0), the more predictably and focused the output is generated; higher temperatures (up to 1) result in more diverse and creative responses.

    Note

    Set the Temperature property to 1 for models (for example, GPT-5, o1, and o3 series) that ignore this parameter to avoid compatibility errors.

    The following example sets the Temperature property to 0.3, so the AI generates more focused and deterministic responses (compared to the default temperature at 0):

    <ThemedWindow xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
                  xmlns:dxai="http://schemas.devexpress.com/winfx/2008/xaml/ai"
                  xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm">
        <dxg:GridControl ItemsSource="{Binding Employees}">
            <dxmvvm:Interaction.Behaviors>
                <dxai:PromptToExpressionBehavior
                    RetryAttemptCount="3"
                    Temperature="0.3"
                    AugmentWithFunctionInfo="True" />
            </dxmvvm:Interaction.Behaviors>
        </dxg:GridControl>
    </ThemedWindow>
    

    Refer the following help topic for additional information: Prompt to Expression.

    See Also