Skip to main content
All docs
V25.1
  • MessageSentEventArgs.Files Property

    Returns a collection of uploaded files.

    Namespace: DevExpress.AIIntegration.Blazor.Chat

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

    NuGet Package: DevExpress.AIIntegration.Blazor.Chat

    Declaration

    public List<AIChatUploadFileInfo> Files { get; }

    Property Value

    Type Description
    List<AIChatUploadFileInfo>

    The collection of uploaded files.

    Remarks

    Use the Files argument property to access files attached to the currently processsed message.

    <DxAIChat MessageSent="MessageSent"
              FileUploadEnabled="true" />
    
    @code {
        async Task MessageSent(MessageSentEventArgs args) {
            if(args.Files != null && args.Files.Count > 0) {
                var fileNames = args.Files.Select(x => x.Name);
                var response = $"Processed message content: {args.Content}.{System.Environment.NewLine}";
                response += $"The message contains {args.Files.Count} attached file(s):{System.Environment.NewLine}";
                response += string.Join(System.Environment.NewLine, fileNames);
                await args.Chat.SendMessage(response, ChatRole.Assistant);
            }
        }
    }
    

    Run Demo: AI Chat - Manual Message Processing

    See Also