DxAIChat.InputDelay Property
Specifies the time delay for the BindValueMode.OnDelayedInput mode.
Namespace: DevExpress.AIIntegration.Blazor.Chat
Assembly: DevExpress.AIIntegration.Blazor.Chat.v26.1.dll
Declaration
[Parameter]
public int? InputDelay { get; set; }
Property Value
| Type | Description |
|---|---|
| Nullable<Int32> | A delay in milliseconds. |
Remarks
The DxAIChat component uses an internal buffer to store the message text. This buffer is automatically synchronized with the content of the chat input box. The BindValueMode property specifies when the synchronization happens.
Frequent synchronization may impact AI Chat performance in Interactive WebAssembly or Interactive Auto render modes due to resource-intensive processing (state updates, validation, and so on). If you encounter performance issues, set the BindValueMode to BindValueMode.OnDelayedInput and specify the InputDelay property. The delay reduces the number of updates while a user is typing. The default value of the InputDelay property is 500 ms. Adjust the value depending on your goals:
- Decrease the delay to make the chat more responsive.
- Increase the delay to improve performance on slower devices.
In OnDelayedInput mode, the InputDelay value changes the AI Chat input box behavior as follows:
- If a user starts with an empty input box, the Send button remains disabled until the user types something and then is inactive for the number of milliseconds specified by
InputDelay. - The Send button is disabled if a user clears the input box and is inactive for the number of milliseconds specified by
InputDelay. - If a user clicks Send before the delay elapses, the component sends the previously buffered message. The buffered message may differ from the text currently displayed in the input box.
Important
The chat input box displays typed text immediately, regardless of the InputDelay value.
The following code snippet shows an AI Chat component that updates the internal message text buffer after the user is idle for 1 second (1,000 ms):
<DxAIChat BindValueMode="BindValueMode.OnDelayedInput"
InputDelay="1000" />