Back to Devexpress

DxAIChatFileUploadSettings Class

blazor-devexpress-dot-aiintegration-dot-blazor-dot-chat-2584ddba.md

latest4.1 KB
Original Source

DxAIChatFileUploadSettings Class

Contains file upload settings for the DxAIChat component.

Namespace : DevExpress.AIIntegration.Blazor.Chat

Assembly : DevExpress.AIIntegration.Blazor.Chat.v25.2.dll

NuGet Package : DevExpress.AIIntegration.Blazor.Chat

Declaration

csharp
public class DxAIChatFileUploadSettings :
    ComponentBase,
    IDisposable,
    IFileUploadSettings

Remarks

Blazor AI Chat allows users to attach files when sending messages to the chat. Set the DxAIChat.FileUploadEnabled property to true to enable file upload operations.

Once a user attaches files to a message, the AI Chat component validates attached files. To configure validation rules, declare a DxAIChatFileUploadSettings object in AIChatSettings component markup and specify the following properties as needs dictate:

AllowedFileExtensionsSpecifies file extensions the AI Chat component can upload.FileTypeFilterSpecifies MIME types users can select in the Open File dialog.MaxFileCountSpecifies the maximum number of files that users can attach to a message.MaxFileSizeSpecifies the maximum file size in bytes.

If validation fails, the component displays the corresponding error messages:

Run Demo: AI Chat - File Attachments

Note

The DevExpress Blazor AI Chat component only facilitates the file upload. It does not process or analyze the file’s content. The ability to interpret a specific file format depends entirely on the capabilities of the connected AI model.

See the AIChatUploadFileInfo class description for details.

Example

The following code snippet activates the file upload functionality in Blazor AI Chat and configures validation rules for uploaded files:

razor
@using DevExpress.AIIntegration.Blazor.Chat

<DxAIChat CssClass="demo-chat"
          FileUploadEnabled="true">
    <AIChatSettings>
        <DxAIChatFileUploadSettings MaxFileCount="2"
                                    MaxFileSize="20000"
                                    AllowedFileExtensions="@(new List<string> { ".jpg", ".pdf" })"
                                    FileTypeFilter="@(new List<string> { "image/*", "application/pdf"})" />
    </AIChatSettings>
</DxAIChat>

Implements

IComponent

IHandleEvent

IHandleAfterRender

IDisposable

Inheritance

Object ComponentBase DxAIChatFileUploadSettings

See Also

DxAIChatFileUploadSettings Members

DevExpress.AIIntegration.Blazor.Chat Namespace