diff --git a/src/Infrastructure/BotSharp.Abstraction/Files/IFileInstructService.cs b/src/Infrastructure/BotSharp.Abstraction/Files/IFileInstructService.cs index e9ccb4ba..f35cdad5 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Files/IFileInstructService.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Files/IFileInstructService.cs @@ -3,11 +3,11 @@ namespace BotSharp.Abstraction.Files; public interface IFileInstructService { #region Image - Task ReadImages(string? provider, string? model, string text, IEnumerable images); + Task ReadImages(string? provider, string? model, string text, IEnumerable images); Task GenerateImage(string? provider, string? model, string text); - Task VaryImage(string? provider, string? model, BotSharpFile image); - Task EditImage(string? provider, string? model, string text, BotSharpFile image); - Task EditImage(string? provider, string? model, string text, BotSharpFile image, BotSharpFile mask); + Task VaryImage(string? provider, string? model, InstructFileModel image); + Task EditImage(string? provider, string? model, string text, InstructFileModel image); + Task EditImage(string? provider, string? model, string text, InstructFileModel image, InstructFileModel mask); #endregion #region Pdf @@ -17,11 +17,11 @@ public interface IFileInstructService /// /// Pdf files /// - Task ReadPdf(string? provider, string? model, string? modelId, string prompt, List files); + Task ReadPdf(string? provider, string? model, string? modelId, string prompt, List files); #endregion #region Audio - Task ReadAudio(string? provider, string? model, BotSharpFile audio); + Task ReadAudio(string? provider, string? model, InstructFileModel audio); #endregion #region Select file diff --git a/src/Infrastructure/BotSharp.Abstraction/Files/IFileStorageService.cs b/src/Infrastructure/BotSharp.Abstraction/Files/IFileStorageService.cs index a3e5a32d..6c98e21a 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Files/IFileStorageService.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Files/IFileStorageService.cs @@ -16,7 +16,6 @@ public interface IFileStorageService string BuildDirectory(params string[] segments); #endregion - #region Conversation /// /// Get the message file screenshots for specific content types, e.g., pdf @@ -37,7 +36,7 @@ public interface IFileStorageService IEnumerable GetMessageFiles(string conversationId, IEnumerable messageIds, string source, IEnumerable? contentTypes = null); string GetMessageFile(string conversationId, string messageId, string source, string index, string fileName); IEnumerable GetMessagesWithFile(string conversationId, IEnumerable messageIds); - bool SaveMessageFiles(string conversationId, string messageId, string source, List files); + bool SaveMessageFiles(string conversationId, string messageId, string source, List files); /// /// Delete files under messages @@ -54,8 +53,9 @@ public interface IFileStorageService #region User string GetUserAvatar(); - bool SaveUserAvatar(BotSharpFile file); + bool SaveUserAvatar(InputFileModel file); #endregion + #region Speech Task SaveSpeechFileAsync(string conversationId, string fileName, BinaryData data); Task RetrieveSpeechFileAsync(string conversationId, string fileName); diff --git a/src/Infrastructure/BotSharp.Abstraction/Files/Models/BotSharpFile.cs b/src/Infrastructure/BotSharp.Abstraction/Files/Models/BotSharpFile.cs index 11a11e46..46cba595 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Files/Models/BotSharpFile.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Files/Models/BotSharpFile.cs @@ -1,7 +1,12 @@ namespace BotSharp.Abstraction.Files.Models; -public class BotSharpFile : FileBase +public class BotSharpFile : FileInfo { - + /// + /// File data, e.g., "data:image/png;base64,aaaaaaaa" + /// + [JsonPropertyName("file_data")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? FileData { get; set; } = string.Empty; } diff --git a/src/Infrastructure/BotSharp.Abstraction/Files/Models/FileBase.cs b/src/Infrastructure/BotSharp.Abstraction/Files/Models/FileBase.cs index 3483921a..f952e7f9 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Files/Models/FileBase.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Files/Models/FileBase.cs @@ -2,20 +2,6 @@ namespace BotSharp.Abstraction.Files.Models; public class FileBase { - /// - /// External file url - /// - [JsonPropertyName("file_url")] - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? FileUrl { get; set; } = string.Empty; - - /// - /// Internal file storage url - /// - [JsonPropertyName("file_storage_url")] - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? FileStorageUrl { get; set; } = string.Empty; - /// /// File name without extension /// @@ -29,18 +15,4 @@ public class FileBase [JsonPropertyName("file_data")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? FileData { get; set; } = string.Empty; - - /// - /// File content type - /// - [JsonPropertyName("content_type")] - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? ContentType { get; set; } = string.Empty; - - /// - /// File extension without dot - /// - [JsonPropertyName("file_extension")] - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? FileExtension { get; set; } = string.Empty; } diff --git a/src/Infrastructure/BotSharp.Abstraction/Files/Models/FileInfo.cs b/src/Infrastructure/BotSharp.Abstraction/Files/Models/FileInfo.cs new file mode 100644 index 00000000..14c02f74 --- /dev/null +++ b/src/Infrastructure/BotSharp.Abstraction/Files/Models/FileInfo.cs @@ -0,0 +1,38 @@ +namespace BotSharp.Abstraction.Files.Models; + +public class FileInfo +{ + /// + /// External file url + /// + [JsonPropertyName("file_url")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? FileUrl { get; set; } = string.Empty; + + /// + /// Internal file storage url + /// + [JsonPropertyName("file_storage_url")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? FileStorageUrl { get; set; } = string.Empty; + + /// + /// File content type + /// + [JsonPropertyName("content_type")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? ContentType { get; set; } = string.Empty; + + /// + /// File name without extension + /// + [JsonPropertyName("file_name")] + public string FileName { get; set; } = string.Empty; + + /// + /// File extension without dot + /// + [JsonPropertyName("file_extension")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? FileExtension { get; set; } = string.Empty; +} diff --git a/src/Infrastructure/BotSharp.Abstraction/Files/Models/InputFileModel.cs b/src/Infrastructure/BotSharp.Abstraction/Files/Models/InputFileModel.cs new file mode 100644 index 00000000..7eb350e3 --- /dev/null +++ b/src/Infrastructure/BotSharp.Abstraction/Files/Models/InputFileModel.cs @@ -0,0 +1,16 @@ +namespace BotSharp.Abstraction.Files.Models; + +public class InputFileModel : FileBase +{ + /// + /// File name with extension + /// + [JsonPropertyName("file_name")] + public new string FileName { get; set; } = string.Empty; + + /// + /// File data => format: "data:image/png;base64,aaaaaaaa" + /// + [JsonPropertyName("file_data")] + public new string FileData { get; set; } = string.Empty; +} diff --git a/src/Infrastructure/BotSharp.Abstraction/Files/Models/InstructFileModel.cs b/src/Infrastructure/BotSharp.Abstraction/Files/Models/InstructFileModel.cs new file mode 100644 index 00000000..7eaddd5a --- /dev/null +++ b/src/Infrastructure/BotSharp.Abstraction/Files/Models/InstructFileModel.cs @@ -0,0 +1,18 @@ +namespace BotSharp.Abstraction.Files.Models; + +public class InstructFileModel : FileBase +{ + /// + /// File extension without dot + /// + [JsonPropertyName("file_extension")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? FileExtension { get; set; } = string.Empty; + + /// + /// External file url + /// + [JsonPropertyName("file_url")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? FileUrl { get; set; } = string.Empty; +} diff --git a/src/Infrastructure/BotSharp.Abstraction/Files/Models/MessageFileModel.cs b/src/Infrastructure/BotSharp.Abstraction/Files/Models/MessageFileModel.cs index 2a0128b6..59ada4f2 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Files/Models/MessageFileModel.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Files/Models/MessageFileModel.cs @@ -1,6 +1,6 @@ namespace BotSharp.Abstraction.Files.Models; -public class MessageFileModel : FileBase +public class MessageFileModel : FileInfo { [JsonPropertyName("message_id")] public string MessageId { get; set; } diff --git a/src/Infrastructure/BotSharp.Abstraction/Models/AiModel.cs b/src/Infrastructure/BotSharp.Abstraction/Models/AiModel.cs new file mode 100644 index 00000000..348eb457 --- /dev/null +++ b/src/Infrastructure/BotSharp.Abstraction/Models/AiModel.cs @@ -0,0 +1,10 @@ +namespace BotSharp.Abstraction.Models; + +public class AiModel +{ + public string Id { get; set; } = string.Empty; + public string Model { get; set; } = string.Empty; + public string Name { get; set; } = string.Empty; + public int MaxLength { get; set; } + public int TokenLimit { get; set; } +} diff --git a/src/Infrastructure/BotSharp.Core/Files/Services/Instruct/FileInstructService.Audio.cs b/src/Infrastructure/BotSharp.Core/Files/Services/Instruct/FileInstructService.Audio.cs index f3f40f2c..30b6dbe3 100644 --- a/src/Infrastructure/BotSharp.Core/Files/Services/Instruct/FileInstructService.Audio.cs +++ b/src/Infrastructure/BotSharp.Core/Files/Services/Instruct/FileInstructService.Audio.cs @@ -4,7 +4,7 @@ namespace BotSharp.Core.Files.Services; public partial class FileInstructService { - public async Task ReadAudio(string? provider, string? model, BotSharpFile audio) + public async Task ReadAudio(string? provider, string? model, InstructFileModel audio) { var completion = CompletionProvider.GetSpeechToText(_services, provider: provider ?? "openai", model: model ?? "whisper-1"); var audioBytes = await DownloadFile(audio); @@ -12,7 +12,8 @@ public partial class FileInstructService stream.Write(audioBytes, 0, audioBytes.Length); stream.Position = 0; - var content = await completion.GenerateTextFromAudioAsync(stream, audio.FileName ?? string.Empty); + var fileName = $"{audio.FileName ?? "audio"}.{audio.FileExtension ?? "wav"}"; + var content = await completion.GenerateTextFromAudioAsync(stream, fileName); stream.Close(); return content; } diff --git a/src/Infrastructure/BotSharp.Core/Files/Services/Instruct/FileInstructService.Image.cs b/src/Infrastructure/BotSharp.Core/Files/Services/Instruct/FileInstructService.Image.cs index 244b5ac4..cd65c16a 100644 --- a/src/Infrastructure/BotSharp.Core/Files/Services/Instruct/FileInstructService.Image.cs +++ b/src/Infrastructure/BotSharp.Core/Files/Services/Instruct/FileInstructService.Image.cs @@ -4,7 +4,7 @@ namespace BotSharp.Core.Files.Services; public partial class FileInstructService { - public async Task ReadImages(string? provider, string? model, string text, IEnumerable images) + public async Task ReadImages(string? provider, string? model, string text, IEnumerable images) { var completion = CompletionProvider.GetChatCompletion(_services, provider: provider ?? "openai", model: model ?? "gpt-4o", multiModal: true); var message = await completion.GetChatCompletions(new Agent() @@ -14,7 +14,7 @@ public partial class FileInstructService { new RoleDialogModel(AgentRole.User, text) { - Files = images?.ToList() ?? new List() + Files = images?.Select(x => new BotSharpFile { FileUrl = x.FileUrl, FileData = x.FileData }).ToList() ?? new List() } }); return message.Content; @@ -30,7 +30,7 @@ public partial class FileInstructService return message; } - public async Task VaryImage(string? provider, string? model, BotSharpFile image) + public async Task VaryImage(string? provider, string? model, InstructFileModel image) { if (string.IsNullOrWhiteSpace(image?.FileUrl) && string.IsNullOrWhiteSpace(image?.FileData)) { @@ -43,16 +43,17 @@ public partial class FileInstructService stream.Write(bytes, 0, bytes.Length); stream.Position = 0; + var fileName = $"{image.FileName ?? "image"}.{image.FileExtension ?? "png"}"; var message = await completion.GetImageVariation(new Agent() { Id = Guid.Empty.ToString() - }, new RoleDialogModel(AgentRole.User, string.Empty), stream, image.FileName ?? string.Empty); + }, new RoleDialogModel(AgentRole.User, string.Empty), stream, fileName); stream.Close(); return message; } - public async Task EditImage(string? provider, string? model, string text, BotSharpFile image) + public async Task EditImage(string? provider, string? model, string text, InstructFileModel image) { if (string.IsNullOrWhiteSpace(image?.FileUrl) && string.IsNullOrWhiteSpace(image?.FileData)) { @@ -65,16 +66,17 @@ public partial class FileInstructService stream.Write(bytes, 0, bytes.Length); stream.Position = 0; + var fileName = $"{image.FileName ?? "image"}.{image.FileExtension ?? "png"}"; var message = await completion.GetImageEdits(new Agent() { Id = Guid.Empty.ToString() - }, new RoleDialogModel(AgentRole.User, text), stream, image.FileName ?? string.Empty); + }, new RoleDialogModel(AgentRole.User, text), stream, fileName); stream.Close(); return message; } - public async Task EditImage(string? provider, string? model, string text, BotSharpFile image, BotSharpFile mask) + public async Task EditImage(string? provider, string? model, string text, InstructFileModel image, InstructFileModel mask) { if ((string.IsNullOrWhiteSpace(image?.FileUrl) && string.IsNullOrWhiteSpace(image?.FileData)) || (string.IsNullOrWhiteSpace(mask?.FileUrl) && string.IsNullOrWhiteSpace(mask?.FileData))) @@ -94,10 +96,12 @@ public partial class FileInstructService maskStream.Write(maskBytes, 0, maskBytes.Length); maskStream.Position = 0; + var imageName = $"{image.FileName ?? "image"}.{image.FileExtension ?? "png"}"; + var maskName = $"{mask.FileName ?? "mask"}.{mask.FileExtension ?? "png"}"; var message = await completion.GetImageEdits(new Agent() { Id = Guid.Empty.ToString() - }, new RoleDialogModel(AgentRole.User, text), imageStream, image.FileName ?? string.Empty, maskStream, mask.FileName ?? string.Empty); + }, new RoleDialogModel(AgentRole.User, text), imageStream, imageName, maskStream, maskName); imageStream.Close(); maskStream.Close(); @@ -105,7 +109,7 @@ public partial class FileInstructService } #region Private methods - private async Task DownloadFile(BotSharpFile file) + private async Task DownloadFile(InstructFileModel file) { var bytes = new byte[0]; if (!string.IsNullOrEmpty(file.FileUrl)) diff --git a/src/Infrastructure/BotSharp.Core/Files/Services/Instruct/FileInstructService.Pdf.cs b/src/Infrastructure/BotSharp.Core/Files/Services/Instruct/FileInstructService.Pdf.cs index dd504fbf..e7228b13 100644 --- a/src/Infrastructure/BotSharp.Core/Files/Services/Instruct/FileInstructService.Pdf.cs +++ b/src/Infrastructure/BotSharp.Core/Files/Services/Instruct/FileInstructService.Pdf.cs @@ -4,7 +4,7 @@ namespace BotSharp.Core.Files.Services; public partial class FileInstructService { - public async Task ReadPdf(string? provider, string? model, string? modelId, string prompt, List files) + public async Task ReadPdf(string? provider, string? model, string? modelId, string prompt, List files) { var content = string.Empty; @@ -50,7 +50,7 @@ public partial class FileInstructService } #region Private methods - private async Task> DownloadFiles(string dir, List files, string extension = "pdf") + private async Task> DownloadFiles(string dir, List files, string extension = "pdf") { if (string.IsNullOrWhiteSpace(dir) || files.IsNullOrEmpty()) { diff --git a/src/Infrastructure/BotSharp.Core/Files/Services/Storage/LocalFileStorageService.Conversation.cs b/src/Infrastructure/BotSharp.Core/Files/Services/Storage/LocalFileStorageService.Conversation.cs index 8c2ed831..248806ec 100644 --- a/src/Infrastructure/BotSharp.Core/Files/Services/Storage/LocalFileStorageService.Conversation.cs +++ b/src/Infrastructure/BotSharp.Core/Files/Services/Storage/LocalFileStorageService.Conversation.cs @@ -118,7 +118,7 @@ public partial class LocalFileStorageService return foundMsgs; } - public bool SaveMessageFiles(string conversationId, string messageId, string source, List files) + public bool SaveMessageFiles(string conversationId, string messageId, string source, List files) { if (files.IsNullOrEmpty()) return false; diff --git a/src/Infrastructure/BotSharp.Core/Files/Services/Storage/LocalFileStorageService.User.cs b/src/Infrastructure/BotSharp.Core/Files/Services/Storage/LocalFileStorageService.User.cs index 43ff9eed..d1e962cd 100644 --- a/src/Infrastructure/BotSharp.Core/Files/Services/Storage/LocalFileStorageService.User.cs +++ b/src/Infrastructure/BotSharp.Core/Files/Services/Storage/LocalFileStorageService.User.cs @@ -16,7 +16,7 @@ public partial class LocalFileStorageService return found; } - public bool SaveUserAvatar(BotSharpFile file) + public bool SaveUserAvatar(InputFileModel file) { if (file == null || string.IsNullOrEmpty(file.FileData)) return false; diff --git a/src/Infrastructure/BotSharp.OpenAPI/Controllers/UserController.cs b/src/Infrastructure/BotSharp.OpenAPI/Controllers/UserController.cs index a7d4c449..16399334 100644 --- a/src/Infrastructure/BotSharp.OpenAPI/Controllers/UserController.cs +++ b/src/Infrastructure/BotSharp.OpenAPI/Controllers/UserController.cs @@ -135,9 +135,14 @@ public class UserController : ControllerBase #region Avatar [HttpPost("/user/avatar")] - public bool UploadUserAvatar([FromBody] BotSharpFile file) + public bool UploadUserAvatar([FromBody] UserAvatarModel input) { var fileStorage = _services.GetRequiredService(); + var file = new InputFileModel + { + FileName = input.FileName, + FileData = input.FileData, + }; return fileStorage.SaveUserAvatar(file); } diff --git a/src/Infrastructure/BotSharp.OpenAPI/ViewModels/Conversations/InputMessageFiles.cs b/src/Infrastructure/BotSharp.OpenAPI/ViewModels/Conversations/InputMessageFiles.cs index 5656f7ae..fdf088bb 100644 --- a/src/Infrastructure/BotSharp.OpenAPI/ViewModels/Conversations/InputMessageFiles.cs +++ b/src/Infrastructure/BotSharp.OpenAPI/ViewModels/Conversations/InputMessageFiles.cs @@ -3,5 +3,5 @@ namespace BotSharp.OpenAPI.ViewModels.Conversations; public class InputMessageFiles { public List States { get; set; } = new(); - public List Files { get; set; } = new(); + public List Files { get; set; } = new(); } diff --git a/src/Infrastructure/BotSharp.OpenAPI/ViewModels/Instructs/InstructBaseRequest.cs b/src/Infrastructure/BotSharp.OpenAPI/ViewModels/Instructs/InstructBaseRequest.cs index 1b5d551d..45a1c8ab 100644 --- a/src/Infrastructure/BotSharp.OpenAPI/ViewModels/Instructs/InstructBaseRequest.cs +++ b/src/Infrastructure/BotSharp.OpenAPI/ViewModels/Instructs/InstructBaseRequest.cs @@ -23,7 +23,7 @@ public class MultiModalRequest : InstructBaseRequest public string Text { get; set; } = string.Empty; [JsonPropertyName("files")] - public List Files { get; set; } = new(); + public List Files { get; set; } = new(); } public class ImageGenerationRequest : InstructBaseRequest @@ -35,7 +35,7 @@ public class ImageGenerationRequest : InstructBaseRequest public class ImageVariationRequest : InstructBaseRequest { [JsonPropertyName("file")] - public BotSharpFile File { get; set; } + public InstructFileModel File { get; set; } } public class ImageEditRequest : InstructBaseRequest @@ -44,7 +44,7 @@ public class ImageEditRequest : InstructBaseRequest public string Text { get; set; } = string.Empty; [JsonPropertyName("file")] - public BotSharpFile File { get; set; } + public InstructFileModel File { get; set; } } public class ImageMaskEditRequest : InstructBaseRequest @@ -53,14 +53,14 @@ public class ImageMaskEditRequest : InstructBaseRequest public string Text { get; set; } = string.Empty; [JsonPropertyName("file")] - public BotSharpFile File { get; set; } + public InstructFileModel File { get; set; } [JsonPropertyName("mask")] - public BotSharpFile Mask { get; set; } + public InstructFileModel Mask { get; set; } } public class AudioCompletionRequest : InstructBaseRequest { [JsonPropertyName("file")] - public BotSharpFile File { get; set; } + public InstructFileModel File { get; set; } } \ No newline at end of file diff --git a/src/Infrastructure/BotSharp.OpenAPI/ViewModels/Users/UserAvatarModel.cs b/src/Infrastructure/BotSharp.OpenAPI/ViewModels/Users/UserAvatarModel.cs new file mode 100644 index 00000000..0eab88e5 --- /dev/null +++ b/src/Infrastructure/BotSharp.OpenAPI/ViewModels/Users/UserAvatarModel.cs @@ -0,0 +1,18 @@ +using System.Text.Json.Serialization; + +namespace BotSharp.OpenAPI.ViewModels.Users; + +public class UserAvatarModel +{ + /// + /// File name with extension + /// + [JsonPropertyName("file_name")] + public string FileName { get; set; } = string.Empty; + + /// + /// File data, e.g., "data:image/png;base64,aaaaaaaa" + /// + [JsonPropertyName("file_data")] + public string FileData { get; set; } = string.Empty; +} diff --git a/src/Plugins/BotSharp.Plugin.FileHandler/Functions/EditImageFn.cs b/src/Plugins/BotSharp.Plugin.FileHandler/Functions/EditImageFn.cs index 759f94b6..7a5d8e72 100644 --- a/src/Plugins/BotSharp.Plugin.FileHandler/Functions/EditImageFn.cs +++ b/src/Plugins/BotSharp.Plugin.FileHandler/Functions/EditImageFn.cs @@ -99,9 +99,9 @@ public class EditImageFn : IFunctionCallback { if (image == null) return; - var files = new List() + var files = new List() { - new BotSharpFile + new InputFileModel { FileName = $"{Guid.NewGuid()}.png", FileData = $"data:{MediaTypeNames.Image.Png};base64,{image.ImageData}" diff --git a/src/Plugins/BotSharp.Plugin.FileHandler/Functions/GenerateImageFn.cs b/src/Plugins/BotSharp.Plugin.FileHandler/Functions/GenerateImageFn.cs index 4102ff7b..4c8fdf9e 100644 --- a/src/Plugins/BotSharp.Plugin.FileHandler/Functions/GenerateImageFn.cs +++ b/src/Plugins/BotSharp.Plugin.FileHandler/Functions/GenerateImageFn.cs @@ -77,7 +77,7 @@ public class GenerateImageFn : IFunctionCallback { if (images.IsNullOrEmpty()) return; - var files = images.Where(x => !string.IsNullOrEmpty(x?.ImageData)).Select(x => new BotSharpFile + var files = images.Where(x => !string.IsNullOrEmpty(x?.ImageData)).Select(x => new InputFileModel { FileName = $"{Guid.NewGuid()}.png", FileData = $"data:{MediaTypeNames.Image.Png};base64,{x.ImageData}" diff --git a/src/Plugins/BotSharp.Plugin.TencentCos/Services/TencentCosService.Conversation.cs b/src/Plugins/BotSharp.Plugin.TencentCos/Services/TencentCosService.Conversation.cs index 7e2462de..4c339f12 100644 --- a/src/Plugins/BotSharp.Plugin.TencentCos/Services/TencentCosService.Conversation.cs +++ b/src/Plugins/BotSharp.Plugin.TencentCos/Services/TencentCosService.Conversation.cs @@ -115,7 +115,7 @@ public partial class TencentCosService return foundMsgs; } - public bool SaveMessageFiles(string conversationId, string messageId, string source, List files) + public bool SaveMessageFiles(string conversationId, string messageId, string source, List files) { if (files.IsNullOrEmpty()) return false; diff --git a/src/Plugins/BotSharp.Plugin.TencentCos/Services/TencentCosService.User.cs b/src/Plugins/BotSharp.Plugin.TencentCos/Services/TencentCosService.User.cs index de222c43..a2308539 100644 --- a/src/Plugins/BotSharp.Plugin.TencentCos/Services/TencentCosService.User.cs +++ b/src/Plugins/BotSharp.Plugin.TencentCos/Services/TencentCosService.User.cs @@ -16,7 +16,7 @@ public partial class TencentCosService return found; } - public bool SaveUserAvatar(BotSharpFile file) + public bool SaveUserAvatar(InputFileModel file) { if (file == null || string.IsNullOrEmpty(file.FileData)) return false;