diff --git a/src/ChatTailorAI.DataAccess/Repositories/AssistantRepository.cs b/src/ChatTailorAI.DataAccess/Repositories/AssistantRepository.cs index d636315..4e7ccdb 100644 --- a/src/ChatTailorAI.DataAccess/Repositories/AssistantRepository.cs +++ b/src/ChatTailorAI.DataAccess/Repositories/AssistantRepository.cs @@ -1,13 +1,11 @@ -using ChatTailorAI.DataAccess.Database; -using ChatTailorAI.DataAccess.Database.Providers.SQLite; -using ChatTailorAI.Shared.Models.Assistants; -using ChatTailorAI.Shared.Repositories; -using Microsoft.EntityFrameworkCore; -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using ChatTailorAI.DataAccess.Database.Providers.SQLite; +using ChatTailorAI.Shared.Models.Assistants; +using ChatTailorAI.Shared.Repositories; namespace ChatTailorAI.DataAccess.Repositories { diff --git a/src/ChatTailorAI.DataAccess/Repositories/ConversationRepository.cs b/src/ChatTailorAI.DataAccess/Repositories/ConversationRepository.cs index 5529e57..3bfd4ae 100644 --- a/src/ChatTailorAI.DataAccess/Repositories/ConversationRepository.cs +++ b/src/ChatTailorAI.DataAccess/Repositories/ConversationRepository.cs @@ -1,15 +1,10 @@ -using ChatTailorAI.DataAccess.Database; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; using ChatTailorAI.DataAccess.Database.Providers.SQLite; -using ChatTailorAI.Shared.Models.Assistants; using ChatTailorAI.Shared.Models.Conversations; -using ChatTailorAI.Shared.Repositories; using ChatTailorAI.Shared.Services.Database.Repositories; -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.DataAccess.Repositories { diff --git a/src/ChatTailorAI.DataAccess/Repositories/ImageRepository.cs b/src/ChatTailorAI.DataAccess/Repositories/ImageRepository.cs index 9d86ee5..8bf5e16 100644 --- a/src/ChatTailorAI.DataAccess/Repositories/ImageRepository.cs +++ b/src/ChatTailorAI.DataAccess/Repositories/ImageRepository.cs @@ -1,14 +1,11 @@ -using ChatTailorAI.DataAccess.Database; -using ChatTailorAI.DataAccess.Database.Providers.SQLite; -using ChatTailorAI.Shared.Models.Chat; -using ChatTailorAI.Shared.Models.Image.OpenAI; -using ChatTailorAI.Shared.Repositories; -using Microsoft.EntityFrameworkCore; -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using ChatTailorAI.DataAccess.Database.Providers.SQLite; +using ChatTailorAI.Shared.Models.Chat; +using ChatTailorAI.Shared.Repositories; namespace ChatTailorAI.DataAccess.Repositories { diff --git a/src/ChatTailorAI.DataAccess/Repositories/MessageRepository.cs b/src/ChatTailorAI.DataAccess/Repositories/MessageRepository.cs index 16f92f0..a95b678 100644 --- a/src/ChatTailorAI.DataAccess/Repositories/MessageRepository.cs +++ b/src/ChatTailorAI.DataAccess/Repositories/MessageRepository.cs @@ -1,14 +1,11 @@ -using ChatTailorAI.DataAccess.Database; -using ChatTailorAI.DataAccess.Database.Providers.SQLite; -using ChatTailorAI.Shared.Models.Assistants; -using ChatTailorAI.Shared.Models.Chat; -using ChatTailorAI.Shared.Services.Database.Repositories; -using Microsoft.EntityFrameworkCore; -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using ChatTailorAI.DataAccess.Database.Providers.SQLite; +using ChatTailorAI.Shared.Models.Chat; +using ChatTailorAI.Shared.Services.Database.Repositories; namespace ChatTailorAI.DataAccess.Repositories { diff --git a/src/ChatTailorAI.DataAccess/Repositories/PromptRepository.cs b/src/ChatTailorAI.DataAccess/Repositories/PromptRepository.cs index a7632d8..f57c434 100644 --- a/src/ChatTailorAI.DataAccess/Repositories/PromptRepository.cs +++ b/src/ChatTailorAI.DataAccess/Repositories/PromptRepository.cs @@ -1,13 +1,10 @@ -using ChatTailorAI.DataAccess.Database; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; using ChatTailorAI.DataAccess.Database.Providers.SQLite; -using ChatTailorAI.Shared.Models.Assistants; using ChatTailorAI.Shared.Models.Prompts; using ChatTailorAI.Shared.Repositories; -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.DataAccess.Repositories { diff --git a/src/ChatTailorAI.Services.Uwp/Audio/AudioMediaPlayerService.cs b/src/ChatTailorAI.Services.Uwp/Audio/AudioMediaPlayerService.cs index 3aef34d..8bbe492 100644 --- a/src/ChatTailorAI.Services.Uwp/Audio/AudioMediaPlayerService.cs +++ b/src/ChatTailorAI.Services.Uwp/Audio/AudioMediaPlayerService.cs @@ -1,13 +1,10 @@ -using ChatTailorAI.Shared.Services.Common; -using System; -using System.Collections.Generic; +using System; using System.IO; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Windows.Media.Core; using Windows.Media.Playback; using Windows.Storage.Streams; +using ChatTailorAI.Shared.Services.Audio; namespace ChatTailorAI.Services.Uwp.Audio { diff --git a/src/ChatTailorAI.Services.Uwp/Audio/AudioRecorderService.cs b/src/ChatTailorAI.Services.Uwp/Audio/AudioRecorderService.cs index 6db86db..152b707 100644 --- a/src/ChatTailorAI.Services.Uwp/Audio/AudioRecorderService.cs +++ b/src/ChatTailorAI.Services.Uwp/Audio/AudioRecorderService.cs @@ -1,15 +1,12 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; using System.Threading.Tasks; -using ChatTailorAI.Shared.Services.Common; using Windows.Devices.Enumeration; using Windows.Media.Capture; using Windows.Media.Devices; using Windows.Media.MediaProperties; using Windows.Storage.Streams; +using ChatTailorAI.Shared.Services.Audio; namespace ChatTailorAI.Services.Uwp.Audio { @@ -86,4 +83,4 @@ public async Task StopRecordingAudio() return audioStream.AsStream(); } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Services.Uwp/ChatTailorAI.Services.Uwp.csproj b/src/ChatTailorAI.Services.Uwp/ChatTailorAI.Services.Uwp.csproj index d5942d7..89e0b41 100644 --- a/src/ChatTailorAI.Services.Uwp/ChatTailorAI.Services.Uwp.csproj +++ b/src/ChatTailorAI.Services.Uwp/ChatTailorAI.Services.Uwp.csproj @@ -126,9 +126,8 @@ - - + diff --git a/src/ChatTailorAI.Services.Uwp/Dispatching/DispatcherService.cs b/src/ChatTailorAI.Services.Uwp/Dispatching/DispatcherService.cs index a42edd3..ca2ec39 100644 --- a/src/ChatTailorAI.Services.Uwp/Dispatching/DispatcherService.cs +++ b/src/ChatTailorAI.Services.Uwp/Dispatching/DispatcherService.cs @@ -1,11 +1,8 @@ -using ChatTailorAI.Shared.Services.Common; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System; using System.Threading.Tasks; using Windows.ApplicationModel.Core; using Windows.UI.Core; +using ChatTailorAI.Shared.Services.Common; namespace ChatTailorAI.Services.Uwp.Dispatching { diff --git a/src/ChatTailorAI.Services.Uwp/Files/FileDownloadService.cs b/src/ChatTailorAI.Services.Uwp/Files/FileDownloadService.cs index cb87fe9..443c951 100644 --- a/src/ChatTailorAI.Services.Uwp/Files/FileDownloadService.cs +++ b/src/ChatTailorAI.Services.Uwp/Files/FileDownloadService.cs @@ -1,14 +1,12 @@ using System; -using ChatTailorAI; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net.Http; -using System.Text; using System.Threading.Tasks; +using System.Runtime.InteropServices.WindowsRuntime; using Windows.Storage; using ChatTailorAI.Shared.Services.Files; -using System.Runtime.InteropServices.WindowsRuntime; namespace ChatTailorAI.Services.Uwp.FileManagement { @@ -17,10 +15,10 @@ namespace ChatTailorAI.Services.Uwp.FileManagement /// public class FileDownloadService : IFileDownloadService { - private HttpClient _httpClient; - private IFolderService _folderService; + private readonly HttpClient _httpClient; + private readonly IFolderService _folderService; - public FileDownloadService(HttpClient client, IFolderService folderService) + public FileDownloadService(HttpClient client, IFolderService folderService) { _folderService = folderService; _httpClient = client; @@ -99,15 +97,24 @@ private async Task WriteToFile(StorageFolder photoFolder, byte[] buffer) } } - + /// + /// Downloads a file asynchronously from a given url + /// + /// + /// public async Task DownloadFileAsync(string url) { return await _httpClient.GetByteArrayAsync(url); } + /// + /// Downloads multiple files asynchronously from given urls + /// + /// + /// public async Task> DownloadFilesAsync(string[] urls) { return await Task.WhenAll(urls.Select(DownloadFileAsync)); } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Services.Uwp/Files/FileService.cs b/src/ChatTailorAI.Services.Uwp/Files/FileService.cs index b7b20dd..94ce2ed 100644 --- a/src/ChatTailorAI.Services.Uwp/Files/FileService.cs +++ b/src/ChatTailorAI.Services.Uwp/Files/FileService.cs @@ -1,16 +1,13 @@ -using Newtonsoft.Json; -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Text; using System.Threading.Tasks; -using Windows.Storage.Streams; +using Newtonsoft.Json; using Windows.Storage; -using ChatTailorAI.Shared.Models.Prompts; -using System.Diagnostics; using ChatTailorAI.Shared.Services.Files; using ChatTailorAI.Shared.Dto; +using Windows.Storage.Pickers; namespace ChatTailorAI.Services.Uwp.FileManagement { @@ -18,40 +15,40 @@ public class FileService : IFileService { public async Task SaveToFileAsync(string filename, string data) { - var savePicker = new Windows.Storage.Pickers.FileSavePicker + var savePicker = new FileSavePicker { - SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.DocumentsLibrary + SuggestedStartLocation = PickerLocationId.DocumentsLibrary }; savePicker.FileTypeChoices.Add("Plain Text", new List() { ".txt" }); savePicker.SuggestedFileName = filename; - Windows.Storage.StorageFile file = await savePicker.PickSaveFileAsync(); + StorageFile file = await savePicker.PickSaveFileAsync(); if (file != null) { - Windows.Storage.CachedFileManager.DeferUpdates(file); + CachedFileManager.DeferUpdates(file); - await Windows.Storage.FileIO.WriteTextAsync(file, data); + await FileIO.WriteTextAsync(file, data); - await Windows.Storage.CachedFileManager.CompleteUpdatesAsync(file); + await CachedFileManager.CompleteUpdatesAsync(file); } } public async Task ReadFromFileAsync() { - var openPicker = new Windows.Storage.Pickers.FileOpenPicker(); + var openPicker = new FileOpenPicker(); - openPicker.ViewMode = Windows.Storage.Pickers.PickerViewMode.List; - openPicker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.DocumentsLibrary; + openPicker.ViewMode = PickerViewMode.List; + openPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary; openPicker.FileTypeFilter.Add(".txt"); - Windows.Storage.StorageFile file = await openPicker.PickSingleFileAsync(); + StorageFile file = await openPicker.PickSingleFileAsync(); if (file != null) { - string data = await Windows.Storage.FileIO.ReadTextAsync(file); + string data = await FileIO.ReadTextAsync(file); return data; } else @@ -62,19 +59,19 @@ public async Task ReadFromFileAsync() public async Task UpdatePromptsFlieAsync(List prompts) { - var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder; + var localFolder = ApplicationData.Current.LocalFolder; var file = await localFolder - .CreateFileAsync("prompts.json", Windows.Storage.CreationCollisionOption.ReplaceExisting); - await Windows.Storage.FileIO.WriteTextAsync(file, JsonConvert.SerializeObject(prompts)); + .CreateFileAsync("prompts.json", CreationCollisionOption.ReplaceExisting); + await FileIO.WriteTextAsync(file, JsonConvert.SerializeObject(prompts)); } public async Task> GetPromptsAsync() { - var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder; + var localFolder = ApplicationData.Current.LocalFolder; try { var readFile = await localFolder.GetFileAsync("prompts.json"); - return JsonConvert.DeserializeObject>(await Windows.Storage.FileIO.ReadTextAsync(readFile)); + return JsonConvert.DeserializeObject>(await FileIO.ReadTextAsync(readFile)); } catch (FileNotFoundException) { @@ -84,18 +81,18 @@ public async Task> GetPromptsAsync() public async Task AppendPromptToFileAsync(PromptDto prompt) { - var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder; - var file = await localFolder.CreateFileAsync("prompts.json", Windows.Storage.CreationCollisionOption.OpenIfExists); + var localFolder = ApplicationData.Current.LocalFolder; + var file = await localFolder.CreateFileAsync("prompts.json", CreationCollisionOption.OpenIfExists); var promptJson = JsonConvert.SerializeObject(prompt); // Append the new prompt to the file with a newline at the end - await Windows.Storage.FileIO.AppendTextAsync(file, promptJson + "\n"); + await FileIO.AppendTextAsync(file, promptJson + "\n"); } public async Task CheckIfFileExists(string filename) { - var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder; + var localFolder = ApplicationData.Current.LocalFolder; try { var readFile = await localFolder.GetFileAsync(filename); @@ -111,10 +108,10 @@ public async Task> ReadPromptsFromFileAsync() { try { - var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder; + var localFolder = ApplicationData.Current.LocalFolder; var file = await localFolder.GetFileAsync("prompts.json"); - var lines = await Windows.Storage.FileIO.ReadLinesAsync(file); + var lines = await FileIO.ReadLinesAsync(file); var prompts = lines.Select(line => JsonConvert.DeserializeObject(line)).ToList(); @@ -128,10 +125,10 @@ public async Task> ReadPromptsFromFileAsync() public async Task DeletePromptAsync(string promptId) { - var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder; + var localFolder = ApplicationData.Current.LocalFolder; var file = await localFolder.GetFileAsync("prompts.json"); - var lines = await Windows.Storage.FileIO.ReadLinesAsync(file); + var lines = await FileIO.ReadLinesAsync(file); var newLines = new List(); @@ -144,31 +141,31 @@ public async Task DeletePromptAsync(string promptId) } } - await Windows.Storage.FileIO.WriteLinesAsync(file, newLines); + await FileIO.WriteLinesAsync(file, newLines); } public async Task UpdatePromptsAsync(List prompts) { - var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder; + var localFolder = ApplicationData.Current.LocalFolder; var file = await localFolder.GetFileAsync("prompts.json"); List newLines = prompts .Select(prompt => JsonConvert.SerializeObject(prompt)) .ToList(); - await Windows.Storage.FileIO.WriteLinesAsync(file, newLines); + await FileIO.WriteLinesAsync(file, newLines); } public async Task BackupPromptsAsync() { - var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder; + var localFolder = ApplicationData.Current.LocalFolder; try { var file = await localFolder.GetFileAsync("prompts.json"); if (file != null) { - var backupFolder = await localFolder.CreateFolderAsync("Backups", Windows.Storage.CreationCollisionOption.OpenIfExists); + var backupFolder = await localFolder.CreateFolderAsync("Backups", CreationCollisionOption.OpenIfExists); await file.CopyAsync(backupFolder, "prompts.json", NameCollisionOption.GenerateUniqueName); } } @@ -180,7 +177,7 @@ public async Task BackupPromptsAsync() public async Task DeletePromptsAsync() { - var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder; + var localFolder = ApplicationData.Current.LocalFolder; try { @@ -196,6 +193,5 @@ public async Task DeletePromptsAsync() throw new Exception($"Failed to delete prompts: {ex.Message}"); } } - } } \ No newline at end of file diff --git a/src/ChatTailorAI.Services.Uwp/Files/FolderService.cs b/src/ChatTailorAI.Services.Uwp/Files/FolderService.cs index 4561c38..8185335 100644 --- a/src/ChatTailorAI.Services.Uwp/Files/FolderService.cs +++ b/src/ChatTailorAI.Services.Uwp/Files/FolderService.cs @@ -1,17 +1,15 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Windows.Storage.Pickers; using Windows.Storage; +using ChatTailorAI.Shared.Services.Files; namespace ChatTailorAI.Services.Uwp.FileManagement { /// /// A class for picking and creating folders /// - public class FolderService : IFolderService + public class FolderService : IFolderService { /// /// Opens the folder picker and returns the chosen folder. @@ -52,4 +50,4 @@ public async Task CreateFolderByNameAsync(StorageFolder folder, s return folder; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Services.Uwp/Files/IFolderService.cs b/src/ChatTailorAI.Services.Uwp/Files/IFolderService.cs deleted file mode 100644 index 715b237..0000000 --- a/src/ChatTailorAI.Services.Uwp/Files/IFolderService.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Windows.Storage; - -namespace ChatTailorAI.Services.Uwp.FileManagement -{ - /// - /// Interface for a service for picking and creating folders - /// - public interface IFolderService - { - /// - /// Opens the folder picker and returns the chosen folder. - /// - /// Chosen storage folder. - Task OpenFolderPickerAsync(); - - /// - /// Creates a new folder with its name passed as an argument inside a specified folder. - /// - /// Folder to create a new folder in. - /// New folders name. - /// - Task CreateFolderByNameAsync(StorageFolder folder, string folderName); - } -} diff --git a/src/ChatTailorAI.Services.Uwp/Files/ImageFileService.cs b/src/ChatTailorAI.Services.Uwp/Files/ImageFileService.cs index 0f5c725..df6ec88 100644 --- a/src/ChatTailorAI.Services.Uwp/Files/ImageFileService.cs +++ b/src/ChatTailorAI.Services.Uwp/Files/ImageFileService.cs @@ -1,38 +1,34 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; using Windows.Storage.Streams; using Windows.Storage; using System.Diagnostics; using ChatTailorAI.Shared.Models.Image; using ChatTailorAI.Shared.Services.Files; +using Windows.Storage.Pickers; namespace ChatTailorAI.Services.Uwp.FileManagement { public class ImageFileService : IImageFileService { - private readonly IFileService _fileService; private readonly IFileDownloadService _fileDownloadService; public ImageFileService( - IFileService fileService, IFileDownloadService fileDownloadService) { - _fileService = fileService; _fileDownloadService = fileDownloadService; } public async Task> ChooseImagesAsync() { - var openPicker = new Windows.Storage.Pickers.FileOpenPicker(); - - openPicker.ViewMode = Windows.Storage.Pickers.PickerViewMode.Thumbnail; - openPicker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.PicturesLibrary; - openPicker.FileTypeFilter.Add(".jpg"); - openPicker.FileTypeFilter.Add(".jpeg"); - openPicker.FileTypeFilter.Add(".png"); + var openPicker = new FileOpenPicker + { + ViewMode = PickerViewMode.Thumbnail, + SuggestedStartLocation = PickerLocationId.PicturesLibrary, + FileTypeFilter = { ".jpg", ".jpeg", ".png" } + }; var files = await openPicker.PickMultipleFilesAsync(); diff --git a/src/ChatTailorAI.Services.Uwp/Logger/NLogService.cs b/src/ChatTailorAI.Services.Uwp/Logging/NLogService.cs similarity index 100% rename from src/ChatTailorAI.Services.Uwp/Logger/NLogService.cs rename to src/ChatTailorAI.Services.Uwp/Logging/NLogService.cs diff --git a/src/ChatTailorAI.Services.Uwp/Notification/AppNotificationService.cs b/src/ChatTailorAI.Services.Uwp/Notification/AppNotificationService.cs index 29da983..de3b4a1 100644 --- a/src/ChatTailorAI.Services.Uwp/Notification/AppNotificationService.cs +++ b/src/ChatTailorAI.Services.Uwp/Notification/AppNotificationService.cs @@ -26,4 +26,4 @@ public void Display(string message, int duration = 5000) _eventAggregator.PublishNotificationRaised(new NotificationRaisedEvent(message, duration)); } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Services.Uwp/Settings/AppSettingsService.cs b/src/ChatTailorAI.Services.Uwp/Settings/AppSettingsService.cs index b2c2095..75f447b 100644 --- a/src/ChatTailorAI.Services.Uwp/Settings/AppSettingsService.cs +++ b/src/ChatTailorAI.Services.Uwp/Settings/AppSettingsService.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Windows.ApplicationModel.Resources; using ChatTailorAI.Shared.Services.Common; -using Windows.ApplicationModel.Resources; namespace ChatTailorAI.Services.Uwp.Settings { diff --git a/src/ChatTailorAI.Services.Uwp/Settings/UserSettingsService.cs b/src/ChatTailorAI.Services.Uwp/Settings/UserSettingsService.cs index cad1be2..f400558 100644 --- a/src/ChatTailorAI.Services.Uwp/Settings/UserSettingsService.cs +++ b/src/ChatTailorAI.Services.Uwp/Settings/UserSettingsService.cs @@ -1,8 +1,8 @@ using System; -using ChatTailorAI.Shared.Models.Settings; -using ChatTailorAI.Shared.Services.Common; using Newtonsoft.Json; using Windows.Storage; +using ChatTailorAI.Shared.Models.Settings; +using ChatTailorAI.Shared.Services.Common; namespace ChatTailorAI.Services.Uwp.Settings { diff --git a/src/ChatTailorAI.Services.Uwp/System/WindowsClipboardService.cs b/src/ChatTailorAI.Services.Uwp/System/WindowsClipboardService.cs index 3644a7b..218c244 100644 --- a/src/ChatTailorAI.Services.Uwp/System/WindowsClipboardService.cs +++ b/src/ChatTailorAI.Services.Uwp/System/WindowsClipboardService.cs @@ -1,14 +1,10 @@ - -using System; +using System; using System.Linq; using System.Text; using System.Threading.Tasks; -using Windows.ApplicationModel.Core; using Windows.ApplicationModel.DataTransfer; using Windows.Graphics.Imaging; using Windows.Storage.Streams; -using Windows.UI.Core; -using Windows.UI.ViewManagement; using ChatTailorAI.Shared.Dto.Chat; using ChatTailorAI.Shared.Services.Common; diff --git a/src/ChatTailorAI.Services.Uwp/UI/Dialogs/DialogService.cs b/src/ChatTailorAI.Services.Uwp/UI/Dialogs/DialogService.cs index fc338aa..3bd7974 100644 --- a/src/ChatTailorAI.Services.Uwp/UI/Dialogs/DialogService.cs +++ b/src/ChatTailorAI.Services.Uwp/UI/Dialogs/DialogService.cs @@ -12,18 +12,12 @@ namespace ChatTailorAI.Uwp.Services.UI.Dialogs public class DialogService : IDialogService { private readonly IDialogFactory _dialogFactory; - private bool _isDialogOpen; public DialogService(IDialogFactory dialogFactory) { _dialogFactory = dialogFactory; } - public bool CheckForOpenDialog() - { - return _isDialogOpen; - } - public async Task ShowDeleteDialogAsync() { return await _dialogFactory.ShowDeleteDialogAsync(); diff --git a/src/ChatTailorAI.Services.Uwp/UI/Navigation/ChatPageNavigationService.cs b/src/ChatTailorAI.Services.Uwp/UI/Navigation/ChatPageNavigationService.cs index 8dee18a..3be55e0 100644 --- a/src/ChatTailorAI.Services.Uwp/UI/Navigation/ChatPageNavigationService.cs +++ b/src/ChatTailorAI.Services.Uwp/UI/Navigation/ChatPageNavigationService.cs @@ -1,7 +1,7 @@ using System; using Windows.UI.Xaml.Controls; using ChatTailorAI.Shared.Enums; -using ChatTailorAI.Shared.Services.Common; +using ChatTailorAI.Shared.Services.Common.Navigation; namespace ChatTailorAI.Services.Uwp.UI.Navigation { diff --git a/src/ChatTailorAI.Services.Uwp/UI/Navigation/NavigationService.cs b/src/ChatTailorAI.Services.Uwp/UI/Navigation/NavigationService.cs index 3f808ca..cb3b9dc 100644 --- a/src/ChatTailorAI.Services.Uwp/UI/Navigation/NavigationService.cs +++ b/src/ChatTailorAI.Services.Uwp/UI/Navigation/NavigationService.cs @@ -1,11 +1,7 @@ -using ChatTailorAI.Shared.Enums; -using ChatTailorAI.Shared.Services.Common; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Windows.UI.Xaml.Controls; +using ChatTailorAI.Shared.Enums; +using ChatTailorAI.Shared.Services.Common.Navigation; namespace ChatTailorAI.Uwp.Services.UI.Navigation { diff --git a/src/ChatTailorAI.Services/Assistants/Custom/CustomAssistantService.cs b/src/ChatTailorAI.Services/Assistants/Custom/CustomAssistantService.cs index b8ed309..cb6614f 100644 --- a/src/ChatTailorAI.Services/Assistants/Custom/CustomAssistantService.cs +++ b/src/ChatTailorAI.Services/Assistants/Custom/CustomAssistantService.cs @@ -1,12 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Services.Assistants.Custom +namespace ChatTailorAI.Services.Assistants.Custom { public class CustomAssistantService { // TODO: Allow creation of assistants using our own setup similar to OpenAI Assistants impl, // and managing context length appropriately } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Services/Assistants/OpenAI/OpenAIAssistantManagerService.cs b/src/ChatTailorAI.Services/Assistants/OpenAI/OpenAIAssistantManagerService.cs index 26ae60d..abd9528 100644 --- a/src/ChatTailorAI.Services/Assistants/OpenAI/OpenAIAssistantManagerService.cs +++ b/src/ChatTailorAI.Services/Assistants/OpenAI/OpenAIAssistantManagerService.cs @@ -1,16 +1,11 @@ -using ChatTailorAI.Shared.Dto; -using ChatTailorAI.Shared.Models.Assistants.OpenAI; -using ChatTailorAI.Shared.Models.Chat; -using ChatTailorAI.Shared.Models.Tools; -using ChatTailorAI.Shared.Services.Assistants.OpenAI; -using Newtonsoft.Json; -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reflection; -using System.Text; using System.Threading; using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto; +using ChatTailorAI.Shared.Models.Assistants.OpenAI; +using ChatTailorAI.Shared.Services.Assistants.OpenAI; namespace ChatTailorAI.Services.Assistants.OpenAI { diff --git a/src/ChatTailorAI.Services/Assistants/OpenAI/OpenAIAssistantService.cs b/src/ChatTailorAI.Services/Assistants/OpenAI/OpenAIAssistantService.cs index e5df210..37868d6 100644 --- a/src/ChatTailorAI.Services/Assistants/OpenAI/OpenAIAssistantService.cs +++ b/src/ChatTailorAI.Services/Assistants/OpenAI/OpenAIAssistantService.cs @@ -1,17 +1,17 @@ -using ChatTailorAI.Shared.Dto; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; +using ChatTailorAI.Shared.Dto; using ChatTailorAI.Shared.Models.Assistants.OpenAI; using ChatTailorAI.Shared.Models.Settings; using ChatTailorAI.Shared.Models.Tools; using ChatTailorAI.Shared.Services.Assistants.OpenAI; using ChatTailorAI.Shared.Services.Common; using ChatTailorAI.Shared.Services.Events; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.Services.Assistants.OpenAI { diff --git a/src/ChatTailorAI.Services/Assistants/OpenAI/OpenAIMessageService.cs b/src/ChatTailorAI.Services/Assistants/OpenAI/OpenAIMessageService.cs index 143fdd1..5462ec9 100644 --- a/src/ChatTailorAI.Services/Assistants/OpenAI/OpenAIMessageService.cs +++ b/src/ChatTailorAI.Services/Assistants/OpenAI/OpenAIMessageService.cs @@ -1,14 +1,14 @@ -using ChatTailorAI.Shared.Models.Assistants.OpenAI; -using ChatTailorAI.Shared.Models.Settings; -using ChatTailorAI.Shared.Services.Assistants.OpenAI; -using ChatTailorAI.Shared.Services.Common; -using ChatTailorAI.Shared.Services.Events; -using Newtonsoft.Json; -using System; +using System; using System.Collections.Generic; using System.Net.Http; using System.Text; using System.Threading.Tasks; +using Newtonsoft.Json; +using ChatTailorAI.Shared.Models.Assistants.OpenAI; +using ChatTailorAI.Shared.Models.Settings; +using ChatTailorAI.Shared.Services.Assistants.OpenAI; +using ChatTailorAI.Shared.Services.Common; +using ChatTailorAI.Shared.Services.Events; namespace ChatTailorAI.Services.Assistants.OpenAI { diff --git a/src/ChatTailorAI.Services/Assistants/OpenAI/OpenAIRunService.cs b/src/ChatTailorAI.Services/Assistants/OpenAI/OpenAIRunService.cs index a387128..b9ac35d 100644 --- a/src/ChatTailorAI.Services/Assistants/OpenAI/OpenAIRunService.cs +++ b/src/ChatTailorAI.Services/Assistants/OpenAI/OpenAIRunService.cs @@ -1,14 +1,13 @@ -using ChatTailorAI.Shared.Models.Assistants.OpenAI; +using System; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; +using ChatTailorAI.Shared.Models.Assistants.OpenAI; using ChatTailorAI.Shared.Models.Settings; using ChatTailorAI.Shared.Services.Assistants.OpenAI; using ChatTailorAI.Shared.Services.Common; using ChatTailorAI.Shared.Services.Events; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.Services.Assistants.OpenAI { diff --git a/src/ChatTailorAI.Services/Assistants/OpenAI/OpenAIThreadService.cs b/src/ChatTailorAI.Services/Assistants/OpenAI/OpenAIThreadService.cs index e62ca5a..8915c37 100644 --- a/src/ChatTailorAI.Services/Assistants/OpenAI/OpenAIThreadService.cs +++ b/src/ChatTailorAI.Services/Assistants/OpenAI/OpenAIThreadService.cs @@ -1,14 +1,13 @@ -using ChatTailorAI.Shared.Models.Assistants.OpenAI; +using System; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; +using ChatTailorAI.Shared.Models.Assistants.OpenAI; using ChatTailorAI.Shared.Models.Settings; using ChatTailorAI.Shared.Services.Assistants.OpenAI; using ChatTailorAI.Shared.Services.Common; using ChatTailorAI.Shared.Services.Events; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.Services.Assistants.OpenAI { diff --git a/src/ChatTailorAI.Services/Authentication/AuthenticationService.cs b/src/ChatTailorAI.Services/Authentication/AuthenticationService.cs index 6c65f38..a2a7bf7 100644 --- a/src/ChatTailorAI.Services/Authentication/AuthenticationService.cs +++ b/src/ChatTailorAI.Services/Authentication/AuthenticationService.cs @@ -1,8 +1,8 @@ -using ChatTailorAI.Shared.Events; +using System.Threading.Tasks; +using ChatTailorAI.Shared.Events; using ChatTailorAI.Shared.Services.Authentication; -using ChatTailorAI.Shared.Services.Common; using ChatTailorAI.Shared.Services.Events; -using System.Threading.Tasks; +using ChatTailorAI.Shared.Services.Tools; namespace ChatTailorAI.Services.Authentication { diff --git a/src/ChatTailorAI.Services/Chat/Anthropic/AnthropicClaudeChatService.cs b/src/ChatTailorAI.Services/Chat/Anthropic/AnthropicChatService.cs similarity index 93% rename from src/ChatTailorAI.Services/Chat/Anthropic/AnthropicClaudeChatService.cs rename to src/ChatTailorAI.Services/Chat/Anthropic/AnthropicChatService.cs index e62a929..65b190d 100644 --- a/src/ChatTailorAI.Services/Chat/Anthropic/AnthropicClaudeChatService.cs +++ b/src/ChatTailorAI.Services/Chat/Anthropic/AnthropicChatService.cs @@ -1,40 +1,35 @@ -using ChatTailorAI.Shared.Dto.Chat.Google; -using ChatTailorAI.Shared.Models.Chat.Google; -using ChatTailorAI.Shared.Models.Settings; -using ChatTailorAI.Shared.Services.Chat.Google; -using ChatTailorAI.Shared.Services.Common; -using ChatTailorAI.Shared.Services.Events; + using System; -using System.Collections.Generic; using System.Net.Http; using System.Text; using System.Threading.Tasks; using System.Threading; -using ChatTailorAI.Shared.Services.Chat.Anthropic; -using ChatTailorAI.Shared.Models.Chat.Anthropic.Events; -using ChatTailorAI.Shared.Dto.Chat.Anthropic; -using ChatTailorAI.Shared.Models.Chat.Anthropic; -using ChatTailorAI.Shared.Models.Chat; -using Newtonsoft.Json; using System.IO; +using Newtonsoft.Json; using ChatTailorAI.Shared.Events; using ChatTailorAI.Shared.Models.Chat.Anthropic.Responses; using ChatTailorAI.Shared.Models.Chat.Anthropic.Requests; using ChatTailorAI.Shared.Models.Chat.Anthropic.Content; -using ChatTailorAI.Shared.Services.Chat; +using ChatTailorAI.Shared.Models.Settings; +using ChatTailorAI.Shared.Services.Common; +using ChatTailorAI.Shared.Services.Events; +using ChatTailorAI.Shared.Services.Chat.Anthropic; +using ChatTailorAI.Shared.Models.Chat.Anthropic.Events; +using ChatTailorAI.Shared.Dto.Chat.Anthropic; +using ChatTailorAI.Shared.Models.Chat.Anthropic; namespace ChatTailorAI.Services.Chat.Anthropic { - public class AnthropicClaudeChatService : IAnthropicChatService + public class AnthropicChatService : IAnthropicChatService { private readonly IUserSettingsService _userSettingsService; private readonly IAppSettingsService _appSettingsService; - private IEventAggregator _eventAggregator; + private readonly IEventAggregator _eventAggregator; private readonly HttpClient _httpClient; private CancellationTokenSource _cancellationTokenSource; - public AnthropicClaudeChatService( + public AnthropicChatService( IUserSettingsService userSettingsService, IAppSettingsService appSettingsService, IEventAggregator eventAggregator, @@ -176,8 +171,10 @@ public async Task GenerateChatResponseAsync(AnthropicC private async Task SendMessagesRequest(AnthropicMessagesRequest body, string endpoint, CancellationTokenSource cancellationTokenSource) { - var request = new HttpRequestMessage(HttpMethod.Post, endpoint); - request.Content = new StringContent(JsonConvert.SerializeObject(body), Encoding.UTF8, "application/json"); + var request = new HttpRequestMessage(HttpMethod.Post, endpoint) + { + Content = new StringContent(JsonConvert.SerializeObject(body), Encoding.UTF8, "application/json") + }; var response = await _httpClient.SendAsync(request, cancellationTokenSource.Token); return response; diff --git a/src/ChatTailorAI.Services/Chat/ChatFileService.cs b/src/ChatTailorAI.Services/Chat/ChatFileService.cs index a214e72..0bbe5c2 100644 --- a/src/ChatTailorAI.Services/Chat/ChatFileService.cs +++ b/src/ChatTailorAI.Services/Chat/ChatFileService.cs @@ -1,11 +1,10 @@ -using ChatTailorAI.Shared.Dto.Chat; -using ChatTailorAI.Shared.Models.Chat.OpenAI; -using ChatTailorAI.Shared.Services.Chat; -using ChatTailorAI.Shared.Services.Files; -using System; +using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto.Chat; +using ChatTailorAI.Shared.Services.Chat; +using ChatTailorAI.Shared.Services.Files; namespace ChatTailorAI.Services.Chat { diff --git a/src/ChatTailorAI.Services/Chat/ChatService.cs b/src/ChatTailorAI.Services/Chat/ChatService.cs index 8b8079c..5df0e55 100644 --- a/src/ChatTailorAI.Services/Chat/ChatService.cs +++ b/src/ChatTailorAI.Services/Chat/ChatService.cs @@ -1,10 +1,4 @@ -using ChatTailorAI.Shared.Dto.Chat; -using ChatTailorAI.Shared.Models.Chat; -using ChatTailorAI.Shared.Services.Chat.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; +using ChatTailorAI.Shared.Services.Chat.OpenAI; namespace ChatTailorAI.Services.Chat { @@ -24,4 +18,4 @@ public ChatService( // return response; //} } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Services/Chat/Google/GoogleGeminiChatService.cs b/src/ChatTailorAI.Services/Chat/Google/GoogleChatService.cs similarity index 96% rename from src/ChatTailorAI.Services/Chat/Google/GoogleGeminiChatService.cs rename to src/ChatTailorAI.Services/Chat/Google/GoogleChatService.cs index 3bc16e1..385e2fb 100644 --- a/src/ChatTailorAI.Services/Chat/Google/GoogleGeminiChatService.cs +++ b/src/ChatTailorAI.Services/Chat/Google/GoogleChatService.cs @@ -1,7 +1,15 @@ -using ChatTailorAI.Shared.Dto.Chat.Anthropic; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Newtonsoft.Json; +using ChatTailorAI.Shared.Dto.Chat.Anthropic; using ChatTailorAI.Shared.Dto.Chat.Google; using ChatTailorAI.Shared.Events; -using ChatTailorAI.Shared.Models.Chat.Anthropic.Requests; using ChatTailorAI.Shared.Models.Chat.Google; using ChatTailorAI.Shared.Models.Chat.Google.Content; using ChatTailorAI.Shared.Models.Chat.Google.Requests; @@ -10,15 +18,6 @@ using ChatTailorAI.Shared.Services.Chat.Google; using ChatTailorAI.Shared.Services.Common; using ChatTailorAI.Shared.Services.Events; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Text; -using System.Threading; -using System.Threading.Tasks; namespace ChatTailorAI.Services.Chat.Google { @@ -45,11 +44,11 @@ public class ModelSetting public double Temperature { get; set; } } - public class GoogleGeminiChatService : IGoogleChatService + public class GoogleChatService : IGoogleChatService { private readonly IUserSettingsService _userSettingsService; private readonly IAppSettingsService _appSettingsService; - private IEventAggregator _eventAggregator; + private readonly IEventAggregator _eventAggregator; private readonly HttpClient _httpClient; private CancellationTokenSource _cancellationTokenSource; @@ -74,7 +73,7 @@ public class GoogleGeminiChatService : IGoogleChatService private Dictionary modelSettings; - public GoogleGeminiChatService( + public GoogleChatService( IUserSettingsService userSettingsService, IAppSettingsService appSettingsService, IEventAggregator eventAggregator, @@ -251,10 +250,8 @@ public ModelSetting GetModelSetting(string key) { return modelSettings[key]; } - else - { - return null; - } + + return null; } public bool ValidateApiKey() diff --git a/src/ChatTailorAI.Services/Chat/LMStudio/LMStudioChatService.cs b/src/ChatTailorAI.Services/Chat/LMStudio/LMStudioChatService.cs index 1a5302d..301ca66 100644 --- a/src/ChatTailorAI.Services/Chat/LMStudio/LMStudioChatService.cs +++ b/src/ChatTailorAI.Services/Chat/LMStudio/LMStudioChatService.cs @@ -1,7 +1,16 @@ -using ChatTailorAI.Services.Events; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Newtonsoft.Json; using ChatTailorAI.Shared.Dto.Chat.LMStudio; using ChatTailorAI.Shared.Events; -using ChatTailorAI.Shared.Events.EventArgs; using ChatTailorAI.Shared.Models.Chat.LMStudio; using ChatTailorAI.Shared.Models.Chat.LMStudio.Requests; using ChatTailorAI.Shared.Models.Chat.LMStudio.Responses; @@ -11,20 +20,6 @@ using ChatTailorAI.Shared.Services.Common; using ChatTailorAI.Shared.Services.Events; using ChatTailorAI.Shared.Services.Tools; -using ChatTailorAI.Shared.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Reflection; -using System.Text; -using System.Threading; -using System.Threading.Tasks; namespace ChatTailorAI.Services.Chat.LMStudio { @@ -82,7 +77,6 @@ public async Task GenerateChatResponseAsync(LMStudioCha }); } - // Split @lmstudio/ off the front of model name chatRequest.Model = chatRequest.Model.Replace("@lmstudio/", ""); var body = new LMStudioChatCompletionRequest @@ -124,7 +118,7 @@ public async Task GenerateChatResponseAsync(LMStudioCha if (chatCompletion == null || chatCompletion.Choices == null) { var parsedJson = JsonConvert.DeserializeObject(data); - throw new Exception($"{parsedJson.error.message}"); + throw new Exception($"{parsedJson.Error.Message}"); } // Process delta based on the type @@ -221,13 +215,11 @@ private List ProcessModelNames(List modelNames) { return modelNames.Select(modelName => { - // Split the model name by '/' var parts = modelName.Split('/'); // Remove the last part (which contains the .gguf extension) and join the rest var processedName = string.Join("/", parts.Take(parts.Length - 1)); - // Prepend @lmstudio/ to the processed name return $"@lmstudio/{processedName}"; }).ToList(); } @@ -240,14 +232,14 @@ public void CancelStream() public class ErrorModel { - public string message { get; set; } - public string type { get; set; } - public object param { get; set; } - public object code { get; set; } + public string Message { get; set; } + public string Type { get; set; } + public object Param { get; set; } + public object Code { get; set; } } public class Root { - public ErrorModel error { get; set; } + public ErrorModel Error { get; set; } } } \ No newline at end of file diff --git a/src/ChatTailorAI.Services/Chat/OpenAI/OpenAIChatService.cs b/src/ChatTailorAI.Services/Chat/OpenAI/OpenAIChatService.cs index ab8020b..133f88c 100644 --- a/src/ChatTailorAI.Services/Chat/OpenAI/OpenAIChatService.cs +++ b/src/ChatTailorAI.Services/Chat/OpenAI/OpenAIChatService.cs @@ -1,4 +1,16 @@ -using ChatTailorAI.Shared.Dto.Chat.OpenAI; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using ChatTailorAI.Shared.Dto.Chat.OpenAI; using ChatTailorAI.Shared.Events; using ChatTailorAI.Shared.Events.EventArgs; using ChatTailorAI.Shared.Models.Chat.OpenAI; @@ -11,18 +23,7 @@ using ChatTailorAI.Shared.Services.Common; using ChatTailorAI.Shared.Services.Events; using ChatTailorAI.Shared.Services.Tools; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Text; -using System.Threading; -using System.Threading.Tasks; + namespace ChatTailorAI.Services.Chat.OpenAI { @@ -60,15 +61,16 @@ public OpenAIChatService( _appSettingsService.OpenAiApiKey : _userSettingsService.Get(UserSettings.OpenAiApiKey); - client = new HttpClient { Timeout = TimeSpan.FromMinutes(4) }; - client.BaseAddress = new Uri("https://api.openai.com/"); - client.Timeout = TimeSpan.FromMinutes(4); + client = new HttpClient + { + Timeout = TimeSpan.FromMinutes(4), + BaseAddress = new Uri("https://api.openai.com/") + }; client.DefaultRequestHeaders.Clear(); client.DefaultRequestHeaders.Add("Authorization", $"Bearer {openAiApiKey}"); _httpClient = client; _functions = RetrieveSelectedFunctions(); - _cancellationTokenSource = new CancellationTokenSource(); } diff --git a/src/ChatTailorAI.Services/Common/KeyManager.cs b/src/ChatTailorAI.Services/Common/KeyManager.cs index 9c7a894..1fb92e3 100644 --- a/src/ChatTailorAI.Services/Common/KeyManager.cs +++ b/src/ChatTailorAI.Services/Common/KeyManager.cs @@ -1,8 +1,8 @@ -using ChatTailorAI.Shared.Events; +using System.Collections.Generic; +using ChatTailorAI.Shared.Events; using ChatTailorAI.Shared.Models.Settings; using ChatTailorAI.Shared.Services.Common; using ChatTailorAI.Shared.Services.Events; -using System.Collections.Generic; namespace ChatTailorAI.Services.Common { diff --git a/src/ChatTailorAI.Services/Common/ModelManagerService.cs b/src/ChatTailorAI.Services/Common/ModelManagerService.cs index fabe412..e48a594 100644 --- a/src/ChatTailorAI.Services/Common/ModelManagerService.cs +++ b/src/ChatTailorAI.Services/Common/ModelManagerService.cs @@ -1,10 +1,10 @@ -using ChatTailorAI.Shared.Resources; -using ChatTailorAI.Shared.Services.Chat.LMStudio; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using ChatTailorAI.Shared.Services.Common; +using ChatTailorAI.Shared.Resources; +using ChatTailorAI.Shared.Services.Chat.LMStudio; namespace ChatTailorAI.Services.Common { diff --git a/src/ChatTailorAI.Services/DataService/AssistantDataService.cs b/src/ChatTailorAI.Services/DataService/AssistantDataService.cs index 71938f7..3216d97 100644 --- a/src/ChatTailorAI.Services/DataService/AssistantDataService.cs +++ b/src/ChatTailorAI.Services/DataService/AssistantDataService.cs @@ -1,13 +1,10 @@ -using ChatTailorAI.Shared.Dto; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto; using ChatTailorAI.Shared.Mappers.Interfaces; -using ChatTailorAI.Shared.Models.Assistants; using ChatTailorAI.Shared.Repositories; using ChatTailorAI.Shared.Services.DataServices; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.Services.DataService { diff --git a/src/ChatTailorAI.Services/DataService/ConversationDataService.cs b/src/ChatTailorAI.Services/DataService/ConversationDataService.cs index f9d15bf..d6002bb 100644 --- a/src/ChatTailorAI.Services/DataService/ConversationDataService.cs +++ b/src/ChatTailorAI.Services/DataService/ConversationDataService.cs @@ -1,15 +1,10 @@ -using ChatTailorAI.Shared.Dto; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; using ChatTailorAI.Shared.Dto.Conversations; using ChatTailorAI.Shared.Mappers.Interfaces; -using ChatTailorAI.Shared.Models.Assistants; -using ChatTailorAI.Shared.Models.Conversations; using ChatTailorAI.Shared.Services.Database.Repositories; using ChatTailorAI.Shared.Services.DataServices; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.Services.DataService { diff --git a/src/ChatTailorAI.Services/DataService/ImageDataService.cs b/src/ChatTailorAI.Services/DataService/ImageDataService.cs index 12f773d..5542625 100644 --- a/src/ChatTailorAI.Services/DataService/ImageDataService.cs +++ b/src/ChatTailorAI.Services/DataService/ImageDataService.cs @@ -1,12 +1,10 @@ -using ChatTailorAI.Shared.Dto.Chat; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto.Chat; using ChatTailorAI.Shared.Mappers.Interfaces; using ChatTailorAI.Shared.Repositories; using ChatTailorAI.Shared.Services.DataServices; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.Services.DataService { diff --git a/src/ChatTailorAI.Services/DataService/MessageDataService.cs b/src/ChatTailorAI.Services/DataService/MessageDataService.cs index d320da5..b4a1664 100644 --- a/src/ChatTailorAI.Services/DataService/MessageDataService.cs +++ b/src/ChatTailorAI.Services/DataService/MessageDataService.cs @@ -1,12 +1,11 @@ -using ChatTailorAI.Shared.Dto.Chat; -using ChatTailorAI.Shared.Mappers.Interfaces; -using ChatTailorAI.Shared.Services.Database.Repositories; -using ChatTailorAI.Shared.Services.DataServices; -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto.Chat; +using ChatTailorAI.Shared.Mappers.Interfaces; +using ChatTailorAI.Shared.Services.Database.Repositories; +using ChatTailorAI.Shared.Services.DataServices; namespace ChatTailorAI.Services.DataService { diff --git a/src/ChatTailorAI.Services/DataService/PromptDataService.cs b/src/ChatTailorAI.Services/DataService/PromptDataService.cs index 496dd42..26dd60c 100644 --- a/src/ChatTailorAI.Services/DataService/PromptDataService.cs +++ b/src/ChatTailorAI.Services/DataService/PromptDataService.cs @@ -1,13 +1,10 @@ -using ChatTailorAI.Shared.Dto; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto; using ChatTailorAI.Shared.Mappers.Interfaces; -using ChatTailorAI.Shared.Models.Prompts; using ChatTailorAI.Shared.Repositories; using ChatTailorAI.Shared.Services.DataServices; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.Services.DataServices { diff --git a/src/ChatTailorAI.Services/Events/EventAggregator.cs b/src/ChatTailorAI.Services/Events/EventAggregator.cs index 495e051..3186555 100644 --- a/src/ChatTailorAI.Services/Events/EventAggregator.cs +++ b/src/ChatTailorAI.Services/Events/EventAggregator.cs @@ -1,10 +1,7 @@ -using ChatTailorAI.Shared.Dto.Chat.OpenAI; +using System; using ChatTailorAI.Shared.Events; using ChatTailorAI.Shared.Events.EventArgs; -using ChatTailorAI.Shared.Models.Chat.OpenAI; using ChatTailorAI.Shared.Services.Events; -using System; -using System.Collections.Generic; namespace ChatTailorAI.Services.Events { diff --git a/src/ChatTailorAI.Services/Events/GenericEventAggregator.cs b/src/ChatTailorAI.Services/Events/GenericEventAggregator.cs index 73faf53..bf18d0f 100644 --- a/src/ChatTailorAI.Services/Events/GenericEventAggregator.cs +++ b/src/ChatTailorAI.Services/Events/GenericEventAggregator.cs @@ -1,7 +1,6 @@ -using ChatTailorAI.Shared.Services.Events; -using System; +using System; using System.Collections.Generic; -using System.Text; +using ChatTailorAI.Shared.Services.Events; namespace ChatTailorAI.Services.Events { diff --git a/src/ChatTailorAI.Services/Image/ImageGenerationService.cs b/src/ChatTailorAI.Services/Image/ImageService.cs similarity index 80% rename from src/ChatTailorAI.Services/Image/ImageGenerationService.cs rename to src/ChatTailorAI.Services/Image/ImageService.cs index afafebb..076f12d 100644 --- a/src/ChatTailorAI.Services/Image/ImageGenerationService.cs +++ b/src/ChatTailorAI.Services/Image/ImageService.cs @@ -1,34 +1,31 @@ -using ChatTailorAI.Shared.Dto; -using ChatTailorAI.Shared.Models.Image; +using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto; using ChatTailorAI.Shared.Models.Image.OpenAI; +using ChatTailorAI.Shared.Models.Image; +using ChatTailorAI.Shared.Services.Image; using ChatTailorAI.Shared.Models.Settings; using ChatTailorAI.Shared.Services.Common; -using ChatTailorAI.Shared.Services.Image; -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.Services.Image { - public class ImageGenerationService : IImageGenerationService + public class ImageService : IImageService { + private readonly IImageGenerationService _generationService; private readonly IUserSettingsService _userSettingsService; - private readonly IDalleImageService _dalleImageService; - public ImageGenerationService( - IUserSettingsService userSettingsService, - IDalleImageService dalleImageService) + public ImageService( + IImageGenerationService generationService, + IUserSettingsService userSettingsService) { + _generationService = generationService; _userSettingsService = userSettingsService; - _dalleImageService = dalleImageService; } public async Task> GenerateImagesAsync(PromptDto imagePrompt) { // TODO: Update method to work with multiple image generation services (Dalle, StabilityAI, etc.) var openAIImageRequest = CreateImageRequest(imagePrompt); - var imageUrls = await _dalleImageService.GenerateImagesAsync(openAIImageRequest); + var imageUrls = await _generationService.GenerateImagesAsync(openAIImageRequest); return new ImageGenerationResponse { @@ -41,7 +38,7 @@ private OpenAIImageGenerationRequest CreateImageRequest(PromptDto imagePrompt) { var imageModel = _userSettingsService.Get(UserSettings.ImageModel); var numberOfImages = imageModel.Equals("dall-e-3") - ? 1 // Only 1 supported at a time with Dalle3 + ? 1 // Only 1 supported at a time with Dalle3 : int.Parse(_userSettingsService.Get(UserSettings.ImageCount)); var imageQuality = imageModel.Equals("dall-e-3") ? _userSettingsService.Get(UserSettings.ImageQuality) diff --git a/src/ChatTailorAI.Services/Image/DalleImageService.cs b/src/ChatTailorAI.Services/Image/OpenAI/OpenAIDalleImageService.cs similarity index 91% rename from src/ChatTailorAI.Services/Image/DalleImageService.cs rename to src/ChatTailorAI.Services/Image/OpenAI/OpenAIDalleImageService.cs index 7189f89..99e39c3 100644 --- a/src/ChatTailorAI.Services/Image/DalleImageService.cs +++ b/src/ChatTailorAI.Services/Image/OpenAI/OpenAIDalleImageService.cs @@ -1,4 +1,10 @@ -using ChatTailorAI.Services.Events; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; using ChatTailorAI.Shared.Events; using ChatTailorAI.Shared.Events.EventArgs; using ChatTailorAI.Shared.Models.Image.OpenAI; @@ -6,29 +12,21 @@ using ChatTailorAI.Shared.Services.Common; using ChatTailorAI.Shared.Services.Events; using ChatTailorAI.Shared.Services.Image; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; -using static System.Net.WebRequestMethods; -namespace ChatTailorAI.Services.Image +namespace ChatTailorAI.Services.Image.OpenAI { - public class DalleImageService : IDalleImageService + public class OpenAIDalleImageService : IImageGenerationService { private static HttpClient _httpClient; private readonly IAppSettingsService _appSettingsService; - private IUserSettingsService _userSettingsService; + private readonly IUserSettingsService _userSettingsService; private readonly IEventAggregator _eventAggregator; - private string[] models; - private Dictionary> modelImageSizes; + private readonly string[] models; + private readonly Dictionary> modelImageSizes; private readonly string dalleBaseUrl = "https://api.openai.com/"; - public DalleImageService( + public OpenAIDalleImageService( IAppSettingsService appSettingsService, IUserSettingsService userSettingsService, IEventAggregator eventAggregator, diff --git a/src/ChatTailorAI.Services/Prompts/PromptService.cs b/src/ChatTailorAI.Services/Prompts/PromptService.cs deleted file mode 100644 index aff31cc..0000000 --- a/src/ChatTailorAI.Services/Prompts/PromptService.cs +++ /dev/null @@ -1,54 +0,0 @@ -using ChatTailorAI.Shared.Dto; -using ChatTailorAI.Shared.Models.Prompts; -using ChatTailorAI.Shared.Services.DataServices; -using ChatTailorAI.Shared.Services.Files; -using ChatTailorAI.Shared.Services.Prompts; -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; - -namespace ChatTailorAI.Services.Prompts -{ - public class PromptService : IPromptService - { - private readonly IPromptDataService _promptDataService; - private readonly IFileService _fileService; - - public PromptService( - IPromptDataService promptDataService, - IFileService fileService) - { - _promptDataService = promptDataService; - _fileService = fileService; - } - - public async Task MigratePromptsAsync() - { - try - { - bool fileExists = await _fileService.CheckIfFileExists("prompts.json"); - if (fileExists == false) - { - return; - } - - var legacyPromptsFromFile = await _fileService.ReadPromptsFromFileAsync(); - await _fileService.BackupPromptsAsync(); - - foreach (var legacyPrompt in legacyPromptsFromFile) - { - await _promptDataService.AddPromptAsync(legacyPrompt); - } - - await _fileService.DeletePromptsAsync(); - } - catch (Exception ex) - { - // Worse case scenario, we can't migrate the prompts - // We dont want to crash the app, so we just log the error - Console.Error.WriteLine(ex); - } - } - } -} diff --git a/src/ChatTailorAI.Services/Speech/AzureSpeechService.cs b/src/ChatTailorAI.Services/Speech/AzureSpeechService.cs index 294206d..ad649e0 100644 --- a/src/ChatTailorAI.Services/Speech/AzureSpeechService.cs +++ b/src/ChatTailorAI.Services/Speech/AzureSpeechService.cs @@ -1,24 +1,23 @@ -using ChatTailorAI.Shared.Models.Settings; -using ChatTailorAI.Shared.Models.Speech; -using ChatTailorAI.Shared.Services.Common; -using ChatTailorAI.Shared.Services.Speech; -using Microsoft.CognitiveServices.Speech; -using Microsoft.CognitiveServices.Speech.Audio; -using Newtonsoft.Json; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; -using System.Text; using System.Threading.Tasks; +using Microsoft.CognitiveServices.Speech; +using Microsoft.CognitiveServices.Speech.Audio; +using Newtonsoft.Json; +using ChatTailorAI.Shared.Models.Settings; +using ChatTailorAI.Shared.Models.Speech; +using ChatTailorAI.Shared.Services.Common; +using ChatTailorAI.Shared.Services.Speech; namespace ChatTailorAI.Services.Speech { public class AzureSpeechService : IAzureSpeechService { - private IUserSettingsService _userSettingsService; + private readonly IUserSettingsService _userSettingsService; + private readonly string[] models; private string _voiceName; - private string[] models; public AzureSpeechService( IUserSettingsService userSettingsService) @@ -27,7 +26,6 @@ public AzureSpeechService( _voiceName = _userSettingsService.Get(UserSettings.VoiceName); models = new string[] { "default" }; - } public string ServiceRegion @@ -73,6 +71,7 @@ public async Task> GetVoicesListAsync() { "Ocp-Apim-Subscription-Key", azureSpeechApiKey }, }, }; + using (var response = await client.SendAsync(request)) { response.EnsureSuccessStatusCode(); diff --git a/src/ChatTailorAI.Services/Speech/ElevenLabsSpeechService.cs b/src/ChatTailorAI.Services/Speech/ElevenLabsSpeechService.cs index d6ce020..20fdc73 100644 --- a/src/ChatTailorAI.Services/Speech/ElevenLabsSpeechService.cs +++ b/src/ChatTailorAI.Services/Speech/ElevenLabsSpeechService.cs @@ -1,14 +1,13 @@ -using ChatTailorAI.Shared.Models.Chat; -using ChatTailorAI.Shared.Models.Settings; -using ChatTailorAI.Shared.Services.Common; -using ChatTailorAI.Shared.Services.Speech; -using Newtonsoft.Json; -using System; +using System; using System.Collections.Generic; using System.IO; using System.Net.Http; using System.Text; using System.Threading.Tasks; +using Newtonsoft.Json; +using ChatTailorAI.Shared.Models.Settings; +using ChatTailorAI.Shared.Services.Common; +using ChatTailorAI.Shared.Services.Speech; namespace ChatTailorAI.Services.Speech { @@ -27,12 +26,11 @@ public class ElevenLabsVoiceSettings public class ElevenLabsSpeechService : IElevenLabsSpeechService { - private IAppSettingsService _appSettingsService; - private IUserSettingsService _userSettingsService; + private readonly IAppSettingsService _appSettingsService; + private readonly IUserSettingsService _userSettingsService; private static HttpClient _httpClient; - private string[] models; - private string[] voices; - + private readonly string[] models; + private readonly string[] voices; private readonly string elevenLabsApiUrl = "https://api.elevenlabs.io/"; public ElevenLabsSpeechService( @@ -43,8 +41,7 @@ public ElevenLabsSpeechService( _appSettingsService = appSettingsService; _userSettingsService = userSettingsService; - // TODO: Update with ones from ElevenLabs apis - + // TODO: Update with other valid models from ElevenLabs this.models = new string[] { "eleven_multilingual_v2" }; this.voices = new string[] { }; @@ -164,17 +161,23 @@ public Task> GetModelsListAsync() public async Task> GetVoiceNamesAsync() { - // TODO: Add error handling - var voicesList = await this.GetVoicesListAsync(); - var namesList = new List(); + try + { + var voicesList = await this.GetVoicesListAsync(); + var namesList = new List(); - foreach (var voice in voicesList) + foreach (var voice in voicesList) + { + string name = voice.name; + namesList.Add(name); + } + + return namesList; + } + catch (Exception ex) { - string name = voice.name; - namesList.Add(name); + throw new Exception($"Error while getting voice names: {ex.Message}", ex); } - - return namesList; } } } \ No newline at end of file diff --git a/src/ChatTailorAI.Services/Speech/OpenAISpeechService.cs b/src/ChatTailorAI.Services/Speech/OpenAISpeechService.cs index 40ad67f..bbecb47 100644 --- a/src/ChatTailorAI.Services/Speech/OpenAISpeechService.cs +++ b/src/ChatTailorAI.Services/Speech/OpenAISpeechService.cs @@ -1,23 +1,23 @@ -using ChatTailorAI.Shared.Models.Settings; -using ChatTailorAI.Shared.Services.Common; -using ChatTailorAI.Shared.Services.Speech; -using Newtonsoft.Json; -using System; +using System; using System.Collections.Generic; using System.IO; using System.Net.Http; using System.Text; using System.Threading.Tasks; +using Newtonsoft.Json; +using ChatTailorAI.Shared.Models.Settings; +using ChatTailorAI.Shared.Services.Common; +using ChatTailorAI.Shared.Services.Speech; namespace ChatTailorAI.Services.Speech { public class OpenAISpeechService : IOpenAISpeechService { - private IAppSettingsService _appSettingsService; - private IUserSettingsService _userSettingsService; + private readonly IAppSettingsService _appSettingsService; + private readonly IUserSettingsService _userSettingsService; private static HttpClient _httpClient; - private string[] models; - private string[] voices; + private readonly string[] models; + private readonly string[] voices; private readonly string openAISpeechApiUrl = "https://api.openai.com/"; diff --git a/src/ChatTailorAI.Services/Speech/SpeechService.cs b/src/ChatTailorAI.Services/Speech/SpeechService.cs index eb5af2f..8cd6e1c 100644 --- a/src/ChatTailorAI.Services/Speech/SpeechService.cs +++ b/src/ChatTailorAI.Services/Speech/SpeechService.cs @@ -1,5 +1,6 @@ using System; using System.Threading.Tasks; +using ChatTailorAI.Shared.Services.Audio; using ChatTailorAI.Shared.Services.Common; using ChatTailorAI.Shared.Services.Speech; @@ -35,8 +36,8 @@ public async Task ProcessTextToSpeech(string speechProvider, string text) switch (speechProvider) { case "azure": - // Azure lib uses built in .NET audio player await _azureSpeechService.SynthesizeSpeechAsync(text); + // Azure SDK uses built in .NET audio player, no need to use our custom audio player break; case "openai": var openAIStream = await _openAISpeechService.SynthesizeSpeechAsync(text); @@ -54,4 +55,4 @@ public async Task ProcessTextToSpeech(string speechProvider, string text) } } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Services/Speech/TranscriptionService.cs b/src/ChatTailorAI.Services/Speech/TranscriptionService.cs deleted file mode 100644 index ffcc56b..0000000 --- a/src/ChatTailorAI.Services/Speech/TranscriptionService.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ChatTailorAI.Services.Uwp.Audio -{ - public class TranscriptionService - { - public TranscriptionService() - { - - } - - public void TranscribeBuffer(byte[] audioBuffer) - { - - } - - public void TranscribeUrl(string url) - { - - } - } -} diff --git a/src/ChatTailorAI.Services/Speech/WhisperService.cs b/src/ChatTailorAI.Services/Speech/WhisperService.cs index 39fcf13..2a2b407 100644 --- a/src/ChatTailorAI.Services/Speech/WhisperService.cs +++ b/src/ChatTailorAI.Services/Speech/WhisperService.cs @@ -1,12 +1,7 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Net.Http.Headers; using System.Net.Http; -using System.Text; using System.Threading.Tasks; -using Newtonsoft.Json.Serialization; using Newtonsoft.Json; using ChatTailorAI.Shared.Models.Speech; using ChatTailorAI.Shared.Services.Common; @@ -17,11 +12,11 @@ namespace ChatTailorAI.Services.Speech { public class WhisperService : IWhisperService { - private string whisperApiUrl = "https://api.openai.com/"; - private string TRANSCRIPTION_API_ENDPOINT = "v1/audio/transcriptions"; - private string TRANSLATION_API_ENDPOINT = "v1/audio/translations"; - private IAppSettingsService _appSettingsService; - private IUserSettingsService _userSettingsService; + private readonly string whisperApiUrl = "https://api.openai.com/"; + private readonly string TRANSCRIPTION_API_ENDPOINT = "v1/audio/transcriptions"; + private readonly string TRANSLATION_API_ENDPOINT = "v1/audio/translations"; + private readonly IAppSettingsService _appSettingsService; + private readonly IUserSettingsService _userSettingsService; private static HttpClient _httpClient; public WhisperService( @@ -110,4 +105,4 @@ public async Task StreamToBuffer(Stream stream) } } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Services/Tools/Executors/FunctionToolExecutorService.cs b/src/ChatTailorAI.Services/Tools/Executors/FunctionToolExecutorService.cs index 8971c81..a4beab9 100644 --- a/src/ChatTailorAI.Services/Tools/Executors/FunctionToolExecutorService.cs +++ b/src/ChatTailorAI.Services/Tools/Executors/FunctionToolExecutorService.cs @@ -1,9 +1,8 @@ -using ChatTailorAI.Shared.Services.Common; -using ChatTailorAI.Shared.Services.Tools; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using ChatTailorAI.Shared.Services.Tools; namespace ChatTailorAI.Services.Tools.Executors { diff --git a/src/ChatTailorAI.Services/Tools/SpotifyService.cs b/src/ChatTailorAI.Services/Tools/SpotifyService.cs index 2ca03c4..c996063 100644 --- a/src/ChatTailorAI.Services/Tools/SpotifyService.cs +++ b/src/ChatTailorAI.Services/Tools/SpotifyService.cs @@ -1,16 +1,16 @@ -using ChatTailorAI.Shared.Models.Audio; -using ChatTailorAI.Shared.Services.Common; -using Newtonsoft.Json; -using System; +using System; using System.Collections.Generic; -using System.Diagnostics; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Text; using System.Threading.Tasks; using System.Web; +using Newtonsoft.Json; //using Windows.Security.Authentication.Web; // Broker not working in UWP +using ChatTailorAI.Shared.Models.Audio; +using ChatTailorAI.Shared.Services.Common; +using ChatTailorAI.Shared.Services.Tools; namespace ChatTailorAI.Services.Tools { diff --git a/src/ChatTailorAI.Shared/Base/Observable.cs b/src/ChatTailorAI.Shared/Base/Observable.cs index 91087f3..ed451d1 100644 --- a/src/ChatTailorAI.Shared/Base/Observable.cs +++ b/src/ChatTailorAI.Shared/Base/Observable.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel; using System.Runtime.CompilerServices; @@ -38,4 +37,4 @@ protected bool SetProperty(ref T field, T newValue, [CallerMemberName] string return false; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Base/RelayCommand.cs b/src/ChatTailorAI.Shared/Base/RelayCommand.cs index a4b4590..975bc0a 100644 --- a/src/ChatTailorAI.Shared/Base/RelayCommand.cs +++ b/src/ChatTailorAI.Shared/Base/RelayCommand.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Input; namespace ChatTailorAI.Shared.Base diff --git a/src/ChatTailorAI.Shared/Builders/AnthropicChatRequestBuilder.cs b/src/ChatTailorAI.Shared/Builders/AnthropicChatRequestBuilder.cs index f092b72..720c568 100644 --- a/src/ChatTailorAI.Shared/Builders/AnthropicChatRequestBuilder.cs +++ b/src/ChatTailorAI.Shared/Builders/AnthropicChatRequestBuilder.cs @@ -1,9 +1,7 @@ -using ChatTailorAI.Shared.Dto.Chat.Anthropic; -using ChatTailorAI.Shared.Models.Chat.Anthropic; -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Text; +using ChatTailorAI.Shared.Dto.Chat.Anthropic; +using ChatTailorAI.Shared.Models.Chat.Anthropic; namespace ChatTailorAI.Shared.Builders { diff --git a/src/ChatTailorAI.Shared/Builders/GoogleChatRequestBuilder.cs b/src/ChatTailorAI.Shared/Builders/GoogleChatRequestBuilder.cs index 91e7c5c..c6e8cd9 100644 --- a/src/ChatTailorAI.Shared/Builders/GoogleChatRequestBuilder.cs +++ b/src/ChatTailorAI.Shared/Builders/GoogleChatRequestBuilder.cs @@ -1,11 +1,7 @@ -using ChatTailorAI.Shared.Dto.Chat.Anthropic; +using System.Collections.Generic; +using System.Linq; using ChatTailorAI.Shared.Dto.Chat.Google; -using ChatTailorAI.Shared.Models.Chat.Anthropic; using ChatTailorAI.Shared.Models.Chat.Google; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; namespace ChatTailorAI.Shared.Builders { @@ -27,4 +23,4 @@ public object BuildChatRequest(string model, string instructions, IEnumerable + /// Interface for chat request builders. + /// public interface IChatRequestBuilder { + /// + /// Builds a chat request. + /// + /// + /// + /// + /// + /// object BuildChatRequest(string model, string instructions, IEnumerable messages, object settings); } - - //public interface IChatRequestBuilder - //{ - // ChatRequest BuildChatRequest(string model, string instructions, IEnumerable messages, ChatSettings settings); - //} - - //public interface IChatRequestBuilder - // where TChatRequest : ChatRequest - //{ - // TChatRequest BuildChatRequest(string model, string instructions, IEnumerable messages, TSettings settings); - //} - - //public interface IChatRequestBuilder - // where TChatRequest : ChatRequest - // where TMessage : IChatModelMessage - // where TSettings : ChatSettings - //{ - // TChatRequest BuildChatRequest(string model, string instructions, IEnumerable messages, TSettings settings); - //} -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Builders/LMStudioChatRequestBuilder.cs b/src/ChatTailorAI.Shared/Builders/LMStudioChatRequestBuilder.cs index 31afe50..70ae6fe 100644 --- a/src/ChatTailorAI.Shared/Builders/LMStudioChatRequestBuilder.cs +++ b/src/ChatTailorAI.Shared/Builders/LMStudioChatRequestBuilder.cs @@ -1,9 +1,7 @@ -using ChatTailorAI.Shared.Dto.Chat.LMStudio; -using ChatTailorAI.Shared.Models.Chat.LMStudio; -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Text; +using ChatTailorAI.Shared.Dto.Chat.LMStudio; +using ChatTailorAI.Shared.Models.Chat.LMStudio; namespace ChatTailorAI.Shared.Builders { @@ -25,4 +23,4 @@ public object BuildChatRequest(string model, string instructions, IEnumerable - //{ - // public OpenAIChatRequest BuildChatRequest(string model, string instructions, IEnumerable messages, OpenAIChatSettings settings) - // { - // var openAIChatRequest = new OpenAIChatRequest - // { - // Model = model, - // Instructions = instructions, - // Messages = messages.ToList(), - // Settings = settings - // }; - - // return openAIChatRequest; - // } - //} - - //public class OpenAIChatRequestBuilder : IChatRequestBuilder - //{ - // public OpenAIChatRequest BuildChatRequest(string model, string instructions, IEnumerable messages, OpenAIChatSettings settings) - // { - // var openAIChatRequest = new OpenAIChatRequest - // { - // Model = model, - // Instructions = instructions, - // Messages = messages.ToList(), - // Settings = settings - // }; - - // return openAIChatRequest; - // } - //} } diff --git a/src/ChatTailorAI.Shared/Dto/AssistantDTO.cs b/src/ChatTailorAI.Shared/Dto/AssistantDTO.cs index e9795fc..a024ec3 100644 --- a/src/ChatTailorAI.Shared/Dto/AssistantDTO.cs +++ b/src/ChatTailorAI.Shared/Dto/AssistantDTO.cs @@ -1,8 +1,6 @@ using ChatTailorAI.Shared.Models.Assistants; using ChatTailorAI.Shared.Models.Tools; -using System; using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Dto { diff --git a/src/ChatTailorAI.Shared/Dto/Chat/Anthropic/AnthropicBaseChatMessageDto.cs b/src/ChatTailorAI.Shared/Dto/Chat/Anthropic/AnthropicBaseChatMessageDto.cs index f15438f..64ca572 100644 --- a/src/ChatTailorAI.Shared/Dto/Chat/Anthropic/AnthropicBaseChatMessageDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Chat/Anthropic/AnthropicBaseChatMessageDto.cs @@ -1,9 +1,5 @@ -using ChatTailorAI.Shared.Models.Chat; -using ChatTailorAI.Shared.Models.Chat.OpenAI; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; +using Newtonsoft.Json; +using ChatTailorAI.Shared.Models.Chat; namespace ChatTailorAI.Shared.Dto.Chat.Anthropic { diff --git a/src/ChatTailorAI.Shared/Dto/Chat/Anthropic/AnthropicChatResponseDto.cs b/src/ChatTailorAI.Shared/Dto/Chat/Anthropic/AnthropicChatResponseDto.cs index e3aa96e..745bedc 100644 --- a/src/ChatTailorAI.Shared/Dto/Chat/Anthropic/AnthropicChatResponseDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Chat/Anthropic/AnthropicChatResponseDto.cs @@ -1,11 +1,4 @@ -using ChatTailorAI.Shared.Dto.Chat.OpenAI; -using ChatTailorAI.Shared.Models.Chat.OpenAI; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Dto.Chat.Anthropic +namespace ChatTailorAI.Shared.Dto.Chat.Anthropic { public class AnthropicChatResponseDto : ChatResponseDto { diff --git a/src/ChatTailorAI.Shared/Dto/Chat/ChatErrorMessageDto.cs b/src/ChatTailorAI.Shared/Dto/Chat/ChatErrorMessageDto.cs index 4247c14..25a3eec 100644 --- a/src/ChatTailorAI.Shared/Dto/Chat/ChatErrorMessageDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Chat/ChatErrorMessageDto.cs @@ -1,11 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Dto.Chat +namespace ChatTailorAI.Shared.Dto.Chat { public class ChatErrorMessageDto : ChatMessageDto { public string ErrorMessage { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Dto/Chat/ChatImageDto.cs b/src/ChatTailorAI.Shared/Dto/Chat/ChatImageDto.cs index 5008217..a1ab942 100644 --- a/src/ChatTailorAI.Shared/Dto/Chat/ChatImageDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Chat/ChatImageDto.cs @@ -1,7 +1,5 @@ -using ChatTailorAI.Shared.Models.Chat; -using System; -using System.Collections.Generic; -using System.Text; +using System; +using ChatTailorAI.Shared.Models.Chat; namespace ChatTailorAI.Shared.Dto.Chat { diff --git a/src/ChatTailorAI.Shared/Dto/Chat/ChatImageMessageDto.cs b/src/ChatTailorAI.Shared/Dto/Chat/ChatImageMessageDto.cs index 9be782a..3eb87aa 100644 --- a/src/ChatTailorAI.Shared/Dto/Chat/ChatImageMessageDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Chat/ChatImageMessageDto.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; namespace ChatTailorAI.Shared.Dto.Chat { diff --git a/src/ChatTailorAI.Shared/Dto/Chat/ChatMessageDto.cs b/src/ChatTailorAI.Shared/Dto/Chat/ChatMessageDto.cs index cc03e81..08049dd 100644 --- a/src/ChatTailorAI.Shared/Dto/Chat/ChatMessageDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Chat/ChatMessageDto.cs @@ -1,8 +1,5 @@ -using ChatTailorAI.Shared.Dto.Conversations; -using ChatTailorAI.Shared.Models.Chat; +using ChatTailorAI.Shared.Models.Chat; using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Dto.Chat { diff --git a/src/ChatTailorAI.Shared/Dto/Chat/ChatRequestDto.cs b/src/ChatTailorAI.Shared/Dto/Chat/ChatRequestDto.cs index f04e488..5429861 100644 --- a/src/ChatTailorAI.Shared/Dto/Chat/ChatRequestDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Chat/ChatRequestDto.cs @@ -1,7 +1,4 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; namespace ChatTailorAI.Shared.Dto.Chat { @@ -15,4 +12,4 @@ public class ChatRequestDto public TSettingsDto Settings { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Dto/Chat/ChatResponseDto.cs b/src/ChatTailorAI.Shared/Dto/Chat/ChatResponseDto.cs index d9d14c6..5bad6e3 100644 --- a/src/ChatTailorAI.Shared/Dto/Chat/ChatResponseDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Chat/ChatResponseDto.cs @@ -1,7 +1,4 @@ using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Dto.Chat { diff --git a/src/ChatTailorAI.Shared/Dto/Chat/ChatSettingsDto.cs b/src/ChatTailorAI.Shared/Dto/Chat/ChatSettingsDto.cs index 14c3bce..db29cc7 100644 --- a/src/ChatTailorAI.Shared/Dto/Chat/ChatSettingsDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Chat/ChatSettingsDto.cs @@ -1,7 +1,5 @@ -using ChatTailorAI.Shared.Models.Chat; -using System; -using System.Collections.Generic; -using System.Text; +using System; +using ChatTailorAI.Shared.Models.Chat; namespace ChatTailorAI.Shared.Dto.Chat { diff --git a/src/ChatTailorAI.Shared/Dto/Chat/Google/GoogleBaseChatMessageDto.cs b/src/ChatTailorAI.Shared/Dto/Chat/Google/GoogleBaseChatMessageDto.cs index f88e2fc..ea68f36 100644 --- a/src/ChatTailorAI.Shared/Dto/Chat/Google/GoogleBaseChatMessageDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Chat/Google/GoogleBaseChatMessageDto.cs @@ -1,9 +1,5 @@ -using ChatTailorAI.Shared.Dto.Chat.Anthropic; +using Newtonsoft.Json; using ChatTailorAI.Shared.Models.Chat; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Dto.Chat.Google { diff --git a/src/ChatTailorAI.Shared/Dto/Chat/Google/GoogleChatResponseDto.cs b/src/ChatTailorAI.Shared/Dto/Chat/Google/GoogleChatResponseDto.cs index 98b3375..f138f5e 100644 --- a/src/ChatTailorAI.Shared/Dto/Chat/Google/GoogleChatResponseDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Chat/Google/GoogleChatResponseDto.cs @@ -1,12 +1,7 @@ -using ChatTailorAI.Shared.Dto.Chat.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Dto.Chat.Google +namespace ChatTailorAI.Shared.Dto.Chat.Google { public class GoogleChatResponseDto : ChatResponseDto { // No need for JsonIgnore attributes, ViewModel-specific properties, or OnPropertyChanged } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Dto/Chat/LMStudio/LMStudioBaseChatMessageDto.cs b/src/ChatTailorAI.Shared/Dto/Chat/LMStudio/LMStudioBaseChatMessageDto.cs index a34d85b..f5078bd 100644 --- a/src/ChatTailorAI.Shared/Dto/Chat/LMStudio/LMStudioBaseChatMessageDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Chat/LMStudio/LMStudioBaseChatMessageDto.cs @@ -1,8 +1,5 @@ -using ChatTailorAI.Shared.Models.Chat; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; +using Newtonsoft.Json; +using ChatTailorAI.Shared.Models.Chat; namespace ChatTailorAI.Shared.Dto.Chat.LMStudio { diff --git a/src/ChatTailorAI.Shared/Dto/Chat/LMStudio/LMStudioChatRequestDto.cs b/src/ChatTailorAI.Shared/Dto/Chat/LMStudio/LMStudioChatRequestDto.cs index 716e0af..a2f0c24 100644 --- a/src/ChatTailorAI.Shared/Dto/Chat/LMStudio/LMStudioChatRequestDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Chat/LMStudio/LMStudioChatRequestDto.cs @@ -1,9 +1,4 @@ -using ChatTailorAI.Shared.Dto.Chat.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Dto.Chat.LMStudio +namespace ChatTailorAI.Shared.Dto.Chat.LMStudio { public class LMStudioChatRequestDto : ChatRequestDto { diff --git a/src/ChatTailorAI.Shared/Dto/Chat/LMStudio/LMStudioChatSettingsDto.cs b/src/ChatTailorAI.Shared/Dto/Chat/LMStudio/LMStudioChatSettingsDto.cs index d013324..c3a7fdb 100644 --- a/src/ChatTailorAI.Shared/Dto/Chat/LMStudio/LMStudioChatSettingsDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Chat/LMStudio/LMStudioChatSettingsDto.cs @@ -1,7 +1,5 @@ -using ChatTailorAI.Shared.Models.Chat.LMStudio; -using System; -using System.Collections.Generic; -using System.Text; +using System; +using ChatTailorAI.Shared.Models.Chat.LMStudio; namespace ChatTailorAI.Shared.Dto.Chat.LMStudio { diff --git a/src/ChatTailorAI.Shared/Dto/Chat/OpenAI/OpenAIBaseChatMessageDto.cs b/src/ChatTailorAI.Shared/Dto/Chat/OpenAI/OpenAIBaseChatMessageDto.cs index a5ea398..953e196 100644 --- a/src/ChatTailorAI.Shared/Dto/Chat/OpenAI/OpenAIBaseChatMessageDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Chat/OpenAI/OpenAIBaseChatMessageDto.cs @@ -1,9 +1,6 @@ -using ChatTailorAI.Shared.Models.Chat; +using Newtonsoft.Json; +using ChatTailorAI.Shared.Models.Chat; using ChatTailorAI.Shared.Models.Chat.OpenAI.Responses; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Dto.Chat.OpenAI { diff --git a/src/ChatTailorAI.Shared/Dto/Chat/OpenAI/OpenAIChatCompletionRequestDto.cs b/src/ChatTailorAI.Shared/Dto/Chat/OpenAI/OpenAIChatCompletionRequestDto.cs index 161ce72..eed2c0c 100644 --- a/src/ChatTailorAI.Shared/Dto/Chat/OpenAI/OpenAIChatCompletionRequestDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Chat/OpenAI/OpenAIChatCompletionRequestDto.cs @@ -1,7 +1,5 @@ -using ChatTailorAI.Shared.Models.Tools; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; +using ChatTailorAI.Shared.Models.Tools; namespace ChatTailorAI.Shared.Dto.Chat.OpenAI { @@ -26,4 +24,4 @@ public class OpenAIChatCompletionRequestDto //public ToolChoice ToolChoice { get; set; } public string User { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Dto/Chat/OpenAI/OpenAIChatRequestDto.cs b/src/ChatTailorAI.Shared/Dto/Chat/OpenAI/OpenAIChatRequestDto.cs index 30cc0ae..ed86e92 100644 --- a/src/ChatTailorAI.Shared/Dto/Chat/OpenAI/OpenAIChatRequestDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Chat/OpenAI/OpenAIChatRequestDto.cs @@ -1,10 +1,4 @@ -using ChatTailorAI.Shared.Models.Chat.OpenAI; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Dto.Chat.OpenAI +namespace ChatTailorAI.Shared.Dto.Chat.OpenAI { public class OpenAIChatRequestDto : ChatRequestDto { diff --git a/src/ChatTailorAI.Shared/Dto/Chat/OpenAI/OpenAIChatResponseDto.cs b/src/ChatTailorAI.Shared/Dto/Chat/OpenAI/OpenAIChatResponseDto.cs index 449c3e0..c932046 100644 --- a/src/ChatTailorAI.Shared/Dto/Chat/OpenAI/OpenAIChatResponseDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Chat/OpenAI/OpenAIChatResponseDto.cs @@ -1,9 +1,5 @@ -using ChatTailorAI.Shared.Base; +using Newtonsoft.Json; using ChatTailorAI.Shared.Models.Chat.OpenAI.Responses; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Dto.Chat.OpenAI { diff --git a/src/ChatTailorAI.Shared/Dto/Chat/OpenAI/OpenAIChatSettingsDto.cs b/src/ChatTailorAI.Shared/Dto/Chat/OpenAI/OpenAIChatSettingsDto.cs index aeb1aff..a254555 100644 --- a/src/ChatTailorAI.Shared/Dto/Chat/OpenAI/OpenAIChatSettingsDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Chat/OpenAI/OpenAIChatSettingsDto.cs @@ -1,7 +1,5 @@ -using ChatTailorAI.Shared.Models.Chat.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; +using System; +using ChatTailorAI.Shared.Models.Chat.OpenAI; namespace ChatTailorAI.Shared.Dto.Chat.OpenAI { diff --git a/src/ChatTailorAI.Shared/Dto/Conversations/ArchivedConversationDto.cs b/src/ChatTailorAI.Shared/Dto/Conversations/ArchivedConversationDto.cs index 149a97f..116ef0a 100644 --- a/src/ChatTailorAI.Shared/Dto/Conversations/ArchivedConversationDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Conversations/ArchivedConversationDto.cs @@ -1,8 +1,6 @@ -using ChatTailorAI.Shared.Models.Assistants; +using System; +using ChatTailorAI.Shared.Models.Assistants; using ChatTailorAI.Shared.Models.Conversations; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Dto.Conversations { diff --git a/src/ChatTailorAI.Shared/Dto/Conversations/AssistantConversationDto.cs b/src/ChatTailorAI.Shared/Dto/Conversations/AssistantConversationDto.cs index 6c66cbd..df4f1c6 100644 --- a/src/ChatTailorAI.Shared/Dto/Conversations/AssistantConversationDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Conversations/AssistantConversationDto.cs @@ -1,8 +1,6 @@ -using ChatTailorAI.Shared.Models.Assistants; +using System; +using ChatTailorAI.Shared.Models.Assistants; using ChatTailorAI.Shared.Models.Conversations; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Dto.Conversations { diff --git a/src/ChatTailorAI.Shared/Dto/Conversations/ConversationDto.cs b/src/ChatTailorAI.Shared/Dto/Conversations/ConversationDto.cs index 688ff4d..8479282 100644 --- a/src/ChatTailorAI.Shared/Dto/Conversations/ConversationDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Conversations/ConversationDto.cs @@ -1,8 +1,5 @@ -using ChatTailorAI.Shared.Models.Assistants; +using System; using ChatTailorAI.Shared.Models.Conversations; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Dto.Conversations { diff --git a/src/ChatTailorAI.Shared/Dto/Conversations/OpenAI/OpenAIAssistantConversationDto.cs b/src/ChatTailorAI.Shared/Dto/Conversations/OpenAI/OpenAIAssistantConversationDto.cs index 9b6ee0f..a3a2538 100644 --- a/src/ChatTailorAI.Shared/Dto/Conversations/OpenAI/OpenAIAssistantConversationDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Conversations/OpenAI/OpenAIAssistantConversationDto.cs @@ -1,8 +1,6 @@ -using ChatTailorAI.Shared.Models.Conversations; +using System; +using ChatTailorAI.Shared.Models.Conversations; using ChatTailorAI.Shared.Models.Conversations.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Dto.Conversations.OpenAI { diff --git a/src/ChatTailorAI.Shared/Dto/Conversations/OpenAI/OpenAIConversationDto.cs b/src/ChatTailorAI.Shared/Dto/Conversations/OpenAI/OpenAIConversationDto.cs index 143fa8b..41fe9a7 100644 --- a/src/ChatTailorAI.Shared/Dto/Conversations/OpenAI/OpenAIConversationDto.cs +++ b/src/ChatTailorAI.Shared/Dto/Conversations/OpenAI/OpenAIConversationDto.cs @@ -1,8 +1,5 @@ using ChatTailorAI.Shared.Models.Conversations; using ChatTailorAI.Shared.Models.Conversations.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Dto.Conversations.OpenAI { diff --git a/src/ChatTailorAI.Shared/Dto/PromptDto.cs b/src/ChatTailorAI.Shared/Dto/PromptDto.cs index 0f629b6..1c138fe 100644 --- a/src/ChatTailorAI.Shared/Dto/PromptDto.cs +++ b/src/ChatTailorAI.Shared/Dto/PromptDto.cs @@ -1,7 +1,5 @@ using ChatTailorAI.Shared.Models.Prompts; using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Dto { diff --git a/src/ChatTailorAI.Shared/Enums/NavigationPageKeys.cs b/src/ChatTailorAI.Shared/Enums/NavigationPageKeys.cs index 793e99c..12fe2c2 100644 --- a/src/ChatTailorAI.Shared/Enums/NavigationPageKeys.cs +++ b/src/ChatTailorAI.Shared/Enums/NavigationPageKeys.cs @@ -1,9 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Enums +namespace ChatTailorAI.Shared.Enums { + /// + /// An enum for navigation page keys. + /// public enum NavigationPageKeys { ChatPage, @@ -14,4 +13,4 @@ public enum NavigationPageKeys AssistantsPage, ImagesPage } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Events/ApiKeyUpdatedEvent.cs b/src/ChatTailorAI.Shared/Events/ApiKeyUpdatedEvent.cs index 7bc2fc6..855bff7 100644 --- a/src/ChatTailorAI.Shared/Events/ApiKeyUpdatedEvent.cs +++ b/src/ChatTailorAI.Shared/Events/ApiKeyUpdatedEvent.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Events +namespace ChatTailorAI.Shared.Events { public enum ApiKeyType { diff --git a/src/ChatTailorAI.Shared/Events/AssistantCreatedEvent.cs b/src/ChatTailorAI.Shared/Events/AssistantCreatedEvent.cs index e55e3dd..2ebbfdf 100644 --- a/src/ChatTailorAI.Shared/Events/AssistantCreatedEvent.cs +++ b/src/ChatTailorAI.Shared/Events/AssistantCreatedEvent.cs @@ -1,8 +1,4 @@ using ChatTailorAI.Shared.Dto; -using ChatTailorAI.Shared.Models.Assistants; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Events { diff --git a/src/ChatTailorAI.Shared/Events/AuthenticationRequestedEvent.cs b/src/ChatTailorAI.Shared/Events/AuthenticationRequestedEvent.cs index 137e3ca..2028484 100644 --- a/src/ChatTailorAI.Shared/Events/AuthenticationRequestedEvent.cs +++ b/src/ChatTailorAI.Shared/Events/AuthenticationRequestedEvent.cs @@ -1,11 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Events +namespace ChatTailorAI.Shared.Events { public class AuthenticationRequestedEvent { public string AuthenticationUrl { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Events/ChatUpdatedEvent.cs b/src/ChatTailorAI.Shared/Events/ChatUpdatedEvent.cs index a534550..062c0c7 100644 --- a/src/ChatTailorAI.Shared/Events/ChatUpdatedEvent.cs +++ b/src/ChatTailorAI.Shared/Events/ChatUpdatedEvent.cs @@ -1,7 +1,4 @@ using ChatTailorAI.Shared.Dto.Conversations; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Events { @@ -9,4 +6,4 @@ public class ChatUpdatedEvent { public ConversationDto Conversation { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Events/EventArgs/ApiKeyChangedEventArgs.cs b/src/ChatTailorAI.Shared/Events/EventArgs/ApiKeyChangedEventArgs.cs index 2044eb8..a69c4ac 100644 --- a/src/ChatTailorAI.Shared/Events/EventArgs/ApiKeyChangedEventArgs.cs +++ b/src/ChatTailorAI.Shared/Events/EventArgs/ApiKeyChangedEventArgs.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ChatTailorAI.Shared.Events.EventArgs +namespace ChatTailorAI.Shared.Events.EventArgs { public class ApiKeyChangedEventArgs : System.EventArgs { @@ -12,4 +6,4 @@ public class ApiKeyChangedEventArgs : System.EventArgs public string ApiKey { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Events/EventArgs/ModeChangedEventArgs.cs b/src/ChatTailorAI.Shared/Events/EventArgs/ModeChangedEventArgs.cs index afd697a..44d9df5 100644 --- a/src/ChatTailorAI.Shared/Events/EventArgs/ModeChangedEventArgs.cs +++ b/src/ChatTailorAI.Shared/Events/EventArgs/ModeChangedEventArgs.cs @@ -4,4 +4,4 @@ public class ModeChangedEventArgs : System.EventArgs { public string Mode { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Events/ImageGeneratedEvent.cs b/src/ChatTailorAI.Shared/Events/ImageGeneratedEvent.cs index 979d067..a32347b 100644 --- a/src/ChatTailorAI.Shared/Events/ImageGeneratedEvent.cs +++ b/src/ChatTailorAI.Shared/Events/ImageGeneratedEvent.cs @@ -1,9 +1,6 @@ using ChatTailorAI.Shared.Dto; using ChatTailorAI.Shared.Models.Image; using ChatTailorAI.Shared.Models.Image.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Events { @@ -12,4 +9,4 @@ public class ImageGeneratedEvent public PromptDto PromptDto { get; set; } public ImageGenerationResponse ImageGenerationResponse { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Events/MessageReceivedEvent.cs b/src/ChatTailorAI.Shared/Events/MessageReceivedEvent.cs index ff90ef5..0affda0 100644 --- a/src/ChatTailorAI.Shared/Events/MessageReceivedEvent.cs +++ b/src/ChatTailorAI.Shared/Events/MessageReceivedEvent.cs @@ -1,8 +1,4 @@ using ChatTailorAI.Shared.Dto.Chat; -using ChatTailorAI.Shared.Dto.Chat.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Events { diff --git a/src/ChatTailorAI.Shared/Events/NotificationRaisedEvent.cs b/src/ChatTailorAI.Shared/Events/NotificationRaisedEvent.cs index 3df83df..905d48f 100644 --- a/src/ChatTailorAI.Shared/Events/NotificationRaisedEvent.cs +++ b/src/ChatTailorAI.Shared/Events/NotificationRaisedEvent.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Events +namespace ChatTailorAI.Shared.Events { public class NotificationRaisedEvent { @@ -15,4 +11,4 @@ public NotificationRaisedEvent(string message, int duration) Duration = duration; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Events/PromptCreatedEvent.cs b/src/ChatTailorAI.Shared/Events/PromptCreatedEvent.cs index 54de80e..6501f05 100644 --- a/src/ChatTailorAI.Shared/Events/PromptCreatedEvent.cs +++ b/src/ChatTailorAI.Shared/Events/PromptCreatedEvent.cs @@ -1,7 +1,4 @@ using ChatTailorAI.Shared.Models.Prompts; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Events { @@ -9,4 +6,4 @@ public class PromptCreatedEvent { public Prompt Prompt { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Factories/ChatMessageTransformerFactory.cs b/src/ChatTailorAI.Shared/Factories/ChatMessageTransformerFactory.cs index b0e45e9..a313a98 100644 --- a/src/ChatTailorAI.Shared/Factories/ChatMessageTransformerFactory.cs +++ b/src/ChatTailorAI.Shared/Factories/ChatMessageTransformerFactory.cs @@ -1,13 +1,10 @@ -using ChatTailorAI.Shared.Factories.Interfaces; -using ChatTailorAI.Shared.Services.Files; +using System; +using ChatTailorAI.Shared.Factories.Interfaces; using ChatTailorAI.Shared.Transformers; using ChatTailorAI.Shared.Transformers.Anthropic; using ChatTailorAI.Shared.Transformers.Google; using ChatTailorAI.Shared.Transformers.LMStudio; using ChatTailorAI.Shared.Transformers.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Factories { diff --git a/src/ChatTailorAI.Shared/Factories/ChatRequestBuilderFactory.cs b/src/ChatTailorAI.Shared/Factories/ChatRequestBuilderFactory.cs index f800a32..9df3c8b 100644 --- a/src/ChatTailorAI.Shared/Factories/ChatRequestBuilderFactory.cs +++ b/src/ChatTailorAI.Shared/Factories/ChatRequestBuilderFactory.cs @@ -1,8 +1,6 @@ -using ChatTailorAI.Shared.Builders; +using System; +using ChatTailorAI.Shared.Builders; using ChatTailorAI.Shared.Factories.Interfaces; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Factories { diff --git a/src/ChatTailorAI.Shared/Factories/ChatSettingsFactory.cs b/src/ChatTailorAI.Shared/Factories/ChatSettingsFactory.cs index 82aba69..efd39f6 100644 --- a/src/ChatTailorAI.Shared/Factories/ChatSettingsFactory.cs +++ b/src/ChatTailorAI.Shared/Factories/ChatSettingsFactory.cs @@ -1,22 +1,15 @@ -using ChatTailorAI.Shared.Models.Chat; +using System; +using ChatTailorAI.Shared.Factories.Interfaces; +using ChatTailorAI.Shared.Models.Chat; using ChatTailorAI.Shared.Models.Chat.Anthropic; using ChatTailorAI.Shared.Models.Chat.Google; using ChatTailorAI.Shared.Models.Chat.LMStudio; using ChatTailorAI.Shared.Models.Chat.OpenAI; using ChatTailorAI.Shared.Models.Settings; using ChatTailorAI.Shared.Services.Common; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Factories { - public interface IChatSettingsFactory - { - ChatSettings CreateChatSettings(string chatServiceType); - OpenAIChatSettings CreateOpenAIChatSettings(); - } - public class ChatSettingsFactory : IChatSettingsFactory { private readonly IUserSettingsService _userSettingsService; diff --git a/src/ChatTailorAI.Shared/Factories/Interfaces/IChatMessageTransformerFactory.cs b/src/ChatTailorAI.Shared/Factories/Interfaces/IChatMessageTransformerFactory.cs index 70d110e..98614bf 100644 --- a/src/ChatTailorAI.Shared/Factories/Interfaces/IChatMessageTransformerFactory.cs +++ b/src/ChatTailorAI.Shared/Factories/Interfaces/IChatMessageTransformerFactory.cs @@ -1,12 +1,17 @@ using ChatTailorAI.Shared.Transformers; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Factories.Interfaces { + /// + /// Factory for creating chat message transformers. + /// public interface IChatMessageTransformerFactory { + /// + /// Creates a chat message transformer for the given chat service. + /// + /// + /// IChatMessageTransformer Create(string chatServiceName); } } diff --git a/src/ChatTailorAI.Shared/Factories/Interfaces/IChatMessageViewModelFactory.cs b/src/ChatTailorAI.Shared/Factories/Interfaces/IChatMessageViewModelFactory.cs index 0daa82a..0539cd7 100644 --- a/src/ChatTailorAI.Shared/Factories/Interfaces/IChatMessageViewModelFactory.cs +++ b/src/ChatTailorAI.Shared/Factories/Interfaces/IChatMessageViewModelFactory.cs @@ -1,14 +1,26 @@ using ChatTailorAI.Shared.Dto.Chat; using ChatTailorAI.Shared.ViewModels; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Factories.Interfaces { + /// + /// Factory for creating ChatMessageViewModels + /// public interface IChatMessageViewModelFactory { + /// + /// Creates a ChatMessageViewModel from a ChatMessageDto + /// + /// + /// ChatMessageViewModel CreateViewModelFromDto(ChatMessageDto dto); + + /// + /// Creates a ChatMessageViewModel from a ChatMessageDto + /// + /// + /// + /// T CreateViewModel(ChatMessageDto dto) where T : ChatMessageViewModel; } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Factories/Interfaces/IChatRequestBuilderFactory.cs b/src/ChatTailorAI.Shared/Factories/Interfaces/IChatRequestBuilderFactory.cs index 49be663..ccfc161 100644 --- a/src/ChatTailorAI.Shared/Factories/Interfaces/IChatRequestBuilderFactory.cs +++ b/src/ChatTailorAI.Shared/Factories/Interfaces/IChatRequestBuilderFactory.cs @@ -1,26 +1,17 @@ using ChatTailorAI.Shared.Builders; -using ChatTailorAI.Shared.Models.Chat; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Factories.Interfaces { + /// + /// Factory for creating chat request builders. + /// public interface IChatRequestBuilderFactory { + /// + /// Creates a chat request builder for the given chat service. + /// + /// + /// IChatRequestBuilder GetBuilder(string chatServiceName); } - - //public interface IChatRequestBuilderFactory - //{ - // IChatRequestBuilder GetBuilder(string chatServiceName) - // where TChatRequest : ChatRequest - // where TMessage : IChatModelMessage - // where TSettings : ChatSettings; - //} - - //public interface IChatRequestBuilderFactory - //{ - // IChatRequestBuilder GetBuilder(string chatServiceName); - //} } \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Factories/Interfaces/IChatServiceFactory.cs b/src/ChatTailorAI.Shared/Factories/Interfaces/IChatServiceFactory.cs index 7f14f36..bd6f273 100644 --- a/src/ChatTailorAI.Shared/Factories/Interfaces/IChatServiceFactory.cs +++ b/src/ChatTailorAI.Shared/Factories/Interfaces/IChatServiceFactory.cs @@ -1,12 +1,12 @@ using ChatTailorAI.Shared.Dto.Chat; using ChatTailorAI.Shared.Models.Chat; using ChatTailorAI.Shared.Services.Chat; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Factories.Interfaces { + /// + /// Interface for creating ChatServices + /// public interface IChatServiceFactory { IChatService Create(string key) diff --git a/src/ChatTailorAI.Shared/Factories/Interfaces/IChatSettingsFactory.cs b/src/ChatTailorAI.Shared/Factories/Interfaces/IChatSettingsFactory.cs new file mode 100644 index 0000000..c9b5688 --- /dev/null +++ b/src/ChatTailorAI.Shared/Factories/Interfaces/IChatSettingsFactory.cs @@ -0,0 +1,11 @@ +using ChatTailorAI.Shared.Models.Chat.OpenAI; +using ChatTailorAI.Shared.Models.Chat; + +namespace ChatTailorAI.Shared.Factories.Interfaces +{ + public interface IChatSettingsFactory + { + ChatSettings CreateChatSettings(string chatServiceType); + OpenAIChatSettings CreateOpenAIChatSettings(); + } +} diff --git a/src/ChatTailorAI.Shared/Factories/Interfaces/IDialogFactory.cs b/src/ChatTailorAI.Shared/Factories/Interfaces/IDialogFactory.cs index 403611b..3ac9e61 100644 --- a/src/ChatTailorAI.Shared/Factories/Interfaces/IDialogFactory.cs +++ b/src/ChatTailorAI.Shared/Factories/Interfaces/IDialogFactory.cs @@ -1,12 +1,12 @@ -using ChatTailorAI.Shared.Dto; +using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto; using ChatTailorAI.Shared.Dto.Conversations; -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.Shared.Factories.Interfaces { + /// + /// Factory interface for creating dialogs. + /// public interface IDialogFactory { Task ShowDialogAsync(T dialog) where T : class; diff --git a/src/ChatTailorAI.Shared/Factories/ViewModels/ConversationViewModelFactory.cs b/src/ChatTailorAI.Shared/Factories/ViewModels/ConversationViewModelFactory.cs index 32c184f..97a03b9 100644 --- a/src/ChatTailorAI.Shared/Factories/ViewModels/ConversationViewModelFactory.cs +++ b/src/ChatTailorAI.Shared/Factories/ViewModels/ConversationViewModelFactory.cs @@ -1,9 +1,6 @@ using ChatTailorAI.Shared.Dto.Conversations; using ChatTailorAI.Shared.Dto.Conversations.OpenAI; using ChatTailorAI.Shared.ViewModels; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Factories.ViewModels { @@ -13,11 +10,11 @@ public static ConversationViewModel CreateViewModel(ConversationDto dto) { switch (dto) { - case OpenAIConversationDto openAIDto: + case OpenAIConversationDto _: return new OpenAIConversationViewModel { }; - case OpenAIAssistantConversationDto openAIAssistantDto: + case OpenAIAssistantConversationDto _: return new OpenAIAssistantConversationViewModel { }; - case AssistantConversationDto assistantDto: + case AssistantConversationDto _: return new AssistantConversationViewModel { }; default: return new ConversationViewModel { }; diff --git a/src/ChatTailorAI.Shared/Mappers/AssistantMapper.cs b/src/ChatTailorAI.Shared/Mappers/AssistantMapper.cs index b7e946d..2f26e29 100644 --- a/src/ChatTailorAI.Shared/Mappers/AssistantMapper.cs +++ b/src/ChatTailorAI.Shared/Mappers/AssistantMapper.cs @@ -1,9 +1,6 @@ using ChatTailorAI.Shared.Dto; using ChatTailorAI.Shared.Mappers.Interfaces; using ChatTailorAI.Shared.Models.Assistants; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Mappers { diff --git a/src/ChatTailorAI.Shared/Mappers/ConversationMapper.cs b/src/ChatTailorAI.Shared/Mappers/ConversationMapper.cs index 33881dd..88cd7f9 100644 --- a/src/ChatTailorAI.Shared/Mappers/ConversationMapper.cs +++ b/src/ChatTailorAI.Shared/Mappers/ConversationMapper.cs @@ -3,9 +3,6 @@ using ChatTailorAI.Shared.Mappers.Interfaces; using ChatTailorAI.Shared.Models.Conversations; using ChatTailorAI.Shared.Models.Conversations.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Mappers { diff --git a/src/ChatTailorAI.Shared/Mappers/ImageMapper.cs b/src/ChatTailorAI.Shared/Mappers/ImageMapper.cs index 46652fb..10a32dd 100644 --- a/src/ChatTailorAI.Shared/Mappers/ImageMapper.cs +++ b/src/ChatTailorAI.Shared/Mappers/ImageMapper.cs @@ -1,9 +1,6 @@ using ChatTailorAI.Shared.Dto.Chat; using ChatTailorAI.Shared.Mappers.Interfaces; using ChatTailorAI.Shared.Models.Chat; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Mappers { diff --git a/src/ChatTailorAI.Shared/Mappers/Interfaces/IAssistantMapper.cs b/src/ChatTailorAI.Shared/Mappers/Interfaces/IAssistantMapper.cs index 9a3bcda..72887ca 100644 --- a/src/ChatTailorAI.Shared/Mappers/Interfaces/IAssistantMapper.cs +++ b/src/ChatTailorAI.Shared/Mappers/Interfaces/IAssistantMapper.cs @@ -1,8 +1,5 @@ using ChatTailorAI.Shared.Dto; using ChatTailorAI.Shared.Models.Assistants; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Mappers.Interfaces { @@ -12,4 +9,4 @@ public interface IAssistantMapper Assistant MapToEntity(AssistantDto dto); void UpdateEntityFromDto(AssistantDto dto, Assistant entity); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Mappers/Interfaces/IChatMessageViewModelMapper.cs b/src/ChatTailorAI.Shared/Mappers/Interfaces/IChatMessageViewModelMapper.cs index 5b8f70f..5c4924f 100644 --- a/src/ChatTailorAI.Shared/Mappers/Interfaces/IChatMessageViewModelMapper.cs +++ b/src/ChatTailorAI.Shared/Mappers/Interfaces/IChatMessageViewModelMapper.cs @@ -1,9 +1,6 @@ using ChatTailorAI.Shared.Dto.Chat.OpenAI; using ChatTailorAI.Shared.Dto.Chat; using ChatTailorAI.Shared.ViewModels; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Mappers.Interfaces { diff --git a/src/ChatTailorAI.Shared/Mappers/Interfaces/IConversationMapper.cs b/src/ChatTailorAI.Shared/Mappers/Interfaces/IConversationMapper.cs index 3a886e9..dc8f5a0 100644 --- a/src/ChatTailorAI.Shared/Mappers/Interfaces/IConversationMapper.cs +++ b/src/ChatTailorAI.Shared/Mappers/Interfaces/IConversationMapper.cs @@ -1,8 +1,5 @@ using ChatTailorAI.Shared.Dto.Conversations; using ChatTailorAI.Shared.Models.Conversations; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Mappers.Interfaces { @@ -12,4 +9,4 @@ public interface IConversationMapper Conversation MapToEntity(ConversationDto dto); void UpdateEntityFromDto(ConversationDto dto, Conversation entity); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Mappers/Interfaces/IImageMapper.cs b/src/ChatTailorAI.Shared/Mappers/Interfaces/IImageMapper.cs index 7b418bc..e66e127 100644 --- a/src/ChatTailorAI.Shared/Mappers/Interfaces/IImageMapper.cs +++ b/src/ChatTailorAI.Shared/Mappers/Interfaces/IImageMapper.cs @@ -1,8 +1,5 @@ using ChatTailorAI.Shared.Dto.Chat; using ChatTailorAI.Shared.Models.Chat; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Mappers.Interfaces { diff --git a/src/ChatTailorAI.Shared/Mappers/Interfaces/IMessageMapper.cs b/src/ChatTailorAI.Shared/Mappers/Interfaces/IMessageMapper.cs index 59be650..f78aad4 100644 --- a/src/ChatTailorAI.Shared/Mappers/Interfaces/IMessageMapper.cs +++ b/src/ChatTailorAI.Shared/Mappers/Interfaces/IMessageMapper.cs @@ -1,9 +1,5 @@ using ChatTailorAI.Shared.Dto.Chat; -using ChatTailorAI.Shared.Models.Assistants; using ChatTailorAI.Shared.Models.Chat; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Mappers.Interfaces { @@ -13,4 +9,4 @@ public interface IMessageMapper ChatMessage MapToEntity(ChatMessageDto dto); void UpdateEntityFromDto(ChatMessageDto dto, ChatMessage entity); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Mappers/Interfaces/IOpenAIChatRequestMapper.cs b/src/ChatTailorAI.Shared/Mappers/Interfaces/IOpenAIChatRequestMapper.cs index 5af647b..2ad1fe5 100644 --- a/src/ChatTailorAI.Shared/Mappers/Interfaces/IOpenAIChatRequestMapper.cs +++ b/src/ChatTailorAI.Shared/Mappers/Interfaces/IOpenAIChatRequestMapper.cs @@ -1,8 +1,5 @@ using ChatTailorAI.Shared.Dto.Chat.OpenAI; using ChatTailorAI.Shared.Models.Chat.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Mappers.Interfaces { @@ -10,4 +7,4 @@ public interface IOpenAIChatRequestMapper { OpenAIChatRequestDto MapToDto(OpenAIChatRequest request); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Mappers/Interfaces/IPromptMapper.cs b/src/ChatTailorAI.Shared/Mappers/Interfaces/IPromptMapper.cs index 0519186..aed84bf 100644 --- a/src/ChatTailorAI.Shared/Mappers/Interfaces/IPromptMapper.cs +++ b/src/ChatTailorAI.Shared/Mappers/Interfaces/IPromptMapper.cs @@ -1,8 +1,5 @@ using ChatTailorAI.Shared.Dto; using ChatTailorAI.Shared.Models.Prompts; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Mappers.Interfaces { @@ -12,4 +9,4 @@ public interface IPromptMapper Prompt MapToEntity(PromptDto promptDto); void UpdateEntityFromDto(PromptDto promptDto, Prompt prompt); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Mappers/MessageMapper.cs b/src/ChatTailorAI.Shared/Mappers/MessageMapper.cs index c8d8977..b5d2a45 100644 --- a/src/ChatTailorAI.Shared/Mappers/MessageMapper.cs +++ b/src/ChatTailorAI.Shared/Mappers/MessageMapper.cs @@ -1,10 +1,8 @@ -using ChatTailorAI.Shared.Dto.Chat; +using System.Collections.Generic; +using System.Linq; +using ChatTailorAI.Shared.Dto.Chat; using ChatTailorAI.Shared.Mappers.Interfaces; using ChatTailorAI.Shared.Models.Chat; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; namespace ChatTailorAI.Shared.Mappers { diff --git a/src/ChatTailorAI.Shared/Mappers/OpenAI/OpenAIChatRequestMapper.cs b/src/ChatTailorAI.Shared/Mappers/OpenAI/OpenAIChatRequestMapper.cs index f9138d6..1210eb6 100644 --- a/src/ChatTailorAI.Shared/Mappers/OpenAI/OpenAIChatRequestMapper.cs +++ b/src/ChatTailorAI.Shared/Mappers/OpenAI/OpenAIChatRequestMapper.cs @@ -1,9 +1,6 @@ using ChatTailorAI.Shared.Dto.Chat.OpenAI; using ChatTailorAI.Shared.Mappers.Interfaces; using ChatTailorAI.Shared.Models.Chat.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Mappers.OpenAI { diff --git a/src/ChatTailorAI.Shared/Mappers/PromptMapper.cs b/src/ChatTailorAI.Shared/Mappers/PromptMapper.cs index 0c3ef27..135a671 100644 --- a/src/ChatTailorAI.Shared/Mappers/PromptMapper.cs +++ b/src/ChatTailorAI.Shared/Mappers/PromptMapper.cs @@ -1,9 +1,6 @@ using ChatTailorAI.Shared.Dto; using ChatTailorAI.Shared.Mappers.Interfaces; using ChatTailorAI.Shared.Models.Prompts; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Mappers { @@ -46,4 +43,4 @@ public void UpdateEntityFromDto(PromptDto promptDto, Prompt entity) entity.IsActive = promptDto.IsActive; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Mappers/ViewModels/ChatMessageViewModelMapper.cs b/src/ChatTailorAI.Shared/Mappers/ViewModels/ChatMessageViewModelMapper.cs index f4210a1..65c476c 100644 --- a/src/ChatTailorAI.Shared/Mappers/ViewModels/ChatMessageViewModelMapper.cs +++ b/src/ChatTailorAI.Shared/Mappers/ViewModels/ChatMessageViewModelMapper.cs @@ -1,12 +1,8 @@ -using ChatTailorAI.Shared.Dto.Chat; +using System; +using ChatTailorAI.Shared.Dto.Chat; using ChatTailorAI.Shared.Dto.Chat.OpenAI; using ChatTailorAI.Shared.Mappers.Interfaces; -using ChatTailorAI.Shared.Models.Assistants.OpenAI; using ChatTailorAI.Shared.ViewModels; -using System; -using System.Collections.Generic; -using System.Data; -using System.Text; namespace ChatTailorAI.Shared.Mappers.ViewModels { diff --git a/src/ChatTailorAI.Shared/Models/Assistants/Assistant.cs b/src/ChatTailorAI.Shared/Models/Assistants/Assistant.cs index a163df5..22c7ca3 100644 --- a/src/ChatTailorAI.Shared/Models/Assistants/Assistant.cs +++ b/src/ChatTailorAI.Shared/Models/Assistants/Assistant.cs @@ -1,8 +1,4 @@ -using ChatTailorAI.Shared.Base; -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; +using System; namespace ChatTailorAI.Shared.Models.Assistants { diff --git a/src/ChatTailorAI.Shared/Models/Assistants/AssistantTool.cs b/src/ChatTailorAI.Shared/Models/Assistants/AssistantTool.cs index 9d6129f..62708c2 100644 --- a/src/ChatTailorAI.Shared/Models/Assistants/AssistantTool.cs +++ b/src/ChatTailorAI.Shared/Models/Assistants/AssistantTool.cs @@ -1,7 +1,4 @@ using ChatTailorAI.Shared.Models.Tools; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Models.Assistants { diff --git a/src/ChatTailorAI.Shared/Models/Assistants/Custom/CustomAssistant.cs b/src/ChatTailorAI.Shared/Models/Assistants/Custom/CustomAssistant.cs index 773f9d8..53731b1 100644 --- a/src/ChatTailorAI.Shared/Models/Assistants/Custom/CustomAssistant.cs +++ b/src/ChatTailorAI.Shared/Models/Assistants/Custom/CustomAssistant.cs @@ -1,10 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Models.Assistants.Custom +namespace ChatTailorAI.Shared.Models.Assistants.Custom { internal class CustomAssistant { } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Assistants/OpenAI/OpenAIAssistant.cs b/src/ChatTailorAI.Shared/Models/Assistants/OpenAI/OpenAIAssistant.cs index 138a5ac..c5cc8fa 100644 --- a/src/ChatTailorAI.Shared/Models/Assistants/OpenAI/OpenAIAssistant.cs +++ b/src/ChatTailorAI.Shared/Models/Assistants/OpenAI/OpenAIAssistant.cs @@ -1,7 +1,5 @@ -using ChatTailorAI.Shared.Models.Tools; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; +using ChatTailorAI.Shared.Models.Tools; namespace ChatTailorAI.Shared.Models.Assistants.OpenAI { diff --git a/src/ChatTailorAI.Shared/Models/Assistants/OpenAI/OpenAIAssistantFile.cs b/src/ChatTailorAI.Shared/Models/Assistants/OpenAI/OpenAIAssistantFile.cs index f0b6ca0..7430614 100644 --- a/src/ChatTailorAI.Shared/Models/Assistants/OpenAI/OpenAIAssistantFile.cs +++ b/src/ChatTailorAI.Shared/Models/Assistants/OpenAI/OpenAIAssistantFile.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Models.Assistants.OpenAI +namespace ChatTailorAI.Shared.Models.Assistants.OpenAI { public class OpenAIAssistantFile { @@ -11,4 +7,4 @@ public OpenAIAssistantFile() } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Assistants/OpenAI/OpenAIThread.cs b/src/ChatTailorAI.Shared/Models/Assistants/OpenAI/OpenAIThread.cs index d880694..1539f9f 100644 --- a/src/ChatTailorAI.Shared/Models/Assistants/OpenAI/OpenAIThread.cs +++ b/src/ChatTailorAI.Shared/Models/Assistants/OpenAI/OpenAIThread.cs @@ -1,7 +1,5 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; +using Newtonsoft.Json; namespace ChatTailorAI.Shared.Models.Assistants.OpenAI { diff --git a/src/ChatTailorAI.Shared/Models/Assistants/OpenAI/OpenAIThreadMessage.cs b/src/ChatTailorAI.Shared/Models/Assistants/OpenAI/OpenAIThreadMessage.cs index 34602df..57e9aa7 100644 --- a/src/ChatTailorAI.Shared/Models/Assistants/OpenAI/OpenAIThreadMessage.cs +++ b/src/ChatTailorAI.Shared/Models/Assistants/OpenAI/OpenAIThreadMessage.cs @@ -1,7 +1,5 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; +using Newtonsoft.Json; namespace ChatTailorAI.Shared.Models.Assistants.OpenAI { diff --git a/src/ChatTailorAI.Shared/Models/Assistants/OpenAI/OpenAIThreadRun.cs b/src/ChatTailorAI.Shared/Models/Assistants/OpenAI/OpenAIThreadRun.cs index 887804f..e4ab6a7 100644 --- a/src/ChatTailorAI.Shared/Models/Assistants/OpenAI/OpenAIThreadRun.cs +++ b/src/ChatTailorAI.Shared/Models/Assistants/OpenAI/OpenAIThreadRun.cs @@ -2,7 +2,6 @@ using Newtonsoft.Json; using System; using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Models.Assistants.OpenAI { diff --git a/src/ChatTailorAI.Shared/Models/Audio/SpotifyPlaylist.cs b/src/ChatTailorAI.Shared/Models/Audio/SpotifyPlaylist.cs index 4673f85..7be05a8 100644 --- a/src/ChatTailorAI.Shared/Models/Audio/SpotifyPlaylist.cs +++ b/src/ChatTailorAI.Shared/Models/Audio/SpotifyPlaylist.cs @@ -1,7 +1,5 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; +using Newtonsoft.Json; namespace ChatTailorAI.Shared.Models.Audio { diff --git a/src/ChatTailorAI.Shared/Models/Chat/Anthropic/AnthropicChatRequest.cs b/src/ChatTailorAI.Shared/Models/Chat/Anthropic/AnthropicChatRequest.cs index c93508b..b214609 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/Anthropic/AnthropicChatRequest.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/Anthropic/AnthropicChatRequest.cs @@ -1,7 +1,5 @@ -using ChatTailorAI.Shared.Dto.Chat.Anthropic; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; +using ChatTailorAI.Shared.Dto.Chat.Anthropic; namespace ChatTailorAI.Shared.Models.Chat.Anthropic { diff --git a/src/ChatTailorAI.Shared/Models/Chat/Anthropic/AnthropicChatSettings.cs b/src/ChatTailorAI.Shared/Models/Chat/Anthropic/AnthropicChatSettings.cs index 084d51e..e4aad5d 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/Anthropic/AnthropicChatSettings.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/Anthropic/AnthropicChatSettings.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Models.Chat.Anthropic +namespace ChatTailorAI.Shared.Models.Chat.Anthropic { public class AnthropicChatSettings : ChatSettings { @@ -15,4 +11,4 @@ public class AnthropicChatSettings : ChatSettings public bool Stream { get; set; } public string System { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Content/AnthropicImageContentPart.cs b/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Content/AnthropicImageContentPart.cs index 546b999..956db63 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Content/AnthropicImageContentPart.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Content/AnthropicImageContentPart.cs @@ -1,7 +1,4 @@ using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Models.Chat.Anthropic.Content { diff --git a/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Content/AnthropicTextContentPart.cs b/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Content/AnthropicTextContentPart.cs index 5b7a301..68ae8f5 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Content/AnthropicTextContentPart.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Content/AnthropicTextContentPart.cs @@ -1,7 +1,4 @@ using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Models.Chat.Anthropic.Content { diff --git a/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Content/AnthropicTextDeltaContentPart.cs b/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Content/AnthropicTextDeltaContentPart.cs index a3ad3a0..64e40e3 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Content/AnthropicTextDeltaContentPart.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Content/AnthropicTextDeltaContentPart.cs @@ -1,7 +1,4 @@ using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Models.Chat.Anthropic.Content { diff --git a/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Content/IAnthropicChatContent.cs b/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Content/IAnthropicChatContent.cs index d8d4bb9..32186d4 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Content/IAnthropicChatContent.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Content/IAnthropicChatContent.cs @@ -1,7 +1,4 @@ using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Models.Chat.Anthropic.Content { diff --git a/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Events/StreamEvent.cs b/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Events/StreamEvent.cs index 4108d1b..a2273d1 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Events/StreamEvent.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Events/StreamEvent.cs @@ -1,7 +1,5 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; +using Newtonsoft.Json; namespace ChatTailorAI.Shared.Models.Chat.Anthropic.Events { diff --git a/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Requests/AnthropicMessagesRequest.cs b/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Requests/AnthropicMessagesRequest.cs index bdf9758..e93d918 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Requests/AnthropicMessagesRequest.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Requests/AnthropicMessagesRequest.cs @@ -1,10 +1,6 @@ -using ChatTailorAI.Shared.Dto.Chat.Anthropic; -using ChatTailorAI.Shared.Dto.Chat.OpenAI; -using ChatTailorAI.Shared.Models.Chat.OpenAI; +using System.Collections.Generic; using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; +using ChatTailorAI.Shared.Dto.Chat.Anthropic; namespace ChatTailorAI.Shared.Models.Chat.Anthropic.Requests { diff --git a/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Responses/AnthropicMessagesErrorResponse.cs b/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Responses/AnthropicMessagesErrorResponse.cs index 8268799..93be3bc 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Responses/AnthropicMessagesErrorResponse.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Responses/AnthropicMessagesErrorResponse.cs @@ -1,7 +1,4 @@ using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Models.Chat.Anthropic.Responses { diff --git a/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Responses/AnthropicMessagesResponse.cs b/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Responses/AnthropicMessagesResponse.cs index 0f4e87d..e812754 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Responses/AnthropicMessagesResponse.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/Anthropic/Responses/AnthropicMessagesResponse.cs @@ -1,9 +1,7 @@ -using ChatTailorAI.Shared.Models.Chat.Anthropic.Content; -using ChatTailorAI.Shared.Models.Chat.Anthropic.Converters; +using System.Collections.Generic; using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; +using ChatTailorAI.Shared.Models.Chat.Anthropic.Content; +using ChatTailorAI.Shared.Models.Chat.Anthropic.Converters; namespace ChatTailorAI.Shared.Models.Chat.Anthropic.Responses { diff --git a/src/ChatTailorAI.Shared/Models/Chat/ChatImage.cs b/src/ChatTailorAI.Shared/Models/Chat/ChatImage.cs index 28913fc..08e61d8 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/ChatImage.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/ChatImage.cs @@ -1,8 +1,5 @@ -using ChatTailorAI.Shared.Models.Prompts; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; -using System.Text; +using System; +using ChatTailorAI.Shared.Models.Prompts; namespace ChatTailorAI.Shared.Models.Chat { diff --git a/src/ChatTailorAI.Shared/Models/Chat/ChatImageMessage.cs b/src/ChatTailorAI.Shared/Models/Chat/ChatImageMessage.cs index fc42c02..254d8ea 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/ChatImageMessage.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/ChatImageMessage.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Text; namespace ChatTailorAI.Shared.Models.Chat { @@ -20,4 +18,4 @@ public void AddImage(ChatImage image) Images.Add(image); } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Chat/ChatMessage.cs b/src/ChatTailorAI.Shared/Models/Chat/ChatMessage.cs index fb28c92..a309430 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/ChatMessage.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/ChatMessage.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Models.Chat { @@ -24,4 +22,4 @@ public ChatMessage() CreatedAt = DateTime.Now; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Chat/ChatRequest.cs b/src/ChatTailorAI.Shared/Models/Chat/ChatRequest.cs index 5b3fc27..739626d 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/ChatRequest.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/ChatRequest.cs @@ -1,10 +1,4 @@ -using ChatTailorAI.Shared.Dto.Chat; -using ChatTailorAI.Shared.Dto.Chat.OpenAI; -using ChatTailorAI.Shared.Models.Chat.OpenAI; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.Collections.Generic; namespace ChatTailorAI.Shared.Models.Chat { diff --git a/src/ChatTailorAI.Shared/Models/Chat/ChatSettings.cs b/src/ChatTailorAI.Shared/Models/Chat/ChatSettings.cs index 8c57858..a4796d2 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/ChatSettings.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/ChatSettings.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Models.Chat +namespace ChatTailorAI.Shared.Models.Chat { public enum ModelType { @@ -19,4 +15,4 @@ public class ChatSettings public ModelType ModelType { get; set; } public string ModelSettingsJson { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Chat/Google/Content/GoogleFunctionCallContentPart.cs b/src/ChatTailorAI.Shared/Models/Chat/Google/Content/GoogleFunctionCallContentPart.cs index 4b17fb9..2f71520 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/Google/Content/GoogleFunctionCallContentPart.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/Google/Content/GoogleFunctionCallContentPart.cs @@ -1,7 +1,5 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; +using Newtonsoft.Json; namespace ChatTailorAI.Shared.Models.Chat.Google.Content { diff --git a/src/ChatTailorAI.Shared/Models/Chat/Google/Content/GoogleFunctionResponseContentPart.cs b/src/ChatTailorAI.Shared/Models/Chat/Google/Content/GoogleFunctionResponseContentPart.cs index 04bce88..f51a326 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/Google/Content/GoogleFunctionResponseContentPart.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/Google/Content/GoogleFunctionResponseContentPart.cs @@ -1,7 +1,5 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; +using Newtonsoft.Json; namespace ChatTailorAI.Shared.Models.Chat.Google.Content { diff --git a/src/ChatTailorAI.Shared/Models/Chat/Google/Content/GoogleImageContentPart.cs b/src/ChatTailorAI.Shared/Models/Chat/Google/Content/GoogleImageContentPart.cs index 6d87cb5..bbd47ad 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/Google/Content/GoogleImageContentPart.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/Google/Content/GoogleImageContentPart.cs @@ -1,7 +1,4 @@ using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Models.Chat.Google.Content { @@ -19,4 +16,4 @@ public class InlineDataDetails public string MimeType { get; set; } } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Chat/Google/Content/GoogleTextContentPart.cs b/src/ChatTailorAI.Shared/Models/Chat/Google/Content/GoogleTextContentPart.cs index 5ea9885..b48c78e 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/Google/Content/GoogleTextContentPart.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/Google/Content/GoogleTextContentPart.cs @@ -1,7 +1,4 @@ using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Models.Chat.Google.Content { diff --git a/src/ChatTailorAI.Shared/Models/Chat/Google/Content/IGoogleChatContent.cs b/src/ChatTailorAI.Shared/Models/Chat/Google/Content/IGoogleChatContent.cs index b16bece..5ad9584 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/Google/Content/IGoogleChatContent.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/Google/Content/IGoogleChatContent.cs @@ -1,10 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Models.Chat.Google.Content +namespace ChatTailorAI.Shared.Models.Chat.Google.Content { public interface IGoogleChatContent { } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Chat/Google/Converters/GoogleChatContentConverter.cs b/src/ChatTailorAI.Shared/Models/Chat/Google/Converters/GoogleChatContentConverter.cs index 2593272..95a75b0 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/Google/Converters/GoogleChatContentConverter.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/Google/Converters/GoogleChatContentConverter.cs @@ -1,9 +1,7 @@ -using ChatTailorAI.Shared.Models.Chat.Anthropic.Content; +using System; +using System.Collections.Generic; using Newtonsoft.Json.Linq; using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; using ChatTailorAI.Shared.Models.Chat.Google.Content; namespace ChatTailorAI.Shared.Models.Chat.Google.Converters diff --git a/src/ChatTailorAI.Shared/Models/Chat/Google/GoogleChatRequest.cs b/src/ChatTailorAI.Shared/Models/Chat/Google/GoogleChatRequest.cs index 5e12ac6..1493b3d 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/Google/GoogleChatRequest.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/Google/GoogleChatRequest.cs @@ -1,9 +1,5 @@ -using ChatTailorAI.Shared.Dto.Chat.Anthropic; +using System.Collections.Generic; using ChatTailorAI.Shared.Dto.Chat.Google; -using ChatTailorAI.Shared.Models.Chat.Anthropic; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Models.Chat.Google { diff --git a/src/ChatTailorAI.Shared/Models/Chat/Google/GoogleChatSettings.cs b/src/ChatTailorAI.Shared/Models/Chat/Google/GoogleChatSettings.cs index dd044b2..3044a69 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/Google/GoogleChatSettings.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/Google/GoogleChatSettings.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Models.Chat.Google +namespace ChatTailorAI.Shared.Models.Chat.Google { public class GoogleChatSettings : ChatSettings { @@ -14,4 +10,4 @@ public class GoogleChatSettings : ChatSettings public string StopSequences { get; set; } public bool Stream { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Chat/Google/Requests/GoogleGenerateContentRequest.cs b/src/ChatTailorAI.Shared/Models/Chat/Google/Requests/GoogleGenerateContentRequest.cs index 890998a..82b694d 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/Google/Requests/GoogleGenerateContentRequest.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/Google/Requests/GoogleGenerateContentRequest.cs @@ -1,8 +1,6 @@ -using ChatTailorAI.Shared.Dto.Chat.Google; +using System.Collections.Generic; using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; +using ChatTailorAI.Shared.Dto.Chat.Google; namespace ChatTailorAI.Shared.Models.Chat.Google.Requests { @@ -23,4 +21,4 @@ public class GoogleChatGenerationConfig [JsonProperty("temperature")] public double Temperature { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Chat/Google/Responses/GoogleGenerateContentErrorResponse.cs b/src/ChatTailorAI.Shared/Models/Chat/Google/Responses/GoogleGenerateContentErrorResponse.cs index d2f67af..55c6911 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/Google/Responses/GoogleGenerateContentErrorResponse.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/Google/Responses/GoogleGenerateContentErrorResponse.cs @@ -1,7 +1,5 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; +using Newtonsoft.Json; namespace ChatTailorAI.Shared.Models.Chat.Google.Responses { diff --git a/src/ChatTailorAI.Shared/Models/Chat/Google/Responses/GoogleGenerateContentResponse.cs b/src/ChatTailorAI.Shared/Models/Chat/Google/Responses/GoogleGenerateContentResponse.cs index 200bd6a..b28a110 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/Google/Responses/GoogleGenerateContentResponse.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/Google/Responses/GoogleGenerateContentResponse.cs @@ -1,10 +1,7 @@ -using ChatTailorAI.Shared.Models.Chat.Anthropic.Converters; +using System.Collections.Generic; +using Newtonsoft.Json; using ChatTailorAI.Shared.Models.Chat.Google.Content; using ChatTailorAI.Shared.Models.Chat.Google.Converters; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Models.Chat.Google.Responses { diff --git a/src/ChatTailorAI.Shared/Models/Chat/IChatModelMessage.cs b/src/ChatTailorAI.Shared/Models/Chat/IChatModelMessage.cs index c8b7031..e873718 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/IChatModelMessage.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/IChatModelMessage.cs @@ -5,4 +5,4 @@ public interface IChatModelMessage // This interface is so that all chat model messages for their API can // be used in the same way (will add properties as needed) } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Chat/LMStudio/LMStudioChatRequest.cs b/src/ChatTailorAI.Shared/Models/Chat/LMStudio/LMStudioChatRequest.cs index 0b4993b..8e8322d 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/LMStudio/LMStudioChatRequest.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/LMStudio/LMStudioChatRequest.cs @@ -1,7 +1,5 @@ using ChatTailorAI.Shared.Dto.Chat.LMStudio; -using System; using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Models.Chat.LMStudio { @@ -15,4 +13,4 @@ public LMStudioChatRequest(List messages, LMStudioCh Settings = chatSettings; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Chat/LMStudio/LMStudioChatSettings.cs b/src/ChatTailorAI.Shared/Models/Chat/LMStudio/LMStudioChatSettings.cs index c98324e..64a6613 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/LMStudio/LMStudioChatSettings.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/LMStudio/LMStudioChatSettings.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Models.Chat.LMStudio +namespace ChatTailorAI.Shared.Models.Chat.LMStudio { public class LMStudioChatSettings : ChatSettings { @@ -10,4 +6,4 @@ public class LMStudioChatSettings : ChatSettings public int MaxTokens { get; set; } public bool Stream { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Chat/LMStudio/Requests/LMStudioChatCompletionRequest.cs b/src/ChatTailorAI.Shared/Models/Chat/LMStudio/Requests/LMStudioChatCompletionRequest.cs index c779701..7a8eca9 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/LMStudio/Requests/LMStudioChatCompletionRequest.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/LMStudio/Requests/LMStudioChatCompletionRequest.cs @@ -1,9 +1,6 @@ -using ChatTailorAI.Shared.Dto.Chat.Anthropic; -using ChatTailorAI.Shared.Dto.Chat.LMStudio; +using System.Collections.Generic; using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; +using ChatTailorAI.Shared.Dto.Chat.LMStudio; namespace ChatTailorAI.Shared.Models.Chat.LMStudio.Requests { @@ -24,4 +21,4 @@ public class LMStudioChatCompletionRequest [JsonProperty("temperature")] public double Temperature { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Chat/LMStudio/Responses/LMStudioChatCompletionResponse.cs b/src/ChatTailorAI.Shared/Models/Chat/LMStudio/Responses/LMStudioChatCompletionResponse.cs index d0ce2e6..0c0058e 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/LMStudio/Responses/LMStudioChatCompletionResponse.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/LMStudio/Responses/LMStudioChatCompletionResponse.cs @@ -1,7 +1,5 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; +using Newtonsoft.Json; namespace ChatTailorAI.Shared.Models.Chat.LMStudio.Responses { @@ -79,4 +77,4 @@ public class FunctionCall [JsonProperty("arguments")] public string Arguments { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Chat/LMStudio/Responses/LMStudioChatErrorResponse.cs b/src/ChatTailorAI.Shared/Models/Chat/LMStudio/Responses/LMStudioChatErrorResponse.cs index 654b0ca..a1b836c 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/LMStudio/Responses/LMStudioChatErrorResponse.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/LMStudio/Responses/LMStudioChatErrorResponse.cs @@ -1,7 +1,4 @@ using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Models.Chat.LMStudio.Responses { @@ -25,4 +22,4 @@ public class ErrorDetails [JsonProperty("code")] public string Code { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Chat/LMStudio/Responses/LMStudioModelsResponse.cs b/src/ChatTailorAI.Shared/Models/Chat/LMStudio/Responses/LMStudioModelsResponse.cs index 0bb59c8..353ea52 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/LMStudio/Responses/LMStudioModelsResponse.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/LMStudio/Responses/LMStudioModelsResponse.cs @@ -1,8 +1,6 @@ using Newtonsoft.Json; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; namespace ChatTailorAI.Shared.Models.Chat.LMStudio.Responses { @@ -38,4 +36,4 @@ public class ModelData public class Permission { } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Content/IOpenAIChatContent.cs b/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Content/IOpenAIChatContent.cs index f67dc4d..6c00cd6 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Content/IOpenAIChatContent.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Content/IOpenAIChatContent.cs @@ -1,9 +1,4 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Models.Chat.OpenAI.Content +namespace ChatTailorAI.Shared.Models.Chat.OpenAI.Content { public interface IOpenAIChatContent { diff --git a/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Content/OpenAIImageContentPart.cs b/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Content/OpenAIImageContentPart.cs index 39867d1..6c2a77c 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Content/OpenAIImageContentPart.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Content/OpenAIImageContentPart.cs @@ -1,7 +1,4 @@ using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Models.Chat.OpenAI.Content { diff --git a/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Content/OpenAITextContentPart.cs b/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Content/OpenAITextContentPart.cs index 1fcd8ff..05a6519 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Content/OpenAITextContentPart.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Content/OpenAITextContentPart.cs @@ -1,7 +1,4 @@ using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Models.Chat.OpenAI.Content { diff --git a/src/ChatTailorAI.Shared/Models/Chat/OpenAI/OpenAIChatRequest.cs b/src/ChatTailorAI.Shared/Models/Chat/OpenAI/OpenAIChatRequest.cs index 9a03d23..340018c 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/OpenAI/OpenAIChatRequest.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/OpenAI/OpenAIChatRequest.cs @@ -1,7 +1,5 @@ -using ChatTailorAI.Shared.Dto.Chat.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; +using ChatTailorAI.Shared.Dto.Chat.OpenAI; namespace ChatTailorAI.Shared.Models.Chat.OpenAI { diff --git a/src/ChatTailorAI.Shared/Models/Chat/OpenAI/OpenAIChatSettings.cs b/src/ChatTailorAI.Shared/Models/Chat/OpenAI/OpenAIChatSettings.cs index ec1dcaa..fd2e55e 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/OpenAI/OpenAIChatSettings.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/OpenAI/OpenAIChatSettings.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Models.Chat.OpenAI +namespace ChatTailorAI.Shared.Models.Chat.OpenAI { public class OpenAIChatSettings : ChatSettings { diff --git a/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Requests/OpenAIChatCompletionRequest.cs b/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Requests/OpenAIChatCompletionRequest.cs index 6498fbb..caebc98 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Requests/OpenAIChatCompletionRequest.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Requests/OpenAIChatCompletionRequest.cs @@ -1,11 +1,6 @@ -using ChatTailorAI.Shared.Dto.Chat.OpenAI; -using ChatTailorAI.Shared.Services; +using System.Collections.Generic; using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto.Chat.OpenAI; namespace ChatTailorAI.Shared.Models.Chat.OpenAI.Requests { diff --git a/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Responses/OpenAIChatCompletionErrorResponse.cs b/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Responses/OpenAIChatCompletionErrorResponse.cs index c2a4a6f..0dd71f7 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Responses/OpenAIChatCompletionErrorResponse.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Responses/OpenAIChatCompletionErrorResponse.cs @@ -1,9 +1,4 @@ using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.Shared.Models.Chat.OpenAI.Responses { diff --git a/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Responses/OpenAIChatCompletionResponse.cs b/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Responses/OpenAIChatCompletionResponse.cs index 586d448..17786e5 100644 --- a/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Responses/OpenAIChatCompletionResponse.cs +++ b/src/ChatTailorAI.Shared/Models/Chat/OpenAI/Responses/OpenAIChatCompletionResponse.cs @@ -1,5 +1,5 @@ -using Newtonsoft.Json; -using System.Collections.Generic; +using System.Collections.Generic; +using Newtonsoft.Json; namespace ChatTailorAI.Shared.Models.Chat.OpenAI.Responses { diff --git a/src/ChatTailorAI.Shared/Models/Conversations/ArchivedConversation.cs b/src/ChatTailorAI.Shared/Models/Conversations/ArchivedConversation.cs index eeef7e0..bd099fe 100644 --- a/src/ChatTailorAI.Shared/Models/Conversations/ArchivedConversation.cs +++ b/src/ChatTailorAI.Shared/Models/Conversations/ArchivedConversation.cs @@ -1,8 +1,6 @@ -using ChatTailorAI.Shared.Models.Assistants; +using System; +using ChatTailorAI.Shared.Models.Assistants; using ChatTailorAI.Shared.Models.Conversations.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Models.Conversations { diff --git a/src/ChatTailorAI.Shared/Models/Conversations/AssistantConversation.cs b/src/ChatTailorAI.Shared/Models/Conversations/AssistantConversation.cs index 74f4389..3ce04f9 100644 --- a/src/ChatTailorAI.Shared/Models/Conversations/AssistantConversation.cs +++ b/src/ChatTailorAI.Shared/Models/Conversations/AssistantConversation.cs @@ -1,7 +1,4 @@ using ChatTailorAI.Shared.Models.Assistants; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Models.Conversations { @@ -20,4 +17,4 @@ public AssistantConversation() : base() } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Conversations/Conversation.cs b/src/ChatTailorAI.Shared/Models/Conversations/Conversation.cs index 97bf8c0..38abad1 100644 --- a/src/ChatTailorAI.Shared/Models/Conversations/Conversation.cs +++ b/src/ChatTailorAI.Shared/Models/Conversations/Conversation.cs @@ -1,7 +1,4 @@ -using ChatTailorAI.Shared.Models.Assistants; -using System; -using System.Collections.Generic; -using System.Text; +using System; namespace ChatTailorAI.Shared.Models.Conversations { diff --git a/src/ChatTailorAI.Shared/Models/Conversations/OpenAI/OpenAIAssistantConversation.cs b/src/ChatTailorAI.Shared/Models/Conversations/OpenAI/OpenAIAssistantConversation.cs index e5dfd3e..64f11de 100644 --- a/src/ChatTailorAI.Shared/Models/Conversations/OpenAI/OpenAIAssistantConversation.cs +++ b/src/ChatTailorAI.Shared/Models/Conversations/OpenAI/OpenAIAssistantConversation.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Models.Conversations.OpenAI +namespace ChatTailorAI.Shared.Models.Conversations.OpenAI { public class OpenAIAssistantConversation : AssistantConversation { diff --git a/src/ChatTailorAI.Shared/Models/Conversations/OpenAI/OpenAIConversation.cs b/src/ChatTailorAI.Shared/Models/Conversations/OpenAI/OpenAIConversation.cs index d0058e4..ef52698 100644 --- a/src/ChatTailorAI.Shared/Models/Conversations/OpenAI/OpenAIConversation.cs +++ b/src/ChatTailorAI.Shared/Models/Conversations/OpenAI/OpenAIConversation.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Models.Conversations.OpenAI +namespace ChatTailorAI.Shared.Models.Conversations.OpenAI { public class OpenAIConversation : Conversation { @@ -11,4 +7,4 @@ public OpenAIConversation() : base() ConversationType = "OpenAI"; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Image/ImageGenerationRequest.cs b/src/ChatTailorAI.Shared/Models/Image/ImageGenerationRequest.cs index a29e299..5e2d2ec 100644 --- a/src/ChatTailorAI.Shared/Models/Image/ImageGenerationRequest.cs +++ b/src/ChatTailorAI.Shared/Models/Image/ImageGenerationRequest.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Models.Image +namespace ChatTailorAI.Shared.Models.Image { public class ImageGenerationRequest { @@ -10,4 +6,4 @@ public class ImageGenerationRequest public string Prompt { get; set; } public TSettings Settings { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Image/ImageGenerationResponse.cs b/src/ChatTailorAI.Shared/Models/Image/ImageGenerationResponse.cs index e5f795e..4d4363b 100644 --- a/src/ChatTailorAI.Shared/Models/Image/ImageGenerationResponse.cs +++ b/src/ChatTailorAI.Shared/Models/Image/ImageGenerationResponse.cs @@ -1,7 +1,4 @@ -using ChatTailorAI.Shared.Models.Image.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; namespace ChatTailorAI.Shared.Models.Image { @@ -10,4 +7,4 @@ public class ImageGenerationResponse public IEnumerable ImageUrls { get; set; } public TSettings Settings { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Image/ImageGenerationSettings.cs b/src/ChatTailorAI.Shared/Models/Image/ImageGenerationSettings.cs index 7a0d15c..b92b8ad 100644 --- a/src/ChatTailorAI.Shared/Models/Image/ImageGenerationSettings.cs +++ b/src/ChatTailorAI.Shared/Models/Image/ImageGenerationSettings.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Models.Image +namespace ChatTailorAI.Shared.Models.Image { /// /// Represents settings for image generation services @@ -11,4 +7,4 @@ public class ImageGenerationSettings { public string Model { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Image/ImageResult.cs b/src/ChatTailorAI.Shared/Models/Image/ImageResult.cs index 085d3bf..bedc767 100644 --- a/src/ChatTailorAI.Shared/Models/Image/ImageResult.cs +++ b/src/ChatTailorAI.Shared/Models/Image/ImageResult.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Models.Image +namespace ChatTailorAI.Shared.Models.Image { /// /// Represents an image saved to the application folder @@ -13,4 +9,4 @@ public class ImageResult public byte[] Bytes { get; set; } public string RelativePath { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Image/OpenAI/OpenAIDalleImageRequest.cs b/src/ChatTailorAI.Shared/Models/Image/OpenAI/OpenAIDalleImageRequest.cs index 3a4225a..5711f3d 100644 --- a/src/ChatTailorAI.Shared/Models/Image/OpenAI/OpenAIDalleImageRequest.cs +++ b/src/ChatTailorAI.Shared/Models/Image/OpenAI/OpenAIDalleImageRequest.cs @@ -1,9 +1,4 @@ using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.Shared.Models.Image.OpenAI { diff --git a/src/ChatTailorAI.Shared/Models/Image/OpenAI/OpenAIDalleImageResponse.cs b/src/ChatTailorAI.Shared/Models/Image/OpenAI/OpenAIDalleImageResponse.cs index fec3d81..30f7e07 100644 --- a/src/ChatTailorAI.Shared/Models/Image/OpenAI/OpenAIDalleImageResponse.cs +++ b/src/ChatTailorAI.Shared/Models/Image/OpenAI/OpenAIDalleImageResponse.cs @@ -1,9 +1,5 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; +using Newtonsoft.Json; namespace ChatTailorAI.Shared.Models.Image.OpenAI { diff --git a/src/ChatTailorAI.Shared/Models/Image/OpenAI/OpenAIImageGenerationRequest.cs b/src/ChatTailorAI.Shared/Models/Image/OpenAI/OpenAIImageGenerationRequest.cs index d8fdddf..976a057 100644 --- a/src/ChatTailorAI.Shared/Models/Image/OpenAI/OpenAIImageGenerationRequest.cs +++ b/src/ChatTailorAI.Shared/Models/Image/OpenAI/OpenAIImageGenerationRequest.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Models.Image.OpenAI +namespace ChatTailorAI.Shared.Models.Image.OpenAI { public class OpenAIImageGenerationRequest : ImageGenerationRequest { @@ -17,4 +13,4 @@ public OpenAIImageGenerationRequest(OpenAIImageGenerationSettings imageSettings) Settings = imageSettings; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Image/OpenAI/OpenAIImageGenerationSettings.cs b/src/ChatTailorAI.Shared/Models/Image/OpenAI/OpenAIImageGenerationSettings.cs index a5a60e0..adb513e 100644 --- a/src/ChatTailorAI.Shared/Models/Image/OpenAI/OpenAIImageGenerationSettings.cs +++ b/src/ChatTailorAI.Shared/Models/Image/OpenAI/OpenAIImageGenerationSettings.cs @@ -1,9 +1,4 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Models.Image.OpenAI +namespace ChatTailorAI.Shared.Models.Image.OpenAI { public class OpenAIImageGenerationSettings : ImageGenerationSettings { diff --git a/src/ChatTailorAI.Shared/Models/Prompts/Prompt.cs b/src/ChatTailorAI.Shared/Models/Prompts/Prompt.cs index 46b4049..2ea0188 100644 --- a/src/ChatTailorAI.Shared/Models/Prompts/Prompt.cs +++ b/src/ChatTailorAI.Shared/Models/Prompts/Prompt.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Models.Prompts { @@ -22,4 +20,4 @@ public Prompt() IsDeleted = false; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Prompts/PromptType.cs b/src/ChatTailorAI.Shared/Models/Prompts/PromptType.cs index e020ef4..536bb0d 100644 --- a/src/ChatTailorAI.Shared/Models/Prompts/PromptType.cs +++ b/src/ChatTailorAI.Shared/Models/Prompts/PromptType.cs @@ -1,12 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Models.Prompts +namespace ChatTailorAI.Shared.Models.Prompts { public enum PromptType { Standard, ImageGeneration, } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Shared/FunctionListGroupInfo.cs b/src/ChatTailorAI.Shared/Models/Shared/FunctionListGroupInfo.cs index 742ba23..940de80 100644 --- a/src/ChatTailorAI.Shared/Models/Shared/FunctionListGroupInfo.cs +++ b/src/ChatTailorAI.Shared/Models/Shared/FunctionListGroupInfo.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Text; +using System.Collections.Generic; namespace ChatTailorAI.Shared.Models.Shared { diff --git a/src/ChatTailorAI.Shared/Models/Shared/FunctionListItem.cs b/src/ChatTailorAI.Shared/Models/Shared/FunctionListItem.cs index 74ab911..9656ba8 100644 --- a/src/ChatTailorAI.Shared/Models/Shared/FunctionListItem.cs +++ b/src/ChatTailorAI.Shared/Models/Shared/FunctionListItem.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Models.Shared +namespace ChatTailorAI.Shared.Models.Shared { public class FunctionListItem { @@ -10,4 +6,4 @@ public class FunctionListItem public string Value { get; set; } public bool IsSelected { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Shared/Result.cs b/src/ChatTailorAI.Shared/Models/Shared/Result.cs index 505b380..026d3d4 100644 --- a/src/ChatTailorAI.Shared/Models/Shared/Result.cs +++ b/src/ChatTailorAI.Shared/Models/Shared/Result.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ChatTailorAI.Shared.Models.Shared +namespace ChatTailorAI.Shared.Models.Shared { public class Result { @@ -13,4 +7,4 @@ public class Result public string ErrorMessage { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Speech/WhisperResponse.cs b/src/ChatTailorAI.Shared/Models/Speech/WhisperResponse.cs index 291f741..0f060ad 100644 --- a/src/ChatTailorAI.Shared/Models/Speech/WhisperResponse.cs +++ b/src/ChatTailorAI.Shared/Models/Speech/WhisperResponse.cs @@ -1,8 +1,5 @@ using Newtonsoft.Json; using Newtonsoft.Json.Serialization; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Models.Speech { @@ -11,4 +8,4 @@ public class WhisperResponse [JsonProperty("text")] public string Text { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Models/Tools/Tool.cs b/src/ChatTailorAI.Shared/Models/Tools/Tool.cs index 3910d65..9721d4f 100644 --- a/src/ChatTailorAI.Shared/Models/Tools/Tool.cs +++ b/src/ChatTailorAI.Shared/Models/Tools/Tool.cs @@ -1,7 +1,4 @@ using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Models.Tools { @@ -10,4 +7,4 @@ public class Tool [JsonProperty("type")] public string Type { get; set; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Repositories/IAssistantRepository.cs b/src/ChatTailorAI.Shared/Repositories/IAssistantRepository.cs index d73d843..76600b2 100644 --- a/src/ChatTailorAI.Shared/Repositories/IAssistantRepository.cs +++ b/src/ChatTailorAI.Shared/Repositories/IAssistantRepository.cs @@ -1,9 +1,6 @@ -using ChatTailorAI.Shared.Models.Assistants; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.Collections.Generic; using System.Threading.Tasks; +using ChatTailorAI.Shared.Models.Assistants; namespace ChatTailorAI.Shared.Repositories { @@ -17,4 +14,4 @@ public interface IAssistantRepository Task UpdateAsync(Assistant assistant); Task> GetByIdsAsync(IEnumerable ids); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Repositories/IConversationRepository.cs b/src/ChatTailorAI.Shared/Repositories/IConversationRepository.cs index 3bd6f8a..b4237a7 100644 --- a/src/ChatTailorAI.Shared/Repositories/IConversationRepository.cs +++ b/src/ChatTailorAI.Shared/Repositories/IConversationRepository.cs @@ -1,10 +1,6 @@ -using ChatTailorAI.Shared.Models.Assistants; -using ChatTailorAI.Shared.Models.Conversations; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.Collections.Generic; using System.Threading.Tasks; +using ChatTailorAI.Shared.Models.Conversations; namespace ChatTailorAI.Shared.Services.Database.Repositories { diff --git a/src/ChatTailorAI.Shared/Repositories/IImageRepository.cs b/src/ChatTailorAI.Shared/Repositories/IImageRepository.cs index dcc2cc0..f408603 100644 --- a/src/ChatTailorAI.Shared/Repositories/IImageRepository.cs +++ b/src/ChatTailorAI.Shared/Repositories/IImageRepository.cs @@ -1,8 +1,6 @@ -using ChatTailorAI.Shared.Models.Chat; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; using System.Threading.Tasks; +using ChatTailorAI.Shared.Models.Chat; namespace ChatTailorAI.Shared.Repositories { diff --git a/src/ChatTailorAI.Shared/Repositories/IMessageRepository.cs b/src/ChatTailorAI.Shared/Repositories/IMessageRepository.cs index e989f36..64b803e 100644 --- a/src/ChatTailorAI.Shared/Repositories/IMessageRepository.cs +++ b/src/ChatTailorAI.Shared/Repositories/IMessageRepository.cs @@ -1,9 +1,6 @@ -using ChatTailorAI.Shared.Models.Chat; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.Collections.Generic; using System.Threading.Tasks; +using ChatTailorAI.Shared.Models.Chat; namespace ChatTailorAI.Shared.Services.Database.Repositories { diff --git a/src/ChatTailorAI.Shared/Repositories/IPromptRepository.cs b/src/ChatTailorAI.Shared/Repositories/IPromptRepository.cs index c396f91..50b1365 100644 --- a/src/ChatTailorAI.Shared/Repositories/IPromptRepository.cs +++ b/src/ChatTailorAI.Shared/Repositories/IPromptRepository.cs @@ -1,8 +1,6 @@ -using ChatTailorAI.Shared.Models.Prompts; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; using System.Threading.Tasks; +using ChatTailorAI.Shared.Models.Prompts; namespace ChatTailorAI.Shared.Repositories { diff --git a/src/ChatTailorAI.Shared/Services/Assistants/OpenAI/IOpenAIAssistantManagerService.cs b/src/ChatTailorAI.Shared/Services/Assistants/OpenAI/IOpenAIAssistantManagerService.cs index 7c002a9..f74c566 100644 --- a/src/ChatTailorAI.Shared/Services/Assistants/OpenAI/IOpenAIAssistantManagerService.cs +++ b/src/ChatTailorAI.Shared/Services/Assistants/OpenAI/IOpenAIAssistantManagerService.cs @@ -1,9 +1,7 @@ -using ChatTailorAI.Shared.Dto; -using ChatTailorAI.Shared.Models.Assistants.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto; +using ChatTailorAI.Shared.Models.Assistants.OpenAI; namespace ChatTailorAI.Shared.Services.Assistants.OpenAI { @@ -17,4 +15,4 @@ public interface IOpenAIAssistantManagerService Task> SendMessage(string assistantId, string threadId, string message); Task CreateThreadAsync(); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Services/Assistants/OpenAI/IOpenAIAssistantService.cs b/src/ChatTailorAI.Shared/Services/Assistants/OpenAI/IOpenAIAssistantService.cs index de627aa..fa0afa4 100644 --- a/src/ChatTailorAI.Shared/Services/Assistants/OpenAI/IOpenAIAssistantService.cs +++ b/src/ChatTailorAI.Shared/Services/Assistants/OpenAI/IOpenAIAssistantService.cs @@ -1,10 +1,8 @@ -using ChatTailorAI.Shared.Dto; +using System.Collections.Generic; +using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto; using ChatTailorAI.Shared.Models.Assistants.OpenAI; using ChatTailorAI.Shared.Models.Tools; -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.Shared.Services.Assistants.OpenAI { diff --git a/src/ChatTailorAI.Shared/Services/Assistants/OpenAI/IOpenAIMessageService.cs b/src/ChatTailorAI.Shared/Services/Assistants/OpenAI/IOpenAIMessageService.cs index 04804b2..37ec666 100644 --- a/src/ChatTailorAI.Shared/Services/Assistants/OpenAI/IOpenAIMessageService.cs +++ b/src/ChatTailorAI.Shared/Services/Assistants/OpenAI/IOpenAIMessageService.cs @@ -1,8 +1,6 @@ -using ChatTailorAI.Shared.Models.Assistants.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; using System.Threading.Tasks; +using ChatTailorAI.Shared.Models.Assistants.OpenAI; namespace ChatTailorAI.Shared.Services.Assistants.OpenAI { @@ -15,4 +13,4 @@ public interface IOpenAIMessageService Task RetrieveMessageFileAsync(); Task ListMessageFilesAsync(); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Services/Assistants/OpenAI/IOpenAIRunService.cs b/src/ChatTailorAI.Shared/Services/Assistants/OpenAI/IOpenAIRunService.cs index ee3befe..9266b6b 100644 --- a/src/ChatTailorAI.Shared/Services/Assistants/OpenAI/IOpenAIRunService.cs +++ b/src/ChatTailorAI.Shared/Services/Assistants/OpenAI/IOpenAIRunService.cs @@ -1,8 +1,5 @@ -using ChatTailorAI.Shared.Models.Assistants.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; +using System.Threading.Tasks; +using ChatTailorAI.Shared.Models.Assistants.OpenAI; namespace ChatTailorAI.Shared.Services.Assistants.OpenAI { diff --git a/src/ChatTailorAI.Shared/Services/Assistants/OpenAI/IOpenAIThreadService.cs b/src/ChatTailorAI.Shared/Services/Assistants/OpenAI/IOpenAIThreadService.cs index 9b80a26..a1940fc 100644 --- a/src/ChatTailorAI.Shared/Services/Assistants/OpenAI/IOpenAIThreadService.cs +++ b/src/ChatTailorAI.Shared/Services/Assistants/OpenAI/IOpenAIThreadService.cs @@ -1,8 +1,5 @@ -using ChatTailorAI.Shared.Models.Assistants.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; +using System.Threading.Tasks; +using ChatTailorAI.Shared.Models.Assistants.OpenAI; namespace ChatTailorAI.Shared.Services.Assistants.OpenAI { @@ -13,4 +10,4 @@ public interface IOpenAIThreadService Task ModifyThreadAsync(); Task DeleteThreadAsync(string threadId); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Services/Audio/IAudioMediaPlayerService.cs b/src/ChatTailorAI.Shared/Services/Audio/IAudioMediaPlayerService.cs new file mode 100644 index 0000000..f8d756f --- /dev/null +++ b/src/ChatTailorAI.Shared/Services/Audio/IAudioMediaPlayerService.cs @@ -0,0 +1,10 @@ +using System.IO; +using System.Threading.Tasks; + +namespace ChatTailorAI.Shared.Services.Audio +{ + public interface IAudioMediaPlayerService + { + Task PlayAudio(Stream stream); + } +} diff --git a/src/ChatTailorAI.Shared/Services/Common/IAudioRecorderService.cs b/src/ChatTailorAI.Shared/Services/Audio/IAudioRecorderService.cs similarity index 60% rename from src/ChatTailorAI.Shared/Services/Common/IAudioRecorderService.cs rename to src/ChatTailorAI.Shared/Services/Audio/IAudioRecorderService.cs index 019f593..9023a9c 100644 --- a/src/ChatTailorAI.Shared/Services/Common/IAudioRecorderService.cs +++ b/src/ChatTailorAI.Shared/Services/Audio/IAudioRecorderService.cs @@ -1,10 +1,7 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; +using System.IO; using System.Threading.Tasks; -namespace ChatTailorAI.Shared.Services.Common +namespace ChatTailorAI.Shared.Services.Audio { public interface IAudioRecorderService { diff --git a/src/ChatTailorAI.Shared/Services/Chat/Anthropic/IAnthropicChatService.cs b/src/ChatTailorAI.Shared/Services/Chat/Anthropic/IAnthropicChatService.cs index f8c8c51..4b5c226 100644 --- a/src/ChatTailorAI.Shared/Services/Chat/Anthropic/IAnthropicChatService.cs +++ b/src/ChatTailorAI.Shared/Services/Chat/Anthropic/IAnthropicChatService.cs @@ -1,11 +1,6 @@ -using ChatTailorAI.Shared.Dto.Chat.Anthropic; -using ChatTailorAI.Shared.Dto.Chat.Google; +using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto.Chat.Anthropic; using ChatTailorAI.Shared.Models.Chat.Anthropic; -using ChatTailorAI.Shared.Models.Chat.Google; -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.Shared.Services.Chat.Anthropic { diff --git a/src/ChatTailorAI.Shared/Services/Chat/Google/IGoogleChatService.cs b/src/ChatTailorAI.Shared/Services/Chat/Google/IGoogleChatService.cs index 9bdd9ae..67f29a3 100644 --- a/src/ChatTailorAI.Shared/Services/Chat/Google/IGoogleChatService.cs +++ b/src/ChatTailorAI.Shared/Services/Chat/Google/IGoogleChatService.cs @@ -1,11 +1,6 @@ -using ChatTailorAI.Shared.Dto.Chat.Google; -using ChatTailorAI.Shared.Dto.Chat.OpenAI; +using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto.Chat.Google; using ChatTailorAI.Shared.Models.Chat.Google; -using ChatTailorAI.Shared.Models.Chat.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.Shared.Services.Chat.Google { @@ -13,4 +8,4 @@ public interface IGoogleChatService : IBaseChatService { Task GenerateChatResponseAsync(GoogleChatRequest chatRequest); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Services/Chat/IBaseChatService.cs b/src/ChatTailorAI.Shared/Services/Chat/IBaseChatService.cs index c37d084..bc6a9cc 100644 --- a/src/ChatTailorAI.Shared/Services/Chat/IBaseChatService.cs +++ b/src/ChatTailorAI.Shared/Services/Chat/IBaseChatService.cs @@ -1,11 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Services.Chat +namespace ChatTailorAI.Shared.Services.Chat { public interface IBaseChatService { bool ValidateApiKey(); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Services/Chat/IChatFileService.cs b/src/ChatTailorAI.Shared/Services/Chat/IChatFileService.cs index 4bc286a..c0b0897 100644 --- a/src/ChatTailorAI.Shared/Services/Chat/IChatFileService.cs +++ b/src/ChatTailorAI.Shared/Services/Chat/IChatFileService.cs @@ -1,9 +1,6 @@ -using ChatTailorAI.Shared.Dto.Chat; -using ChatTailorAI.Shared.Models.Chat.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto.Chat; namespace ChatTailorAI.Shared.Services.Chat { @@ -12,4 +9,4 @@ public interface IChatFileService Task SaveMessagesToFileAsync(string filename, IEnumerable messages); Task> LoadMessagesFromFileAsync(); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Services/Chat/IChatService.cs b/src/ChatTailorAI.Shared/Services/Chat/IChatService.cs index 801f6b2..2e855e9 100644 --- a/src/ChatTailorAI.Shared/Services/Chat/IChatService.cs +++ b/src/ChatTailorAI.Shared/Services/Chat/IChatService.cs @@ -1,9 +1,5 @@ -using ChatTailorAI.Shared.Dto.Chat; +using System.Threading.Tasks; using ChatTailorAI.Shared.Models.Chat; -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.Shared.Services.Chat { @@ -11,9 +7,4 @@ public interface IChatService : IBaseChatService { Task GenerateChatResponseAsync(ChatRequest chatRequest); } - - //public interface IChatService - //{ - // Task GenerateChatResponseAsync(ChatRequestDto chatRequest); - //} } \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Services/Chat/LMStudio/ILMStudioChatService.cs b/src/ChatTailorAI.Shared/Services/Chat/LMStudio/ILMStudioChatService.cs index 550be45..d17c996 100644 --- a/src/ChatTailorAI.Shared/Services/Chat/LMStudio/ILMStudioChatService.cs +++ b/src/ChatTailorAI.Shared/Services/Chat/LMStudio/ILMStudioChatService.cs @@ -1,18 +1,14 @@ -using ChatTailorAI.Shared.Dto.Chat.LMStudio; -using ChatTailorAI.Shared.Dto.Chat.OpenAI; -using ChatTailorAI.Shared.Models.Chat.LMStudio; -using ChatTailorAI.Shared.Models.Chat.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto.Chat.LMStudio; +using ChatTailorAI.Shared.Models.Chat.LMStudio; namespace ChatTailorAI.Shared.Services.Chat.LMStudio { public interface ILMStudioChatService { + Task GenerateChatResponseAsync(LMStudioChatRequest chatRequest); void CancelStream(); Task> GetModels(); - Task GenerateChatResponseAsync(LMStudioChatRequest chatRequest); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Services/Chat/OpenAI/IOpenAIChatService.cs b/src/ChatTailorAI.Shared/Services/Chat/OpenAI/IOpenAIChatService.cs index a236d5e..b0d1a98 100644 --- a/src/ChatTailorAI.Shared/Services/Chat/OpenAI/IOpenAIChatService.cs +++ b/src/ChatTailorAI.Shared/Services/Chat/OpenAI/IOpenAIChatService.cs @@ -1,16 +1,12 @@ -using ChatTailorAI.Shared.Dto.Chat.OpenAI; -using ChatTailorAI.Shared.Models.Chat; +using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto.Chat.OpenAI; using ChatTailorAI.Shared.Models.Chat.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.Shared.Services.Chat.OpenAI { public interface IOpenAIChatService : IBaseChatService { - void CancelStream(); Task GenerateChatResponseAsync(OpenAIChatRequest chatRequest); + void CancelStream(); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Services/Common/IAppNotificationService.cs b/src/ChatTailorAI.Shared/Services/Common/IAppNotificationService.cs index 23c4489..1a0d091 100644 --- a/src/ChatTailorAI.Shared/Services/Common/IAppNotificationService.cs +++ b/src/ChatTailorAI.Shared/Services/Common/IAppNotificationService.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Services.Common +namespace ChatTailorAI.Shared.Services.Common { public interface IAppNotificationService { diff --git a/src/ChatTailorAI.Shared/Services/Common/IAppSettingsService.cs b/src/ChatTailorAI.Shared/Services/Common/IAppSettingsService.cs index 00d35b9..cd1ba3f 100644 --- a/src/ChatTailorAI.Shared/Services/Common/IAppSettingsService.cs +++ b/src/ChatTailorAI.Shared/Services/Common/IAppSettingsService.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Services.Common +namespace ChatTailorAI.Shared.Services.Common { public interface IAppSettingsService { diff --git a/src/ChatTailorAI.Shared/Services/Common/IApplicationViewService.cs b/src/ChatTailorAI.Shared/Services/Common/IApplicationViewService.cs index 88bc1ca..2b9af95 100644 --- a/src/ChatTailorAI.Shared/Services/Common/IApplicationViewService.cs +++ b/src/ChatTailorAI.Shared/Services/Common/IApplicationViewService.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; +using System.Threading.Tasks; namespace ChatTailorAI.Shared.Services.Common { diff --git a/src/ChatTailorAI.Shared/Services/Common/IAudioMediaPlayerService.cs b/src/ChatTailorAI.Shared/Services/Common/IAudioMediaPlayerService.cs deleted file mode 100644 index 7946bd3..0000000 --- a/src/ChatTailorAI.Shared/Services/Common/IAudioMediaPlayerService.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Threading.Tasks; - -namespace ChatTailorAI.Shared.Services.Common -{ - public interface IAudioMediaPlayerService - { - Task PlayAudio(Stream stream); - } -} diff --git a/src/ChatTailorAI.Shared/Services/Common/IDialogService.cs b/src/ChatTailorAI.Shared/Services/Common/IDialogService.cs index 83a0f0b..0d16a04 100644 --- a/src/ChatTailorAI.Shared/Services/Common/IDialogService.cs +++ b/src/ChatTailorAI.Shared/Services/Common/IDialogService.cs @@ -1,12 +1,6 @@ -using ChatTailorAI.Shared.Dto; +using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto; using ChatTailorAI.Shared.Dto.Conversations; -using ChatTailorAI.Shared.Models.Assistants; -using ChatTailorAI.Shared.ViewModels; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.Shared.Services.Common { @@ -15,7 +9,6 @@ namespace ChatTailorAI.Shared.Services.Common /// public interface IDialogService { - bool CheckForOpenDialog(); Task ShowDeleteDialogAsync(); Task ShowFirstRunDialogAsync(); Task ShowAppUpdatedDialogAsync(); diff --git a/src/ChatTailorAI.Shared/Services/Common/IDispatcherService.cs b/src/ChatTailorAI.Shared/Services/Common/IDispatcherService.cs index 5f059c3..069150f 100644 --- a/src/ChatTailorAI.Shared/Services/Common/IDispatcherService.cs +++ b/src/ChatTailorAI.Shared/Services/Common/IDispatcherService.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; using System.Threading.Tasks; namespace ChatTailorAI.Shared.Services.Common diff --git a/src/ChatTailorAI.Shared/Services/Common/IKeyManager.cs b/src/ChatTailorAI.Shared/Services/Common/IKeyManager.cs index a27067c..d0fb3c8 100644 --- a/src/ChatTailorAI.Shared/Services/Common/IKeyManager.cs +++ b/src/ChatTailorAI.Shared/Services/Common/IKeyManager.cs @@ -1,7 +1,4 @@ using ChatTailorAI.Shared.Events; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Services.Common { diff --git a/src/ChatTailorAI.Shared/Services/Common/IModelManagerService.cs b/src/ChatTailorAI.Shared/Services/Common/IModelManagerService.cs index 3306177..49b5768 100644 --- a/src/ChatTailorAI.Shared/Services/Common/IModelManagerService.cs +++ b/src/ChatTailorAI.Shared/Services/Common/IModelManagerService.cs @@ -1,9 +1,4 @@ -using ChatTailorAI.Shared.Resources; -using ChatTailorAI.Shared.Services.Chat.LMStudio; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.Collections.Generic; using System.Threading.Tasks; namespace ChatTailorAI.Shared.Services.Common diff --git a/src/ChatTailorAI.Shared/Services/Common/IPageTypeResolver.cs b/src/ChatTailorAI.Shared/Services/Common/IPageTypeResolver.cs deleted file mode 100644 index 3083cf0..0000000 --- a/src/ChatTailorAI.Shared/Services/Common/IPageTypeResolver.cs +++ /dev/null @@ -1,12 +0,0 @@ -using ChatTailorAI.Shared.Enums; -using System; -using System.Collections.Generic; -using System.Text; - -namespace ChatTailorAI.Shared.Services.Common -{ - public interface IPageTypeResolver - { - Type GetPageType(NavigationPageKeys pageKey); - } -} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Services/Common/IUserSettingsService.cs b/src/ChatTailorAI.Shared/Services/Common/IUserSettingsService.cs index 54d94ad..0eb0c06 100644 --- a/src/ChatTailorAI.Shared/Services/Common/IUserSettingsService.cs +++ b/src/ChatTailorAI.Shared/Services/Common/IUserSettingsService.cs @@ -1,9 +1,5 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; +using Newtonsoft.Json; namespace ChatTailorAI.Shared.Services.Common { diff --git a/src/ChatTailorAI.Shared/Services/Common/IWindowsClipboardService.cs b/src/ChatTailorAI.Shared/Services/Common/IWindowsClipboardService.cs index caf560d..d0f85ca 100644 --- a/src/ChatTailorAI.Shared/Services/Common/IWindowsClipboardService.cs +++ b/src/ChatTailorAI.Shared/Services/Common/IWindowsClipboardService.cs @@ -1,9 +1,5 @@ -using ChatTailorAI.Shared.Dto.Chat; -using ChatTailorAI.Shared.Models.Chat.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; +using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto.Chat; namespace ChatTailorAI.Shared.Services.Common { @@ -13,4 +9,4 @@ public interface IWindowsClipboardService Task GetImageFromClipboardAsync(); Task GetImageFromClipboardAsPngAsync(); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Services/Common/IChatPageNavigationService.cs b/src/ChatTailorAI.Shared/Services/Common/Navigation/IChatPageNavigationService.cs similarity index 89% rename from src/ChatTailorAI.Shared/Services/Common/IChatPageNavigationService.cs rename to src/ChatTailorAI.Shared/Services/Common/Navigation/IChatPageNavigationService.cs index d3c9f20..5bcb18a 100644 --- a/src/ChatTailorAI.Shared/Services/Common/IChatPageNavigationService.cs +++ b/src/ChatTailorAI.Shared/Services/Common/Navigation/IChatPageNavigationService.cs @@ -1,9 +1,7 @@ -using ChatTailorAI.Shared.Enums; -using System; -using System.Collections.Generic; -using System.Text; +using System; +using ChatTailorAI.Shared.Enums; -namespace ChatTailorAI.Shared.Services.Common +namespace ChatTailorAI.Shared.Services.Common.Navigation { /// /// Provides navigation capabilities when selecting a chat within the application. diff --git a/src/ChatTailorAI.Shared/Services/Common/INavigationService.cs b/src/ChatTailorAI.Shared/Services/Common/Navigation/INavigationService.cs similarity index 71% rename from src/ChatTailorAI.Shared/Services/Common/INavigationService.cs rename to src/ChatTailorAI.Shared/Services/Common/Navigation/INavigationService.cs index f3bfead..e05757c 100644 --- a/src/ChatTailorAI.Shared/Services/Common/INavigationService.cs +++ b/src/ChatTailorAI.Shared/Services/Common/Navigation/INavigationService.cs @@ -1,11 +1,7 @@ -using ChatTailorAI.Shared.Enums; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; +using ChatTailorAI.Shared.Enums; -namespace ChatTailorAI.Shared.Services.Common +namespace ChatTailorAI.Shared.Services.Common.Navigation { /// /// Interface for handling navigation within a frame. diff --git a/src/ChatTailorAI.Shared/Services/Common/Navigation/IPageTypeResolver.cs b/src/ChatTailorAI.Shared/Services/Common/Navigation/IPageTypeResolver.cs new file mode 100644 index 0000000..78c6a00 --- /dev/null +++ b/src/ChatTailorAI.Shared/Services/Common/Navigation/IPageTypeResolver.cs @@ -0,0 +1,10 @@ +using System; +using ChatTailorAI.Shared.Enums; + +namespace ChatTailorAI.Shared.Services.Common.Navigation +{ + public interface IPageTypeResolver + { + Type GetPageType(NavigationPageKeys pageKey); + } +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Services/DataServices/IAssistantDataService.cs b/src/ChatTailorAI.Shared/Services/DataServices/IAssistantDataService.cs index db8689e..c7f443c 100644 --- a/src/ChatTailorAI.Shared/Services/DataServices/IAssistantDataService.cs +++ b/src/ChatTailorAI.Shared/Services/DataServices/IAssistantDataService.cs @@ -1,9 +1,6 @@ -using ChatTailorAI.Shared.Dto; -using ChatTailorAI.Shared.Models.Assistants; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto; namespace ChatTailorAI.Shared.Services.DataServices { diff --git a/src/ChatTailorAI.Shared/Services/DataServices/IConversationDataService.cs b/src/ChatTailorAI.Shared/Services/DataServices/IConversationDataService.cs index 7d8cda6..01c740d 100644 --- a/src/ChatTailorAI.Shared/Services/DataServices/IConversationDataService.cs +++ b/src/ChatTailorAI.Shared/Services/DataServices/IConversationDataService.cs @@ -1,9 +1,6 @@ -using ChatTailorAI.Shared.Dto.Conversations; -using ChatTailorAI.Shared.Models.Conversations; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto.Conversations; namespace ChatTailorAI.Shared.Services.DataServices { @@ -14,4 +11,4 @@ public interface IConversationDataService Task DeleteConversationAsync(ConversationDto conversation); Task UpdateConversationAsync(ConversationDto conversation); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Services/DataServices/IImageDataService.cs b/src/ChatTailorAI.Shared/Services/DataServices/IImageDataService.cs index 05c5007..80764d1 100644 --- a/src/ChatTailorAI.Shared/Services/DataServices/IImageDataService.cs +++ b/src/ChatTailorAI.Shared/Services/DataServices/IImageDataService.cs @@ -1,8 +1,6 @@ -using ChatTailorAI.Shared.Dto.Chat; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto.Chat; namespace ChatTailorAI.Shared.Services.DataServices { diff --git a/src/ChatTailorAI.Shared/Services/DataServices/IMessageDataService.cs b/src/ChatTailorAI.Shared/Services/DataServices/IMessageDataService.cs index 11e6bbc..779a873 100644 --- a/src/ChatTailorAI.Shared/Services/DataServices/IMessageDataService.cs +++ b/src/ChatTailorAI.Shared/Services/DataServices/IMessageDataService.cs @@ -1,8 +1,6 @@ -using ChatTailorAI.Shared.Dto.Chat; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto.Chat; namespace ChatTailorAI.Shared.Services.DataServices { @@ -15,4 +13,4 @@ public interface IMessageDataService Task UpdateMessageAsync(ChatMessageDto chatMessageDto); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Services/DataServices/IPromptDataService.cs b/src/ChatTailorAI.Shared/Services/DataServices/IPromptDataService.cs index 6ec381a..7aca658 100644 --- a/src/ChatTailorAI.Shared/Services/DataServices/IPromptDataService.cs +++ b/src/ChatTailorAI.Shared/Services/DataServices/IPromptDataService.cs @@ -1,8 +1,6 @@ -using ChatTailorAI.Shared.Dto; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto; namespace ChatTailorAI.Shared.Services.DataServices { @@ -15,4 +13,4 @@ public interface IPromptDataService Task GetAsync(string id); Task UpdateAsync(PromptDto prompt); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Services/Events/IEventAggregator.cs b/src/ChatTailorAI.Shared/Services/Events/IEventAggregator.cs index 8da463b..beab02a 100644 --- a/src/ChatTailorAI.Shared/Services/Events/IEventAggregator.cs +++ b/src/ChatTailorAI.Shared/Services/Events/IEventAggregator.cs @@ -1,10 +1,6 @@ -using ChatTailorAI.Shared.Events.EventArgs; +using System; +using ChatTailorAI.Shared.Events.EventArgs; using ChatTailorAI.Shared.Events; -using System; -using System.Collections.Generic; -using System.Text; -using ChatTailorAI.Shared.Models.Chat.OpenAI; -using ChatTailorAI.Shared.Dto.Chat.OpenAI; namespace ChatTailorAI.Shared.Services.Events { diff --git a/src/ChatTailorAI.Shared/Services/Events/IGenericEventAggregator.cs b/src/ChatTailorAI.Shared/Services/Events/IGenericEventAggregator.cs index f88ea64..0d5c9dd 100644 --- a/src/ChatTailorAI.Shared/Services/Events/IGenericEventAggregator.cs +++ b/src/ChatTailorAI.Shared/Services/Events/IGenericEventAggregator.cs @@ -1,13 +1,31 @@ using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.Services.Events { + /// + /// An interface for an event aggregator that can be used to publish and subscribe to events. + /// public interface IGenericEventAggregator { + /// + /// Subscribes to an event of type TEvent. + /// + /// + /// void Subscribe(Action handler); + + /// + /// Unsubscribes from an event of type TEvent. + /// + /// + /// void Unsubscribe(Action handler); + + /// + /// Publishes an event of type TEvent. + /// + /// + /// void Publish(TEvent eventToPublish); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Services/Files/IFileDownloadService.cs b/src/ChatTailorAI.Shared/Services/Files/IFileDownloadService.cs index 06842f1..db2b050 100644 --- a/src/ChatTailorAI.Shared/Services/Files/IFileDownloadService.cs +++ b/src/ChatTailorAI.Shared/Services/Files/IFileDownloadService.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.Collections.Generic; using System.Threading.Tasks; namespace ChatTailorAI.Shared.Services.Files @@ -29,4 +26,4 @@ public interface IFileDownloadService /// Task DownloadFilesToFolderAsync(string[] imageUrls); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Services/Files/IFileService.cs b/src/ChatTailorAI.Shared/Services/Files/IFileService.cs index cd0dca7..8ec4dc1 100644 --- a/src/ChatTailorAI.Shared/Services/Files/IFileService.cs +++ b/src/ChatTailorAI.Shared/Services/Files/IFileService.cs @@ -1,10 +1,6 @@ -using ChatTailorAI.Shared.Dto; -using ChatTailorAI.Shared.Models.Prompts; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.Collections.Generic; using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto; namespace ChatTailorAI.Shared.Services.Files { diff --git a/src/ChatTailorAI.Shared/Services/Files/IFolderService.cs b/src/ChatTailorAI.Shared/Services/Files/IFolderService.cs new file mode 100644 index 0000000..ae626dd --- /dev/null +++ b/src/ChatTailorAI.Shared/Services/Files/IFolderService.cs @@ -0,0 +1,25 @@ +using System.Threading.Tasks; + +namespace ChatTailorAI.Shared.Services.Files +{ + /// + /// Interface for a service for picking and creating folders + /// + /// The type of folder used by the service. + public interface IFolderService + { + /// + /// Opens the folder picker and returns the chosen folder. + /// + /// Chosen folder. + Task OpenFolderPickerAsync(); + + /// + /// Creates a new folder with its name passed as an argument inside a specified folder. + /// + /// Folder to create a new folder in. + /// New folder's name. + /// The created folder. + Task CreateFolderByNameAsync(TFolder folder, string folderName); + } +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Services/Files/IImageFileService.cs b/src/ChatTailorAI.Shared/Services/Files/IImageFileService.cs index 6f0ce5b..b62e01d 100644 --- a/src/ChatTailorAI.Shared/Services/Files/IImageFileService.cs +++ b/src/ChatTailorAI.Shared/Services/Files/IImageFileService.cs @@ -1,8 +1,6 @@ -using ChatTailorAI.Shared.Models.Image; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; using System.Threading.Tasks; +using ChatTailorAI.Shared.Models.Image; namespace ChatTailorAI.Shared.Services.Files { diff --git a/src/ChatTailorAI.Shared/Services/Image/IDalleImageService.cs b/src/ChatTailorAI.Shared/Services/Image/IDalleImageService.cs deleted file mode 100644 index 006b553..0000000 --- a/src/ChatTailorAI.Shared/Services/Image/IDalleImageService.cs +++ /dev/null @@ -1,14 +0,0 @@ -using ChatTailorAI.Shared.Models.Image.OpenAI; -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; - -namespace ChatTailorAI.Shared.Services.Image -{ - public interface IDalleImageService - { - Task> GenerateImagesAsync(OpenAIImageGenerationRequest imageRequest); - void UpdateAuthorizationHeader(string apiKey); - } -} diff --git a/src/ChatTailorAI.Shared/Services/Image/IImageGenerationService.cs b/src/ChatTailorAI.Shared/Services/Image/IImageGenerationService.cs index 903c40c..568e6be 100644 --- a/src/ChatTailorAI.Shared/Services/Image/IImageGenerationService.cs +++ b/src/ChatTailorAI.Shared/Services/Image/IImageGenerationService.cs @@ -1,13 +1,13 @@ -using ChatTailorAI.Shared.Dto; +using System.Threading.Tasks; +using System.Collections.Generic; using ChatTailorAI.Shared.Models.Image.OpenAI; -using ChatTailorAI.Shared.Models.Image; -using System.Threading.Tasks; namespace ChatTailorAI.Shared.Services.Image { public interface IImageGenerationService { // TODO: Update to use generics once > 1 image generation service is supported (currently only OpenAI) - Task> GenerateImagesAsync(PromptDto imagePrompt); + Task> GenerateImagesAsync(OpenAIImageGenerationRequest imageRequest); + void UpdateAuthorizationHeader(string apiKey); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Services/Image/IImageService.cs b/src/ChatTailorAI.Shared/Services/Image/IImageService.cs new file mode 100644 index 0000000..86af8f8 --- /dev/null +++ b/src/ChatTailorAI.Shared/Services/Image/IImageService.cs @@ -0,0 +1,12 @@ +using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto; +using ChatTailorAI.Shared.Models.Image.OpenAI; +using ChatTailorAI.Shared.Models.Image; + +namespace ChatTailorAI.Shared.Services.Image +{ + public interface IImageService + { + Task> GenerateImagesAsync(PromptDto imagePrompt); + } +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Services/Prompts/IPromptService.cs b/src/ChatTailorAI.Shared/Services/Prompts/IPromptService.cs deleted file mode 100644 index 1f8dcf7..0000000 --- a/src/ChatTailorAI.Shared/Services/Prompts/IPromptService.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; - -namespace ChatTailorAI.Shared.Services.Prompts -{ - public interface IPromptService - { - Task MigratePromptsAsync(); - } -} diff --git a/src/ChatTailorAI.Shared/Services/Speech/IAzureSpeechService.cs b/src/ChatTailorAI.Shared/Services/Speech/IAzureSpeechService.cs index 5637583..723a3b3 100644 --- a/src/ChatTailorAI.Shared/Services/Speech/IAzureSpeechService.cs +++ b/src/ChatTailorAI.Shared/Services/Speech/IAzureSpeechService.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; using System.Threading.Tasks; namespace ChatTailorAI.Shared.Services.Speech diff --git a/src/ChatTailorAI.Shared/Services/Speech/IElevenLabsSpeechService.cs b/src/ChatTailorAI.Shared/Services/Speech/IElevenLabsSpeechService.cs index 11f6e2f..1d9b6e7 100644 --- a/src/ChatTailorAI.Shared/Services/Speech/IElevenLabsSpeechService.cs +++ b/src/ChatTailorAI.Shared/Services/Speech/IElevenLabsSpeechService.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.IO; -using System.Text; using System.Threading.Tasks; namespace ChatTailorAI.Shared.Services.Speech diff --git a/src/ChatTailorAI.Shared/Services/Speech/IOpenAISpeechService.cs b/src/ChatTailorAI.Shared/Services/Speech/IOpenAISpeechService.cs index fb5b25a..eeb7c40 100644 --- a/src/ChatTailorAI.Shared/Services/Speech/IOpenAISpeechService.cs +++ b/src/ChatTailorAI.Shared/Services/Speech/IOpenAISpeechService.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.IO; -using System.Text; using System.Threading.Tasks; namespace ChatTailorAI.Shared.Services.Speech @@ -12,4 +10,4 @@ public interface IOpenAISpeechService Task> GetVoicesListAsync(); Task> GetModelsListAsync(); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Services/Speech/ISpeechService.cs b/src/ChatTailorAI.Shared/Services/Speech/ISpeechService.cs index 59de612..dcecab1 100644 --- a/src/ChatTailorAI.Shared/Services/Speech/ISpeechService.cs +++ b/src/ChatTailorAI.Shared/Services/Speech/ISpeechService.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; +using System.Threading.Tasks; namespace ChatTailorAI.Shared.Services.Speech { @@ -9,4 +6,4 @@ public interface ISpeechService { Task ProcessTextToSpeech(string speechProvider, string text); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Services/Speech/IWhisperService.cs b/src/ChatTailorAI.Shared/Services/Speech/IWhisperService.cs index 609226e..f8e29fa 100644 --- a/src/ChatTailorAI.Shared/Services/Speech/IWhisperService.cs +++ b/src/ChatTailorAI.Shared/Services/Speech/IWhisperService.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; +using System.IO; using System.Threading.Tasks; namespace ChatTailorAI.Shared.Services.Speech @@ -13,4 +9,4 @@ public interface IWhisperService Task Translate(string filename, byte[] audioBuffer); Task StreamToBuffer(Stream stream); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Services/Common/ISpotifyService.cs b/src/ChatTailorAI.Shared/Services/Tools/ISpotifyService.cs similarity index 84% rename from src/ChatTailorAI.Shared/Services/Common/ISpotifyService.cs rename to src/ChatTailorAI.Shared/Services/Tools/ISpotifyService.cs index 44af615..4bf4ea4 100644 --- a/src/ChatTailorAI.Shared/Services/Common/ISpotifyService.cs +++ b/src/ChatTailorAI.Shared/Services/Tools/ISpotifyService.cs @@ -1,10 +1,8 @@ -using ChatTailorAI.Shared.Models.Audio; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; using System.Threading.Tasks; +using ChatTailorAI.Shared.Models.Audio; -namespace ChatTailorAI.Shared.Services.Common +namespace ChatTailorAI.Shared.Services.Tools { public interface ISpotifyService { diff --git a/src/ChatTailorAI.Shared/Services/Tools/IToolExecutorService.cs b/src/ChatTailorAI.Shared/Services/Tools/IToolExecutorService.cs index 4b76df6..c69d379 100644 --- a/src/ChatTailorAI.Shared/Services/Tools/IToolExecutorService.cs +++ b/src/ChatTailorAI.Shared/Services/Tools/IToolExecutorService.cs @@ -1,10 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; using System.Threading.Tasks; namespace ChatTailorAI.Shared.Services.Tools { + /// + /// Represents a service that can execute tools. + /// public interface IToolExecutorService { /// @@ -15,4 +16,4 @@ public interface IToolExecutorService /// A task that represents the asynchronous operation and resolves with the result of the tool execution. Task Execute(string toolName, Dictionary toolArguments); } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Transformers/Anthropic/AnthropicChatMessageTransformer.cs b/src/ChatTailorAI.Shared/Transformers/Anthropic/AnthropicChatMessageTransformer.cs index 43d600f..184e500 100644 --- a/src/ChatTailorAI.Shared/Transformers/Anthropic/AnthropicChatMessageTransformer.cs +++ b/src/ChatTailorAI.Shared/Transformers/Anthropic/AnthropicChatMessageTransformer.cs @@ -1,12 +1,10 @@ -using ChatTailorAI.Shared.Dto.Chat; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto.Chat; using ChatTailorAI.Shared.Dto.Chat.Anthropic; -using ChatTailorAI.Shared.Dto.Chat.OpenAI; using ChatTailorAI.Shared.Models.Chat; using ChatTailorAI.Shared.Services.Files; -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.Shared.Transformers.Anthropic { diff --git a/src/ChatTailorAI.Shared/Transformers/Google/GoogleChatMessageTransformer.cs b/src/ChatTailorAI.Shared/Transformers/Google/GoogleChatMessageTransformer.cs index 78fb579..01d0f30 100644 --- a/src/ChatTailorAI.Shared/Transformers/Google/GoogleChatMessageTransformer.cs +++ b/src/ChatTailorAI.Shared/Transformers/Google/GoogleChatMessageTransformer.cs @@ -1,13 +1,11 @@ -using ChatTailorAI.Shared.Dto.Chat.Anthropic; -using ChatTailorAI.Shared.Dto.Chat; -using ChatTailorAI.Shared.Models.Chat; -using ChatTailorAI.Shared.Services.Files; -using System; +using System; using System.Collections.Generic; -using System.Text; using System.Threading.Tasks; using ChatTailorAI.Shared.Dto.Chat.Google; using ChatTailorAI.Shared.Models.Chat.Google.Content; +using ChatTailorAI.Shared.Dto.Chat; +using ChatTailorAI.Shared.Models.Chat; +using ChatTailorAI.Shared.Services.Files; namespace ChatTailorAI.Shared.Transformers.Google { diff --git a/src/ChatTailorAI.Shared/Transformers/IChatMessageTransformer.cs b/src/ChatTailorAI.Shared/Transformers/IChatMessageTransformer.cs index c0aee4f..00a6293 100644 --- a/src/ChatTailorAI.Shared/Transformers/IChatMessageTransformer.cs +++ b/src/ChatTailorAI.Shared/Transformers/IChatMessageTransformer.cs @@ -1,14 +1,19 @@ -using ChatTailorAI.Shared.Dto.Chat; +using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto.Chat; using ChatTailorAI.Shared.Models.Chat; -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.Shared.Transformers { + /// + /// An interface for transforming chat messages from DTOs to model messages. + /// public interface IChatMessageTransformer { + /// + /// Transforms a chat message DTO into a chat model message. + /// + /// + /// Task Transform(ChatMessageDto messageDto); } } \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/Transformers/LMStudio/LMStudioChatMessageTransformer.cs b/src/ChatTailorAI.Shared/Transformers/LMStudio/LMStudioChatMessageTransformer.cs index 44c1dad..8c7d609 100644 --- a/src/ChatTailorAI.Shared/Transformers/LMStudio/LMStudioChatMessageTransformer.cs +++ b/src/ChatTailorAI.Shared/Transformers/LMStudio/LMStudioChatMessageTransformer.cs @@ -1,11 +1,10 @@ -using ChatTailorAI.Shared.Dto.Chat.LMStudio; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto.Chat.LMStudio; using ChatTailorAI.Shared.Dto.Chat; using ChatTailorAI.Shared.Models.Chat; using ChatTailorAI.Shared.Services.Files; -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.Shared.Transformers.LMStudio { diff --git a/src/ChatTailorAI.Shared/Transformers/OpenAI/OpenAIChatMessageTransformer.cs b/src/ChatTailorAI.Shared/Transformers/OpenAI/OpenAIChatMessageTransformer.cs index 388b4b3..19501f3 100644 --- a/src/ChatTailorAI.Shared/Transformers/OpenAI/OpenAIChatMessageTransformer.cs +++ b/src/ChatTailorAI.Shared/Transformers/OpenAI/OpenAIChatMessageTransformer.cs @@ -1,14 +1,10 @@ -using ChatTailorAI.Shared.Dto.Chat; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using ChatTailorAI.Shared.Dto.Chat; using ChatTailorAI.Shared.Dto.Chat.OpenAI; -using ChatTailorAI.Shared.Models.Assistants.OpenAI; using ChatTailorAI.Shared.Models.Chat; using ChatTailorAI.Shared.Services.Files; -using System; -using System.Collections.Generic; -using System.Data; -using System.Text; -using System.Threading.Tasks; -using static System.Net.Mime.MediaTypeNames; namespace ChatTailorAI.Shared.Transformers.OpenAI { diff --git a/src/ChatTailorAI.Shared/ViewModels/AssistantViewModel.cs b/src/ChatTailorAI.Shared/ViewModels/AssistantViewModel.cs index b5a6621..deb4f8d 100644 --- a/src/ChatTailorAI.Shared/ViewModels/AssistantViewModel.cs +++ b/src/ChatTailorAI.Shared/ViewModels/AssistantViewModel.cs @@ -1,10 +1,6 @@ using ChatTailorAI.Shared.Base; using ChatTailorAI.Shared.Dto; using ChatTailorAI.Shared.Models.Assistants; -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Input; namespace ChatTailorAI.Shared.ViewModels { diff --git a/src/ChatTailorAI.Shared/ViewModels/ChatImageMessageViewModel.cs b/src/ChatTailorAI.Shared/ViewModels/ChatImageMessageViewModel.cs index ee045df..3f0388f 100644 --- a/src/ChatTailorAI.Shared/ViewModels/ChatImageMessageViewModel.cs +++ b/src/ChatTailorAI.Shared/ViewModels/ChatImageMessageViewModel.cs @@ -1,18 +1,13 @@ using ChatTailorAI.Shared.Dto.Chat; -using ChatTailorAI.Shared.Dto.Chat.OpenAI; -using ChatTailorAI.Shared.Models.Assistants.OpenAI; using ChatTailorAI.Shared.Services.Files; using Newtonsoft.Json; -using System; using System.Collections.Generic; -using System.Data; -using System.IO; -using System.Text; -using System.Threading.Tasks; -using static System.Net.Mime.MediaTypeNames; namespace ChatTailorAI.Shared.ViewModels { + /// + /// A view model for a chat image message. + /// public class ChatImageMessageViewModel : ChatMessageViewModel { private readonly IImageFileService _imageFileService; diff --git a/src/ChatTailorAI.Shared/ViewModels/ChatMessageViewModel.cs b/src/ChatTailorAI.Shared/ViewModels/ChatMessageViewModel.cs index ecfc36d..0c32e1c 100644 --- a/src/ChatTailorAI.Shared/ViewModels/ChatMessageViewModel.cs +++ b/src/ChatTailorAI.Shared/ViewModels/ChatMessageViewModel.cs @@ -2,16 +2,14 @@ using ChatTailorAI.Shared.Dto.Chat; using ChatTailorAI.Shared.Dto.Chat.OpenAI; using ChatTailorAI.Shared.Models.Chat; -using ChatTailorAI.Shared.Models.Chat.OpenAI; -using ChatTailorAI.Shared.Services.Files; using Newtonsoft.Json; using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.Shared.ViewModels { + /// + /// A view model for a chat message. + /// public class ChatMessageViewModel : Observable { private string _id; diff --git a/src/ChatTailorAI.Shared/ViewModels/ConversationViewModel.cs b/src/ChatTailorAI.Shared/ViewModels/ConversationViewModel.cs index d6209a3..1d5f8c9 100644 --- a/src/ChatTailorAI.Shared/ViewModels/ConversationViewModel.cs +++ b/src/ChatTailorAI.Shared/ViewModels/ConversationViewModel.cs @@ -1,13 +1,8 @@ using ChatTailorAI.Shared.Base; -using ChatTailorAI.Shared.Dto; using ChatTailorAI.Shared.Dto.Conversations; using ChatTailorAI.Shared.Dto.Conversations.OpenAI; using ChatTailorAI.Shared.Models.Assistants; using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Text; -using System.Xml.Linq; namespace ChatTailorAI.Shared.ViewModels { @@ -20,6 +15,9 @@ public class ConversationViewModel : Observable private DateTime _createdAt; private string _id; + // Workaround since assistant name isnt stored in conversation + private string _assistantName; + // Properties specific to certain conversation types private string _assistantId; private AssistantType _assistantType; @@ -27,7 +25,6 @@ public class ConversationViewModel : Observable public ConversationViewModel() { - } public string Id @@ -87,8 +84,6 @@ public string ThreadId set => SetProperty(ref _threadId, value); } - // Workaround since assistant name isnt stored in conversation - private string _assistantName; public string AssistantName { get => _assistantName; diff --git a/src/ChatTailorAI.Shared/ViewModels/Dialogs/AssistantDialogViewModel.cs b/src/ChatTailorAI.Shared/ViewModels/Dialogs/AssistantDialogViewModel.cs index 0bd5ba7..6630c1e 100644 --- a/src/ChatTailorAI.Shared/ViewModels/Dialogs/AssistantDialogViewModel.cs +++ b/src/ChatTailorAI.Shared/ViewModels/Dialogs/AssistantDialogViewModel.cs @@ -1,19 +1,17 @@ -using ChatTailorAI.Shared.Base; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Windows.Input; +using ChatTailorAI.Shared.Base; using ChatTailorAI.Shared.Dto; using ChatTailorAI.Shared.Events; using ChatTailorAI.Shared.Models.Assistants; -using ChatTailorAI.Shared.Models.Shared; using ChatTailorAI.Shared.Models.Tools; using ChatTailorAI.Shared.Resources; using ChatTailorAI.Shared.Services.Common; using ChatTailorAI.Shared.Services.Events; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Windows.Input; namespace ChatTailorAI.Shared.ViewModels.Dialogs { @@ -159,4 +157,4 @@ private void ValidateInput() throw new ValidationException("Model is required"); } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/ViewModels/Dialogs/EditAssistantDialogViewModel.cs b/src/ChatTailorAI.Shared/ViewModels/Dialogs/EditAssistantDialogViewModel.cs index a65498e..23fa672 100644 --- a/src/ChatTailorAI.Shared/ViewModels/Dialogs/EditAssistantDialogViewModel.cs +++ b/src/ChatTailorAI.Shared/ViewModels/Dialogs/EditAssistantDialogViewModel.cs @@ -1,12 +1,9 @@ -using ChatTailorAI.Shared.Base; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using ChatTailorAI.Shared.Base; using ChatTailorAI.Shared.Dto; -using ChatTailorAI.Shared.Models.Assistants; using ChatTailorAI.Shared.Models.Tools; using ChatTailorAI.Shared.Resources; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Text; namespace ChatTailorAI.Shared.ViewModels.Dialogs { diff --git a/src/ChatTailorAI.Shared/ViewModels/Dialogs/EditChatDialogViewModel.cs b/src/ChatTailorAI.Shared/ViewModels/Dialogs/EditChatDialogViewModel.cs index 865a8d2..076cecd 100644 --- a/src/ChatTailorAI.Shared/ViewModels/Dialogs/EditChatDialogViewModel.cs +++ b/src/ChatTailorAI.Shared/ViewModels/Dialogs/EditChatDialogViewModel.cs @@ -1,14 +1,11 @@ -using ChatTailorAI.Shared.Base; +using System; +using System.Collections.ObjectModel; +using System.Threading.Tasks; +using ChatTailorAI.Shared.Base; using ChatTailorAI.Shared.Dto; using ChatTailorAI.Shared.Dto.Conversations; -using ChatTailorAI.Shared.Resources; using ChatTailorAI.Shared.Services.Common; using ChatTailorAI.Shared.Services.DataServices; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Text; -using System.Threading.Tasks; namespace ChatTailorAI.Shared.ViewModels.Dialogs { diff --git a/src/ChatTailorAI.Shared/ViewModels/Dialogs/EditPromptDialogViewModel.cs b/src/ChatTailorAI.Shared/ViewModels/Dialogs/EditPromptDialogViewModel.cs index 4a1e8c4..444d716 100644 --- a/src/ChatTailorAI.Shared/ViewModels/Dialogs/EditPromptDialogViewModel.cs +++ b/src/ChatTailorAI.Shared/ViewModels/Dialogs/EditPromptDialogViewModel.cs @@ -1,7 +1,4 @@ using ChatTailorAI.Shared.Dto; -using System; -using System.Collections.Generic; -using System.Text; namespace ChatTailorAI.Shared.ViewModels.Dialogs { diff --git a/src/ChatTailorAI.Shared/ViewModels/Dialogs/NewChatDialogViewModel.cs b/src/ChatTailorAI.Shared/ViewModels/Dialogs/NewChatDialogViewModel.cs index 25cd213..06a5d4e 100644 --- a/src/ChatTailorAI.Shared/ViewModels/Dialogs/NewChatDialogViewModel.cs +++ b/src/ChatTailorAI.Shared/ViewModels/Dialogs/NewChatDialogViewModel.cs @@ -1,21 +1,18 @@ -using ChatTailorAI.Shared.Base; +using System; +using System.Collections.ObjectModel; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Input; +using CommunityToolkit.Mvvm.Input; +using ChatTailorAI.Shared.Base; using ChatTailorAI.Shared.Dto.Conversations; using ChatTailorAI.Shared.Dto.Conversations.OpenAI; using ChatTailorAI.Shared.Enums; -using ChatTailorAI.Shared.Models.Assistants; -using ChatTailorAI.Shared.Models.Conversations; using ChatTailorAI.Shared.Resources; using ChatTailorAI.Shared.Services.Assistants.OpenAI; using ChatTailorAI.Shared.Services.Common; using ChatTailorAI.Shared.Services.DataServices; -using CommunityToolkit.Mvvm.Input; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Input; +using ChatTailorAI.Shared.Services.Common.Navigation; namespace ChatTailorAI.Shared.ViewModels.Dialogs { diff --git a/src/ChatTailorAI.Shared/ViewModels/Dialogs/NewImageDialogViewModel.cs b/src/ChatTailorAI.Shared/ViewModels/Dialogs/NewImageDialogViewModel.cs index 1f7624f..f8f0304 100644 --- a/src/ChatTailorAI.Shared/ViewModels/Dialogs/NewImageDialogViewModel.cs +++ b/src/ChatTailorAI.Shared/ViewModels/Dialogs/NewImageDialogViewModel.cs @@ -1,21 +1,17 @@ -using ChatTailorAI.Shared.Base; +using System; +using System.Collections.ObjectModel; +using System.Threading.Tasks; +using System.Windows.Input; +using CommunityToolkit.Mvvm.Input; +using ChatTailorAI.Shared.Base; using ChatTailorAI.Shared.Dto; using ChatTailorAI.Shared.Events; -using ChatTailorAI.Shared.Models.Chat.OpenAI; using ChatTailorAI.Shared.Models.Image.OpenAI; using ChatTailorAI.Shared.Models.Prompts; using ChatTailorAI.Shared.Models.Settings; using ChatTailorAI.Shared.Services.Common; using ChatTailorAI.Shared.Services.Events; using ChatTailorAI.Shared.Services.Image; -using CommunityToolkit.Mvvm.Input; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using System.Windows.Input; namespace ChatTailorAI.Shared.ViewModels.Dialogs { @@ -23,8 +19,7 @@ public class NewImageDialogViewModel : Observable { private readonly IAppNotificationService _appNotificationService; private readonly IUserSettingsService _userSettingsService; - private readonly IDalleImageService _dalleImageService; - private readonly IImageGenerationService _imageGenerationService; + private readonly IImageService _imageService; private readonly IEventAggregator _eventAggregator; private bool _isGenerating; @@ -37,15 +32,13 @@ public class NewImageDialogViewModel : Observable public NewImageDialogViewModel( IAppNotificationService appNotificationService, - IDalleImageService dalleImageService, IUserSettingsService userSettingsService, - IImageGenerationService imageGenerationService, + IImageService imageService, IEventAggregator eventAggregator) { _appNotificationService = appNotificationService; - _dalleImageService = dalleImageService; _userSettingsService = userSettingsService; - _imageGenerationService = imageGenerationService; + _imageService = imageService; _eventAggregator = eventAggregator; IsGenerating = false; @@ -140,7 +133,7 @@ private async Task GenerateImageAsync() try { - var imageGenerationResponse = await _imageGenerationService.GenerateImagesAsync(imagePromptDto); + var imageGenerationResponse = await _imageService.GenerateImagesAsync(imagePromptDto); // TODO: Publish here or save to dob here? _eventAggregator.PublishImageGenerated(new ImageGeneratedEvent { diff --git a/src/ChatTailorAI.Shared/ViewModels/Dialogs/NewPromptDialogViewModel.cs b/src/ChatTailorAI.Shared/ViewModels/Dialogs/NewPromptDialogViewModel.cs index 0d04813..5ace20d 100644 --- a/src/ChatTailorAI.Shared/ViewModels/Dialogs/NewPromptDialogViewModel.cs +++ b/src/ChatTailorAI.Shared/ViewModels/Dialogs/NewPromptDialogViewModel.cs @@ -1,10 +1,10 @@ -using ChatTailorAI.Shared.Base; +using System; +using System.Windows.Input; +using ChatTailorAI.Shared.Base; using ChatTailorAI.Shared.Events; using ChatTailorAI.Shared.Models.Prompts; using ChatTailorAI.Shared.Services.Common; using ChatTailorAI.Shared.Services.Events; -using System; -using System.Windows.Input; namespace ChatTailorAI.Shared.ViewModels.Dialogs { @@ -68,4 +68,4 @@ public void CreatePrompt() } } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/ViewModels/Pages/AssistantsPageViewModel.cs b/src/ChatTailorAI.Shared/ViewModels/Pages/AssistantsPageViewModel.cs index 69bd690..afaf7a3 100644 --- a/src/ChatTailorAI.Shared/ViewModels/Pages/AssistantsPageViewModel.cs +++ b/src/ChatTailorAI.Shared/ViewModels/Pages/AssistantsPageViewModel.cs @@ -1,21 +1,19 @@ -using ChatTailorAI.Shared.Base; +using CommunityToolkit.Mvvm.Input; +using System; +using System.Collections.ObjectModel; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Input; +using ChatTailorAI.Shared.Base; using ChatTailorAI.Shared.Dto; using ChatTailorAI.Shared.Enums; using ChatTailorAI.Shared.Events; using ChatTailorAI.Shared.Models.Assistants; -using ChatTailorAI.Shared.Models.Chat.OpenAI; using ChatTailorAI.Shared.Services.Assistants.OpenAI; using ChatTailorAI.Shared.Services.Common; using ChatTailorAI.Shared.Services.DataServices; using ChatTailorAI.Shared.Services.Events; -using CommunityToolkit.Mvvm.Input; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Input; +using ChatTailorAI.Shared.Services.Common.Navigation; namespace ChatTailorAI.Shared.ViewModels.Pages { @@ -329,4 +327,4 @@ public async Task ShowAssistantHelp() await _dialogService.ShowAssistantHelpDialogAsync(); } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Shared/ViewModels/Pages/ChatPageViewModel.cs b/src/ChatTailorAI.Shared/ViewModels/Pages/ChatPageViewModel.cs index 30c7403..7f00cbf 100644 --- a/src/ChatTailorAI.Shared/ViewModels/Pages/ChatPageViewModel.cs +++ b/src/ChatTailorAI.Shared/ViewModels/Pages/ChatPageViewModel.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.ComponentModel; using System.Linq; using System.Threading.Tasks; using System.Windows.Input; @@ -28,7 +27,6 @@ using ChatTailorAI.Shared.Models.Chat; using ChatTailorAI.Shared.Services.Files; using ChatTailorAI.Shared.Dto.Conversations.OpenAI; -using ChatTailorAI.Shared.Factories; using ChatTailorAI.Shared.Factories.Interfaces; using ChatTailorAI.Shared.Mappers.Interfaces; using ChatTailorAI.Shared.Events; @@ -42,6 +40,7 @@ using ChatTailorAI.Shared.Dto.Chat.LMStudio; using ChatTailorAI.Shared.Models.Chat.LMStudio; using ChatTailorAI.Shared.Services.Chat.LMStudio; +using ChatTailorAI.Shared.Services.Audio; namespace ChatTailorAI.Shared.ViewModels.Pages { @@ -68,7 +67,7 @@ public class ChatPageViewModel : Observable, IDisposable private readonly IChatMessageViewModelFactory _chatMessageViewModelFactory; private readonly IAuthenticationService _authenticationService; private readonly ISpeechService _speechService; - private readonly IImageGenerationService _imageGenerationService; + private readonly IImageService _imageService; private readonly IChatMessageTransformerFactory _chatMessageTransformerFactory; private readonly IChatMessageViewModelMapper _chatMessageViewModelMapper; private readonly IChatRequestBuilderFactory _chatRequestBuilderFactory; @@ -131,7 +130,7 @@ public ChatPageViewModel( IChatMessageViewModelFactory chatMessageViewModelFactory, IAuthenticationService authenticationService, ISpeechService SpeechService, - IImageGenerationService imageGenerationService, + IImageService imageService, IChatMessageTransformerFactory chatMessageTransformerFactory, IChatMessageViewModelMapper chatMessageViewModelMapper, IChatRequestBuilderFactory chatRequestBuilderFactory, @@ -164,7 +163,7 @@ ILMStudioChatService lmStudioChatService _chatMessageViewModelFactory = chatMessageViewModelFactory; _authenticationService = authenticationService; _speechService = SpeechService; - _imageGenerationService = imageGenerationService; + _imageService = imageService; _chatMessageTransformerFactory = chatMessageTransformerFactory; _chatMessageViewModelMapper = chatMessageViewModelMapper; _chatRequestBuilderFactory = chatRequestBuilderFactory; @@ -222,42 +221,6 @@ ILMStudioChatService lmStudioChatService Dispose(); } - public async Task InitializeMediaCapture() - { - await _audioService.InitializeMediaCapture(); - } - - private async Task RecordAudio() - { - try - { - if (!IsRecording && IsSpeechToTextEnabled) - { - await _audioService.RecordAudio(); - IsRecording = true; - return; - } - - IsRecording = false; - var stream = await _audioService.StopRecordingAudio(); - var buffer = await _whisperService.StreamToBuffer(stream); - var text = await _whisperService.Translate("test.mp3", buffer); - await SendChatRequest(text); - } - catch (Exception ex) - { - _appNotificationService.Display(ex.Message); - } - } - - private void CopyMessageToPrompt(ChatMessageViewModel message) - { - if (message.Content != null) - { - UserInput = message.Content; - } - } - public void Dispose() { // TODO: Check into hwo to handle going back to chat page and chat view model being disposed @@ -276,10 +239,6 @@ public void Dispose() StopGeneratingResponse(); } - public async Task RequestAccessToken(string authCode) - { - return await _authenticationService.RequestSpotifyAccessToken(authCode); - } public string CurrentIcon { @@ -336,6 +295,118 @@ public bool IsActiveViewModel public ConversationViewModel CurrentConversation { get; set; } + + public ObservableCollection Messages + { + get => _messages; + set => SetProperty(ref _messages, value); + } + + public ObservableCollection SelectedImages + { + get => _selectedImages; + set => SetProperty(ref _selectedImages, value); + } + public string UserInput + { + get => _userInput; + set => SetProperty(ref _userInput, value); + } + + public bool IsTyping + { + get => _isTyping; + set + { + SetProperty(ref _isTyping, value); + OnPropertyChanged(nameof(CurrentIcon)); + OnPropertyChanged(nameof(CurrentCommand)); + } + } + + public bool IsStreamingEnabled + { + get => _userSettingsService.Get(UserSettings.StreamReply); + set => _userSettingsService.Set(UserSettings.StreamReply, value); + } + + public bool IsSpeechToTextEnabled + { + get => _userSettingsService.Get(UserSettings.SpeechToTextEnabled); + } + + public bool IsAuthWindowVisible + { + get => _isAuthWindowVisible; + set => SetProperty(ref _isAuthWindowVisible, value); + } + + public ObservableCollection Modes + { + get => _modes; + set + { + SetProperty(ref _modes, value); + } + } + + public bool IsRecording + { + get => _isRecording; + set + { + SetProperty(ref _isRecording, value); + OnPropertyChanged(nameof(CurrentRecordIcon)); + } + } + + public ObservableCollection AttachedImages + { + get => _attachedImages; + set => SetProperty(ref _attachedImages, value); + } + + public async Task InitializeMediaCapture() + { + await _audioService.InitializeMediaCapture(); + } + + private async Task RecordAudio() + { + try + { + if (!IsRecording && IsSpeechToTextEnabled) + { + await _audioService.RecordAudio(); + IsRecording = true; + return; + } + + IsRecording = false; + var stream = await _audioService.StopRecordingAudio(); + var buffer = await _whisperService.StreamToBuffer(stream); + var text = await _whisperService.Translate("test.mp3", buffer); + await SendChatRequest(text); + } + catch (Exception ex) + { + _appNotificationService.Display(ex.Message); + } + } + + private void CopyMessageToPrompt(ChatMessageViewModel message) + { + if (message.Content != null) + { + UserInput = message.Content; + } + } + + public async Task RequestAccessToken(string authCode) + { + return await _authenticationService.RequestSpotifyAccessToken(authCode); + } + public void InitializeChat(ConversationDto conversation) { // If the conversation has an assistant, then we need to create a new chat with that assistant @@ -466,76 +537,6 @@ private void OnChatModeChanged(object sender, ModeChangedEventArgs e) SelectedMode = e.Mode; } - public ObservableCollection Messages - { - get => _messages; - set => SetProperty(ref _messages, value); - } - - public ObservableCollection SelectedImages - { - get => _selectedImages; - set => SetProperty(ref _selectedImages, value); - } - public string UserInput - { - get => _userInput; - set => SetProperty(ref _userInput, value); - } - - public bool IsTyping - { - get => _isTyping; - set - { - SetProperty(ref _isTyping, value); - OnPropertyChanged(nameof(CurrentIcon)); - OnPropertyChanged(nameof(CurrentCommand)); - } - } - - public bool IsStreamingEnabled - { - get => _userSettingsService.Get(UserSettings.StreamReply); - set => _userSettingsService.Set(UserSettings.StreamReply, value); - } - - public bool IsSpeechToTextEnabled - { - get => _userSettingsService.Get(UserSettings.SpeechToTextEnabled); - } - - public bool IsAuthWindowVisible - { - get => _isAuthWindowVisible; - set => SetProperty(ref _isAuthWindowVisible, value); - } - - public ObservableCollection Modes - { - get => _modes; - set - { - SetProperty(ref _modes, value); - } - } - - public bool IsRecording - { - get => _isRecording; - set - { - SetProperty(ref _isRecording, value); - OnPropertyChanged(nameof(CurrentRecordIcon)); - } - } - - public ObservableCollection AttachedImages - { - get => _attachedImages; - set => SetProperty(ref _attachedImages, value); - } - private void OnUserSettingChanged(object sender, string e) { if (e == UserSettings.StreamReply) @@ -1039,7 +1040,7 @@ private async Task SendImageRequest(string message) // if images exist in the list of messages default to a vision model try { - var imageGenerationResponse = await _imageGenerationService.GenerateImagesAsync(imagePromptDto); + var imageGenerationResponse = await _imageService.GenerateImagesAsync(imagePromptDto); var savedImages = await _imageFileService.SaveImagesAsync(imageGenerationResponse.ImageUrls); var imageDtos = savedImages.Select(image => new ChatImageDto { diff --git a/src/ChatTailorAI.Shared/ViewModels/Pages/ChatsPageViewModel.cs b/src/ChatTailorAI.Shared/ViewModels/Pages/ChatsPageViewModel.cs index 8b72ab0..7a513a3 100644 --- a/src/ChatTailorAI.Shared/ViewModels/Pages/ChatsPageViewModel.cs +++ b/src/ChatTailorAI.Shared/ViewModels/Pages/ChatsPageViewModel.cs @@ -1,22 +1,19 @@ -using ChatTailorAI.Shared.Base; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Input; +using CommunityToolkit.Mvvm.Input; +using ChatTailorAI.Shared.Base; using ChatTailorAI.Shared.Dto.Conversations; using ChatTailorAI.Shared.Enums; using ChatTailorAI.Shared.Events; -using ChatTailorAI.Shared.Models.Chat; -using ChatTailorAI.Shared.Models.Conversations; using ChatTailorAI.Shared.Services.Assistants.OpenAI; using ChatTailorAI.Shared.Services.Common; using ChatTailorAI.Shared.Services.DataServices; using ChatTailorAI.Shared.Services.Events; -using CommunityToolkit.Mvvm.Input; -using Microsoft.CognitiveServices.Speech.Transcription; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Input; +using ChatTailorAI.Shared.Services.Common.Navigation; namespace ChatTailorAI.Shared.ViewModels.Pages { diff --git a/src/ChatTailorAI.Shared/ViewModels/Pages/ImagesPageViewModel.cs b/src/ChatTailorAI.Shared/ViewModels/Pages/ImagesPageViewModel.cs index 3b483ff..d1a4a58 100644 --- a/src/ChatTailorAI.Shared/ViewModels/Pages/ImagesPageViewModel.cs +++ b/src/ChatTailorAI.Shared/ViewModels/Pages/ImagesPageViewModel.cs @@ -1,20 +1,17 @@ -using ChatTailorAI.Shared.Base; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Input; +using CommunityToolkit.Mvvm.Input; +using ChatTailorAI.Shared.Base; using ChatTailorAI.Shared.Dto.Chat; using ChatTailorAI.Shared.Events; -using ChatTailorAI.Shared.Models.Image; -using ChatTailorAI.Shared.Models.Image.OpenAI; using ChatTailorAI.Shared.Services.Common; using ChatTailorAI.Shared.Services.DataServices; using ChatTailorAI.Shared.Services.Events; using ChatTailorAI.Shared.Services.Files; -using CommunityToolkit.Mvvm.Input; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Input; namespace ChatTailorAI.Shared.ViewModels.Pages { @@ -62,7 +59,6 @@ public ImagesPageViewModel( _loggerService = loggerService; } - ~ImagesPageViewModel() { Dispose(); diff --git a/src/ChatTailorAI.Shared/ViewModels/Pages/PromptsPageViewModel.cs b/src/ChatTailorAI.Shared/ViewModels/Pages/PromptsPageViewModel.cs index 39f8f76..6883134 100644 --- a/src/ChatTailorAI.Shared/ViewModels/Pages/PromptsPageViewModel.cs +++ b/src/ChatTailorAI.Shared/ViewModels/Pages/PromptsPageViewModel.cs @@ -3,16 +3,14 @@ using ChatTailorAI.Shared.Enums; using ChatTailorAI.Shared.Events; using ChatTailorAI.Shared.Models.Prompts; -using ChatTailorAI.Shared.Services.Assistants.OpenAI; using ChatTailorAI.Shared.Services.Common; +using ChatTailorAI.Shared.Services.Common.Navigation; using ChatTailorAI.Shared.Services.DataServices; using ChatTailorAI.Shared.Services.Events; using CommunityToolkit.Mvvm.Input; using System; -using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; -using System.Text; using System.Threading.Tasks; using System.Windows.Input; @@ -57,7 +55,6 @@ public PromptsPageViewModel( StartChatCommand = new AsyncRelayCommand(StartChat); } - public ICommand EditPromptCommand { get; private set; } public ICommand SelectPromptCommand { get; private set; } public ICommand ShowCreatePromptDialogCommand { get; private set; } @@ -147,7 +144,6 @@ public async Task ShowCreatePromptDialog() private async Task SelectPrompt(PromptDto prompt) { - //_appNotificationService.Display("Selected prompt: " + prompt.Title); SelectedPrompt = prompt; } @@ -177,18 +173,16 @@ private async Task CreatePrompt(Prompt prompt) catch (Exception ex) { _loggerService.Error(ex, "Failed to create prompt"); - - // TODO: Handle rollback _appNotificationService.Display(ex.Message); } } private async Task DeletePrompt() { - // Delete multiple selected at one point, currently - // just delete the selected one if any try { + // Currently just delete the selected one if any + // TODO: Delete multiple selected at some point if (SelectedPrompt == null) { _appNotificationService.Display("Please select a prompt to delete"); diff --git a/src/ChatTailorAI.Shared/ViewModels/Pages/SettingsPageViewModel.cs b/src/ChatTailorAI.Shared/ViewModels/Pages/SettingsPageViewModel.cs index 3b7fce1..73861fb 100644 --- a/src/ChatTailorAI.Shared/ViewModels/Pages/SettingsPageViewModel.cs +++ b/src/ChatTailorAI.Shared/ViewModels/Pages/SettingsPageViewModel.cs @@ -18,6 +18,7 @@ using ChatTailorAI.Shared.Base; using ChatTailorAI.Shared.Models.Shared; using ChatTailorAI.Shared.Events; +using ChatTailorAI.Shared.Services.Common.Navigation; namespace ChatTailorAI.Shared.ViewModels.Pages { @@ -44,6 +45,12 @@ public class SettingsPageViewModel : Observable private ObservableCollection _imageCountOptions; private ObservableCollection _imageSizeOptions; private ObservableCollection _imageQualityOptions; + private string _systemMessage; + private string _defaultPromptId; + private string _promptTitle; + private PromptDto _selectedPrompt; + private bool _isFlyoutOpen; + public SettingsPageViewModel( IUserSettingsService userSettingsService, @@ -166,236 +173,6 @@ public SettingsPageViewModel( public ICommand ClearPromptCommand { get; } public ICommand SetSelectedPromptCommand { get; } - private async void OnSelectedSpeechProviderChanged(object sender, PropertyChangedEventArgs e) - { - if (e.PropertyName == nameof(SelectedSpeechProvider)) - { - await LoadVoicesAsync(); - await LoadSpeechModelsAsync(); - } - } - - private void SetSelectedPrompt() - { - if (SelectedPrompt == null) return; - - DefaultPromptId = SelectedPrompt.Id; - SystemMessage = SelectedPrompt.Content; - PromptTitle = SelectedPrompt.Title; - - // Doesn't use SetProperty in the setter currently - OnPropertyChanged(nameof(SystemMessage)); - OnPropertyChanged(nameof(PromptTitle)); - } - - private void ClearPrompt() - { - _userSettingsService.Set(UserSettings.DefaultPromptId, null); - SystemMessage = null; - PromptTitle = null; - - // Doesn't use SetProperty in the setter currently - OnPropertyChanged(nameof(SystemMessage)); - OnPropertyChanged(nameof(PromptTitle)); - } - - public async Task DeletePrompts() - { - if (Prompts == null) return; - - await _fileService.DeletePromptsAsync(); - Prompts.Clear(); - } - - public async Task DeletePrompt() - { - IsFlyoutOpen = false; - - if (SelectedPrompt == null) return; - - var prompts = Prompts.ToList(); - int indexToDelete = prompts.FindIndex(p => Convert.ToInt32(p.Id) == Convert.ToInt32(SelectedPrompt.Id)); - - if (indexToDelete != -1) - { - prompts.RemoveAt(indexToDelete); - - for (int i = indexToDelete; i < prompts.Count; i++) - { - var id = Convert.ToInt32(prompts[i].Id); - prompts[i].Id = id--.ToString(); - } - - await _fileService.UpdatePromptsAsync(prompts); - Prompts = new ObservableCollection(prompts); - } - } - - public async Task LoadPromptsAsync() - { - try - { - var promptsFromDb = await _promptDataService.GetAllAsync(); - - List prompts = promptsFromDb - .Where(p => p.PromptType == PromptType.Standard) - .OrderByDescending(p => p.CreatedAt) - .ToList(); - - Prompts = new ObservableCollection(prompts); - - // Load default prompt info - var defaultPromptId = _userSettingsService.Get(UserSettings.DefaultPromptId); - if (!string.IsNullOrEmpty(defaultPromptId)) - { - var defaultPrompt = prompts.FirstOrDefault(p => p.Id == defaultPromptId); - if (defaultPrompt != null) - { - SystemMessage = defaultPrompt.Content; - PromptTitle = defaultPrompt.Title; - } - } - } - catch (Exception ex) - { - _loggerService.Error(ex, "Error loading prompts"); - _appNotificationService.Display($"Error loading prompts: {ex.Message}"); - } - } - - public async Task SavePrompt() - { - if (SystemMessage != string.Empty && - SystemMessage != null) - { - var newPrompt = new PromptDto - { - Content = SystemMessage, - Id = Guid.NewGuid().ToString(), - Title = PromptTitle, - PromptType = PromptType.Standard, - IsActive = false // TODO - }; - Prompts.Add(newPrompt); - - await _fileService.AppendPromptToFileAsync(newPrompt); - //var promptsList = Prompts.ToList(); - //await _fileService.UpdatePromptsFlieAsync(promptsList); - } - } - - private void GetSelectedItems() - { - throw new NotImplementedException(); - } - - public async Task LoadVoicesAsync() - { - try - { - List voiceNames = new List(); - var selectedSpeechProvider = _userSettingsService.Get(UserSettings.SpeechProvider); - switch (selectedSpeechProvider) - { - case "azure": - if (AzureSpeechApiKey != null && AzureSpeechApiKey != string.Empty && SpeechServiceRegion != string.Empty) - { - break; - } - voiceNames = await _azureSpeechService.GetVoicesListAsync(); - break; - case "openai": - voiceNames = await _openAISpeechService.GetVoicesListAsync(); - break; - case "elevenlabs": - voiceNames = await _elevenLabsSpeechService.GetVoiceNamesAsync(); - break; - default: - break; - } - - VoiceNames = new ObservableCollection(voiceNames); - OnPropertyChanged(nameof(SelectedVoiceName)); - } - catch (Exception ex) - { - _loggerService.Error(ex, "Error loading voices, starting with empty collection..."); - VoiceNames = new ObservableCollection(); - } - - } - - public async Task LoadModelsAsync() - { - // TODO: Eventually update how this is done - // SelectedModel gets set to null when the models are refreshed - try - { - string previousSelectedModel = SelectedModel; - - await _modelManagerService.RefreshDynamicModelsAsync(); - - var newModels = new ObservableCollection(); - foreach (var model in _modelManagerService.GetAllModels()) - { - newModels.Add(model); - } - - Models = new ObservableCollection(newModels); - - // Attempt to restore the previous selection - if (newModels.Contains(previousSelectedModel)) - { - SelectedModel = previousSelectedModel; - } - else if (Models.Any()) - { - SelectedModel = "gpt-4o"; - } - - OnPropertyChanged(nameof(SelectedModel)); - } - catch (Exception ex) - { - _loggerService.Error(ex, "Error loading models, starting with default collection..."); - Models = new ObservableCollection(); - } - } - - public async Task LoadSpeechModelsAsync() - { - try - { - List speechModels = new List(); - var selectedSpeechProvider = _userSettingsService.Get(UserSettings.SpeechProvider); - switch (selectedSpeechProvider) - { - case "azure": - if (AzureSpeechApiKey != null && AzureSpeechApiKey != string.Empty && SpeechServiceRegion != string.Empty) - { - break; - } - speechModels = await _azureSpeechService.GetModelsListAsync(); - break; - case "openai": - speechModels = await _openAISpeechService.GetModelsListAsync(); - break; - case "elevenlabs": - speechModels = await _elevenLabsSpeechService.GetModelsListAsync(); - break; - default: - break; - } - - SpeechModels = new ObservableCollection(speechModels); - OnPropertyChanged(nameof(SelectedSpeechModel)); - } - catch (Exception ex) - { - _loggerService.Error(ex, "Error loading speech models, starting with empty collection..."); - SpeechModels = new ObservableCollection(); - } - } private ObservableCollection _groupInfoCollection; public ObservableCollection GroupInfoCollection @@ -657,21 +434,18 @@ public double PresencePenalty set => _userSettingsService.Set(UserSettings.PresencePenalty, value); } - private string _systemMessage; public string SystemMessage { get => _systemMessage; set => SetProperty(ref _systemMessage, value); } - private string _defaultPromptId; public string DefaultPromptId { get => _userSettingsService.Get(UserSettings.DefaultPromptId); set => _userSettingsService.Set(UserSettings.DefaultPromptId, value); } - private string _promptTitle; public string PromptTitle { get => _promptTitle; @@ -687,7 +461,6 @@ public string PromptTitle } } - private PromptDto _selectedPrompt; public PromptDto SelectedPrompt { get => _selectedPrompt; @@ -700,13 +473,243 @@ public string SpeechServiceRegion set => _userSettingsService.Set(UserSettings.SpeechServiceRegion, value); } - private bool _isFlyoutOpen; public bool IsFlyoutOpen { get { return _isFlyoutOpen; } set => SetProperty(ref _isFlyoutOpen, value); } + private async void OnSelectedSpeechProviderChanged(object sender, PropertyChangedEventArgs e) + { + if (e.PropertyName == nameof(SelectedSpeechProvider)) + { + await LoadVoicesAsync(); + await LoadSpeechModelsAsync(); + } + } + + private void SetSelectedPrompt() + { + if (SelectedPrompt == null) return; + + DefaultPromptId = SelectedPrompt.Id; + SystemMessage = SelectedPrompt.Content; + PromptTitle = SelectedPrompt.Title; + + // Doesn't use SetProperty in the setter currently + OnPropertyChanged(nameof(SystemMessage)); + OnPropertyChanged(nameof(PromptTitle)); + } + + private void ClearPrompt() + { + _userSettingsService.Set(UserSettings.DefaultPromptId, null); + SystemMessage = null; + PromptTitle = null; + + // Doesn't use SetProperty in the setter currently + OnPropertyChanged(nameof(SystemMessage)); + OnPropertyChanged(nameof(PromptTitle)); + } + + public async Task DeletePrompts() + { + if (Prompts == null) return; + + await _fileService.DeletePromptsAsync(); + Prompts.Clear(); + } + + public async Task DeletePrompt() + { + IsFlyoutOpen = false; + + if (SelectedPrompt == null) return; + + var prompts = Prompts.ToList(); + int indexToDelete = prompts.FindIndex(p => Convert.ToInt32(p.Id) == Convert.ToInt32(SelectedPrompt.Id)); + + if (indexToDelete != -1) + { + prompts.RemoveAt(indexToDelete); + + for (int i = indexToDelete; i < prompts.Count; i++) + { + var id = Convert.ToInt32(prompts[i].Id); + prompts[i].Id = id--.ToString(); + } + + await _fileService.UpdatePromptsAsync(prompts); + Prompts = new ObservableCollection(prompts); + } + } + + public async Task LoadPromptsAsync() + { + try + { + var promptsFromDb = await _promptDataService.GetAllAsync(); + + List prompts = promptsFromDb + .Where(p => p.PromptType == PromptType.Standard) + .OrderByDescending(p => p.CreatedAt) + .ToList(); + + Prompts = new ObservableCollection(prompts); + + // Load default prompt info + var defaultPromptId = _userSettingsService.Get(UserSettings.DefaultPromptId); + if (!string.IsNullOrEmpty(defaultPromptId)) + { + var defaultPrompt = prompts.FirstOrDefault(p => p.Id == defaultPromptId); + if (defaultPrompt != null) + { + SystemMessage = defaultPrompt.Content; + PromptTitle = defaultPrompt.Title; + } + } + } + catch (Exception ex) + { + _loggerService.Error(ex, "Error loading prompts"); + _appNotificationService.Display($"Error loading prompts: {ex.Message}"); + } + } + + public async Task SavePrompt() + { + if (SystemMessage != string.Empty && + SystemMessage != null) + { + var newPrompt = new PromptDto + { + Content = SystemMessage, + Id = Guid.NewGuid().ToString(), + Title = PromptTitle, + PromptType = PromptType.Standard, + IsActive = false // TODO + }; + Prompts.Add(newPrompt); + + await _fileService.AppendPromptToFileAsync(newPrompt); + //var promptsList = Prompts.ToList(); + //await _fileService.UpdatePromptsFlieAsync(promptsList); + } + } + + private void GetSelectedItems() + { + throw new NotImplementedException(); + } + + public async Task LoadVoicesAsync() + { + try + { + List voiceNames = new List(); + var selectedSpeechProvider = _userSettingsService.Get(UserSettings.SpeechProvider); + switch (selectedSpeechProvider) + { + case "azure": + if (AzureSpeechApiKey != null && AzureSpeechApiKey != string.Empty && SpeechServiceRegion != string.Empty) + { + break; + } + voiceNames = await _azureSpeechService.GetVoicesListAsync(); + break; + case "openai": + voiceNames = await _openAISpeechService.GetVoicesListAsync(); + break; + case "elevenlabs": + voiceNames = await _elevenLabsSpeechService.GetVoiceNamesAsync(); + break; + default: + break; + } + + VoiceNames = new ObservableCollection(voiceNames); + OnPropertyChanged(nameof(SelectedVoiceName)); + } + catch (Exception ex) + { + _loggerService.Error(ex, "Error loading voices, starting with empty collection..."); + VoiceNames = new ObservableCollection(); + } + + } + + public async Task LoadModelsAsync() + { + // TODO: Eventually update how this is done + // SelectedModel gets set to null when the models are refreshed + try + { + string previousSelectedModel = SelectedModel; + + await _modelManagerService.RefreshDynamicModelsAsync(); + + var newModels = new ObservableCollection(); + foreach (var model in _modelManagerService.GetAllModels()) + { + newModels.Add(model); + } + + Models = new ObservableCollection(newModels); + + // Attempt to restore the previous selection + if (newModels.Contains(previousSelectedModel)) + { + SelectedModel = previousSelectedModel; + } + else if (Models.Any()) + { + SelectedModel = "gpt-4o"; + } + + OnPropertyChanged(nameof(SelectedModel)); + } + catch (Exception ex) + { + _loggerService.Error(ex, "Error loading models, starting with default collection..."); + Models = new ObservableCollection(); + } + } + + public async Task LoadSpeechModelsAsync() + { + try + { + List speechModels = new List(); + var selectedSpeechProvider = _userSettingsService.Get(UserSettings.SpeechProvider); + switch (selectedSpeechProvider) + { + case "azure": + if (AzureSpeechApiKey != null && AzureSpeechApiKey != string.Empty && SpeechServiceRegion != string.Empty) + { + break; + } + speechModels = await _azureSpeechService.GetModelsListAsync(); + break; + case "openai": + speechModels = await _openAISpeechService.GetModelsListAsync(); + break; + case "elevenlabs": + speechModels = await _elevenLabsSpeechService.GetModelsListAsync(); + break; + default: + break; + } + + SpeechModels = new ObservableCollection(speechModels); + OnPropertyChanged(nameof(SelectedSpeechModel)); + } + catch (Exception ex) + { + _loggerService.Error(ex, "Error loading speech models, starting with empty collection..."); + SpeechModels = new ObservableCollection(); + } + } + public void NavigateBack() { // Certain services lsiten for API key changes, since currently it only initializes diff --git a/src/ChatTailorAI.Shared/ViewModels/Pages/ShellPageViewModel.cs b/src/ChatTailorAI.Shared/ViewModels/Pages/ShellPageViewModel.cs index 8f32677..7f9ac4d 100644 --- a/src/ChatTailorAI.Shared/ViewModels/Pages/ShellPageViewModel.cs +++ b/src/ChatTailorAI.Shared/ViewModels/Pages/ShellPageViewModel.cs @@ -1,9 +1,7 @@ using ChatTailorAI.Shared.Enums; using ChatTailorAI.Shared.Services.Common; +using ChatTailorAI.Shared.Services.Common.Navigation; using CommunityToolkit.Mvvm.Input; -using System; -using System.Collections.Generic; -using System.Text; using System.Threading.Tasks; using System.Windows.Input; @@ -15,8 +13,6 @@ public class ShellPageViewModel private readonly INavigationService _navigationService; private readonly IApplicationViewService _applicationViewService; - public ICommand NavigationViewItemInvokedCommand { get; set; } - public ShellPageViewModel( IDialogService dialogService, INavigationService navigationService, @@ -31,6 +27,8 @@ public ShellPageViewModel( } + public ICommand NavigationViewItemInvokedCommand { get; set; } + private async Task OnNavigationViewItemInvoked(string parameter) { if (parameter is string tag) @@ -62,4 +60,4 @@ private NavigationPageKeys ConvertTagToPageKey(string tag) return NavigationPageKeys.ChatPage; } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Uwp/App.xaml.cs b/src/ChatTailorAI.Uwp/App.xaml.cs index 62a3078..3c14166 100644 --- a/src/ChatTailorAI.Uwp/App.xaml.cs +++ b/src/ChatTailorAI.Uwp/App.xaml.cs @@ -16,7 +16,6 @@ using ChatTailorAI.Uwp.Services.Configuration; using ChatTailorAI.Uwp.Helpers; using ChatTailorAI.Shared.Services.Common; -using ChatTailorAI.Shared.Services.Prompts; using ChatTailorAI.Uwp.Views; using Microsoft.Extensions.Configuration; using System.IO; @@ -118,7 +117,6 @@ async Task InitializeApplicationAsync() ConfigureLogger(); await InitializeDatabaseAsync(); - await MigratePromptsFileToDatabase(); await InitializeStoreEngagement(); await CheckForUpdateOrFirstRun(); } @@ -135,15 +133,6 @@ private async Task InitializeDatabaseAsync() await dbInitializer.InitializeAsync(); } - private async Task MigratePromptsFileToDatabase() - { - // Remove this in the future after all users have migrated off of the file - // This will be when the app has been updated a few times and no users - // are left on v1.3.1 or lower - IPromptService promptService = ServiceHost.Services.GetService(); - await promptService.MigratePromptsAsync(); - } - private async Task InitializeStoreEngagement() { StoreServicesEngagementManager engagementManager = StoreServicesEngagementManager.GetDefault(); diff --git a/src/ChatTailorAI.Uwp/Behaviors/CloseFlyoutBehavior.cs b/src/ChatTailorAI.Uwp/Behaviors/CloseFlyoutBehavior.cs index c380953..1e9b2ac 100644 --- a/src/ChatTailorAI.Uwp/Behaviors/CloseFlyoutBehavior.cs +++ b/src/ChatTailorAI.Uwp/Behaviors/CloseFlyoutBehavior.cs @@ -1,9 +1,4 @@ using Microsoft.Xaml.Interactivity; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Windows.UI.Xaml.Controls.Primitives; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml; diff --git a/src/ChatTailorAI.Uwp/Behaviors/FlyoutCommandBehavior.cs b/src/ChatTailorAI.Uwp/Behaviors/FlyoutCommandBehavior.cs index 667839a..6b5b897 100644 --- a/src/ChatTailorAI.Uwp/Behaviors/FlyoutCommandBehavior.cs +++ b/src/ChatTailorAI.Uwp/Behaviors/FlyoutCommandBehavior.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Input; +using System.Windows.Input; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml; diff --git a/src/ChatTailorAI.Uwp/Behaviors/GridViewSelectedItemsBehavior.cs b/src/ChatTailorAI.Uwp/Behaviors/GridViewSelectedItemsBehavior.cs index 1db8e68..7bf61e4 100644 --- a/src/ChatTailorAI.Uwp/Behaviors/GridViewSelectedItemsBehavior.cs +++ b/src/ChatTailorAI.Uwp/Behaviors/GridViewSelectedItemsBehavior.cs @@ -1,13 +1,9 @@ -using Microsoft.Xaml.Interactivity; -using System; +using System; using System.Collections; -using System.Collections.Generic; using System.Collections.Specialized; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; +using Microsoft.Xaml.Interactivity; namespace ChatTailorAI.Uwp.Behaviors { diff --git a/src/ChatTailorAI.Uwp/Behaviors/ItemClickBehavior.cs b/src/ChatTailorAI.Uwp/Behaviors/ItemClickBehavior.cs index 9214273..579cb5a 100644 --- a/src/ChatTailorAI.Uwp/Behaviors/ItemClickBehavior.cs +++ b/src/ChatTailorAI.Uwp/Behaviors/ItemClickBehavior.cs @@ -1,12 +1,7 @@ -using Microsoft.Xaml.Interactivity; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Input; +using System.Windows.Input; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml; +using Microsoft.Xaml.Interactivity; namespace ChatTailorAI.Uwp.Behaviors { diff --git a/src/ChatTailorAI.Uwp/Behaviors/ListViewFlyoutBehavior.cs b/src/ChatTailorAI.Uwp/Behaviors/ListViewFlyoutBehavior.cs index acdc600..df79350 100644 --- a/src/ChatTailorAI.Uwp/Behaviors/ListViewFlyoutBehavior.cs +++ b/src/ChatTailorAI.Uwp/Behaviors/ListViewFlyoutBehavior.cs @@ -1,13 +1,8 @@ -using Microsoft.Xaml.Interactivity; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Input; +using System.Windows.Input; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls.Primitives; +using Microsoft.Xaml.Interactivity; namespace ChatTailorAI.Uwp.Behaviors { diff --git a/src/ChatTailorAI.Uwp/Behaviors/ListViewItemBehavior.cs b/src/ChatTailorAI.Uwp/Behaviors/ListViewItemBehavior.cs index 910dde9..ae35c94 100644 --- a/src/ChatTailorAI.Uwp/Behaviors/ListViewItemBehavior.cs +++ b/src/ChatTailorAI.Uwp/Behaviors/ListViewItemBehavior.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Controls.Primitives; using Windows.UI.Xaml; namespace ChatTailorAI.Uwp.Behaviors diff --git a/src/ChatTailorAI.Uwp/Behaviors/NumberBoxRoundBehavior.cs b/src/ChatTailorAI.Uwp/Behaviors/NumberBoxRoundBehavior.cs index 237b0ce..580b093 100644 --- a/src/ChatTailorAI.Uwp/Behaviors/NumberBoxRoundBehavior.cs +++ b/src/ChatTailorAI.Uwp/Behaviors/NumberBoxRoundBehavior.cs @@ -1,11 +1,7 @@ -using Microsoft.UI.Xaml.Controls; -using Microsoft.Xaml.Interactivity; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Windows.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.Xaml.Interactivity; namespace ChatTailorAI.Uwp.Behaviors { diff --git a/src/ChatTailorAI.Uwp/Behaviors/PasswordBoxBehavior.cs b/src/ChatTailorAI.Uwp/Behaviors/PasswordBoxBehavior.cs index c195886..01b05f4 100644 --- a/src/ChatTailorAI.Uwp/Behaviors/PasswordBoxBehavior.cs +++ b/src/ChatTailorAI.Uwp/Behaviors/PasswordBoxBehavior.cs @@ -1,6 +1,6 @@ -using Microsoft.Xaml.Interactivity; -using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls; using Windows.UI.Xaml; +using Microsoft.Xaml.Interactivity; namespace ChatTailorAI.Uwp.Behaviors { diff --git a/src/ChatTailorAI.Uwp/Behaviors/SelectedItemBehavior.cs b/src/ChatTailorAI.Uwp/Behaviors/SelectedItemBehavior.cs index c29cb87..f7d53a9 100644 --- a/src/ChatTailorAI.Uwp/Behaviors/SelectedItemBehavior.cs +++ b/src/ChatTailorAI.Uwp/Behaviors/SelectedItemBehavior.cs @@ -1,11 +1,6 @@ -using Microsoft.Xaml.Interactivity; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls; using Windows.UI.Xaml; +using Microsoft.Xaml.Interactivity; namespace ChatTailorAI.Uwp.Behaviors { diff --git a/src/ChatTailorAI.Uwp/Behaviors/SelectedItemsBehavior.cs b/src/ChatTailorAI.Uwp/Behaviors/SelectedItemsBehavior.cs index d93980a..8981c0f 100644 --- a/src/ChatTailorAI.Uwp/Behaviors/SelectedItemsBehavior.cs +++ b/src/ChatTailorAI.Uwp/Behaviors/SelectedItemsBehavior.cs @@ -1,12 +1,8 @@ -using Microsoft.Xaml.Interactivity; -using System; -using System.Collections; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml; +using Microsoft.Xaml.Interactivity; using ChatTailorAI.Shared.Models.Shared; using ChatTailorAI.Shared.Models.Tools; diff --git a/src/ChatTailorAI.Uwp/Behaviors/TextBoxLostFocusBehavior.cs b/src/ChatTailorAI.Uwp/Behaviors/TextBoxLostFocusBehavior.cs index b09aff8..1c057cd 100644 --- a/src/ChatTailorAI.Uwp/Behaviors/TextBoxLostFocusBehavior.cs +++ b/src/ChatTailorAI.Uwp/Behaviors/TextBoxLostFocusBehavior.cs @@ -1,12 +1,6 @@ -using Microsoft.Xaml.Interactivity; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml; +using Windows.UI.Xaml; using System.Windows.Input; +using Microsoft.Xaml.Interactivity; namespace ChatTailorAI.Uwp.Behaviors { diff --git a/src/ChatTailorAI.Uwp/Converters/BooleanToInverseVisibilityConverter.cs b/src/ChatTailorAI.Uwp/Converters/BooleanToInverseVisibilityConverter.cs index 58364a8..cf65ee7 100644 --- a/src/ChatTailorAI.Uwp/Converters/BooleanToInverseVisibilityConverter.cs +++ b/src/ChatTailorAI.Uwp/Converters/BooleanToInverseVisibilityConverter.cs @@ -1,13 +1,6 @@ using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Windows.UI.Xaml.Data; using Windows.UI.Xaml; -using Windows.Storage; -using Windows.UI.Xaml.Media.Imaging; namespace ChatTailorAI.Uwp.Converters { diff --git a/src/ChatTailorAI.Uwp/Converters/BooleanToVisibilityConverter.cs b/src/ChatTailorAI.Uwp/Converters/BooleanToVisibilityConverter.cs index e200e53..ac6f408 100644 --- a/src/ChatTailorAI.Uwp/Converters/BooleanToVisibilityConverter.cs +++ b/src/ChatTailorAI.Uwp/Converters/BooleanToVisibilityConverter.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Windows.UI.Xaml.Data; using Windows.UI.Xaml; diff --git a/src/ChatTailorAI.Uwp/Converters/ChatImageMessageToVisibilityConverter.cs b/src/ChatTailorAI.Uwp/Converters/ChatImageMessageToVisibilityConverter.cs index 047d2c9..a7074c4 100644 --- a/src/ChatTailorAI.Uwp/Converters/ChatImageMessageToVisibilityConverter.cs +++ b/src/ChatTailorAI.Uwp/Converters/ChatImageMessageToVisibilityConverter.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Windows.UI.Xaml.Data; using Windows.UI.Xaml; using ChatTailorAI.Shared.Models.Chat.OpenAI; diff --git a/src/ChatTailorAI.Uwp/Converters/CollectionEmptyToVisibilityConverter.cs b/src/ChatTailorAI.Uwp/Converters/CollectionEmptyToVisibilityConverter.cs index 10d9297..991ca62 100644 --- a/src/ChatTailorAI.Uwp/Converters/CollectionEmptyToVisibilityConverter.cs +++ b/src/ChatTailorAI.Uwp/Converters/CollectionEmptyToVisibilityConverter.cs @@ -1,9 +1,5 @@ using System; using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Windows.UI.Xaml.Data; using Windows.UI.Xaml; diff --git a/src/ChatTailorAI.Uwp/Converters/FilePathToImageSourceConverter.cs b/src/ChatTailorAI.Uwp/Converters/FilePathToImageSourceConverter.cs index 1d319ec..ebd4f6a 100644 --- a/src/ChatTailorAI.Uwp/Converters/FilePathToImageSourceConverter.cs +++ b/src/ChatTailorAI.Uwp/Converters/FilePathToImageSourceConverter.cs @@ -1,11 +1,6 @@ using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Windows.Storage; -using Windows.Storage.Streams; using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Media.Imaging; diff --git a/src/ChatTailorAI.Uwp/Converters/ImageSourceConverter.cs b/src/ChatTailorAI.Uwp/Converters/ImageSourceConverter.cs index d22a55c..e1a4623 100644 --- a/src/ChatTailorAI.Uwp/Converters/ImageSourceConverter.cs +++ b/src/ChatTailorAI.Uwp/Converters/ImageSourceConverter.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Windows.UI.Xaml.Data; namespace ChatTailorAI.Uwp.Converters diff --git a/src/ChatTailorAI.Uwp/Converters/InverseCollectionEmptyToVisibilityConverter.cs b/src/ChatTailorAI.Uwp/Converters/InverseCollectionEmptyToVisibilityConverter.cs index 237d16f..cdee07e 100644 --- a/src/ChatTailorAI.Uwp/Converters/InverseCollectionEmptyToVisibilityConverter.cs +++ b/src/ChatTailorAI.Uwp/Converters/InverseCollectionEmptyToVisibilityConverter.cs @@ -1,9 +1,5 @@ using System; using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Windows.UI.Xaml.Data; using Windows.UI.Xaml; diff --git a/src/ChatTailorAI.Uwp/Converters/InvertBooleanConverter.cs b/src/ChatTailorAI.Uwp/Converters/InvertBooleanConverter.cs index 1417b3e..7635978 100644 --- a/src/ChatTailorAI.Uwp/Converters/InvertBooleanConverter.cs +++ b/src/ChatTailorAI.Uwp/Converters/InvertBooleanConverter.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Windows.UI.Xaml; using Windows.UI.Xaml.Data; diff --git a/src/ChatTailorAI.Uwp/Converters/NotFunctionToVisibilityConverter.cs b/src/ChatTailorAI.Uwp/Converters/NotFunctionToVisibilityConverter.cs index 469b104..f7a45bb 100644 --- a/src/ChatTailorAI.Uwp/Converters/NotFunctionToVisibilityConverter.cs +++ b/src/ChatTailorAI.Uwp/Converters/NotFunctionToVisibilityConverter.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Windows.UI.Xaml.Data; using Windows.UI.Xaml; diff --git a/src/ChatTailorAI.Uwp/Converters/NullToVisibilityConverter.cs b/src/ChatTailorAI.Uwp/Converters/NullToVisibilityConverter.cs index d5b6d22..72c4ed7 100644 --- a/src/ChatTailorAI.Uwp/Converters/NullToVisibilityConverter.cs +++ b/src/ChatTailorAI.Uwp/Converters/NullToVisibilityConverter.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Windows.UI.Xaml; using Windows.UI.Xaml.Data; diff --git a/src/ChatTailorAI.Uwp/Factories/DialogFactory.cs b/src/ChatTailorAI.Uwp/Factories/DialogFactory.cs index bd18f4f..4af42f4 100644 --- a/src/ChatTailorAI.Uwp/Factories/DialogFactory.cs +++ b/src/ChatTailorAI.Uwp/Factories/DialogFactory.cs @@ -1,17 +1,13 @@ -using ChatTailorAI.Shared.Dto; -using ChatTailorAI.Shared.ViewModels; -using ChatTailorAI.Uwp.Views.Dialogs; -using ChatTailorAI.Uwp.Views; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System; using System.Threading.Tasks; using Windows.UI.Xaml.Controls; using ChatTailorAI.Shared.Dto.Conversations; using ChatTailorAI.Shared.Factories.ViewModels; using ChatTailorAI.Shared.Factories.Interfaces; using ChatTailorAI.Shared.ViewModels.Dialogs; +using ChatTailorAI.Shared.Dto; +using ChatTailorAI.Uwp.Views.Dialogs; +using ChatTailorAI.Uwp.Views; namespace ChatTailorAI.Uwp.Factories { diff --git a/src/ChatTailorAI.Uwp/Helpers/DatabasePathProvider.cs b/src/ChatTailorAI.Uwp/Helpers/DatabasePathProvider.cs index 1a4abf8..6111324 100644 --- a/src/ChatTailorAI.Uwp/Helpers/DatabasePathProvider.cs +++ b/src/ChatTailorAI.Uwp/Helpers/DatabasePathProvider.cs @@ -1,10 +1,5 @@ -using ChatTailorAI.DataAccess.Database.Interfaces; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.IO; +using ChatTailorAI.DataAccess.Database.Interfaces; namespace ChatTailorAI.Uwp.Helpers { @@ -15,4 +10,4 @@ public string GetDatabasePath() return Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "ChatTailorAI.db"); } } -} +} \ No newline at end of file diff --git a/src/ChatTailorAI.Uwp/Helpers/TitleBarHelper.cs b/src/ChatTailorAI.Uwp/Helpers/TitleBarHelper.cs index 309e7a3..c8389e8 100644 --- a/src/ChatTailorAI.Uwp/Helpers/TitleBarHelper.cs +++ b/src/ChatTailorAI.Uwp/Helpers/TitleBarHelper.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Windows.ApplicationModel.Core; +using Windows.ApplicationModel.Core; using Windows.UI.ViewManagement; namespace ChatTailorAI.Uwp.Helpers diff --git a/src/ChatTailorAI.Uwp/Package.appxmanifest b/src/ChatTailorAI.Uwp/Package.appxmanifest index 5ea54cb..22a3deb 100644 --- a/src/ChatTailorAI.Uwp/Package.appxmanifest +++ b/src/ChatTailorAI.Uwp/Package.appxmanifest @@ -10,7 +10,7 @@ + Version="2.4.2.0" /> diff --git a/src/ChatTailorAI.Uwp/Selectors/BotMessageDataTemplateSelector.cs b/src/ChatTailorAI.Uwp/Selectors/BotMessageDataTemplateSelector.cs index ee12ec2..db23ffa 100644 --- a/src/ChatTailorAI.Uwp/Selectors/BotMessageDataTemplateSelector.cs +++ b/src/ChatTailorAI.Uwp/Selectors/BotMessageDataTemplateSelector.cs @@ -1,11 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls; using Windows.UI.Xaml; -using ChatTailorAI.Shared.Models.Chat.OpenAI; using ChatTailorAI.Shared.ViewModels; namespace ChatTailorAI.Uwp.Selectors diff --git a/src/ChatTailorAI.Uwp/Selectors/ChatMessageTemplateSelector.cs b/src/ChatTailorAI.Uwp/Selectors/ChatMessageTemplateSelector.cs index 6e88275..6e01354 100644 --- a/src/ChatTailorAI.Uwp/Selectors/ChatMessageTemplateSelector.cs +++ b/src/ChatTailorAI.Uwp/Selectors/ChatMessageTemplateSelector.cs @@ -1,11 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls; using Windows.UI.Xaml; -using ChatTailorAI.Shared.Models.Chat.OpenAI; using ChatTailorAI.Shared.ViewModels; namespace ChatTailorAI.Uwp.Selectors diff --git a/src/ChatTailorAI.Uwp/Selectors/UserMessageDataTemplateSelector.cs b/src/ChatTailorAI.Uwp/Selectors/UserMessageDataTemplateSelector.cs index aecef5c..35ddd8e 100644 --- a/src/ChatTailorAI.Uwp/Selectors/UserMessageDataTemplateSelector.cs +++ b/src/ChatTailorAI.Uwp/Selectors/UserMessageDataTemplateSelector.cs @@ -1,11 +1,6 @@ -using ChatTailorAI.Shared.ViewModels; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls; using Windows.UI.Xaml; +using ChatTailorAI.Shared.ViewModels; namespace ChatTailorAI.Uwp.Selectors { diff --git a/src/ChatTailorAI.Uwp/Services/Configuration/ServiceConfiguration.cs b/src/ChatTailorAI.Uwp/Services/Configuration/ServiceConfiguration.cs index 2386c0b..71f15e8 100644 --- a/src/ChatTailorAI.Uwp/Services/Configuration/ServiceConfiguration.cs +++ b/src/ChatTailorAI.Uwp/Services/Configuration/ServiceConfiguration.cs @@ -34,7 +34,6 @@ using ChatTailorAI.Shared.Services.Chat.OpenAI; using ChatTailorAI.Shared.Services.Tools; using ChatTailorAI.Shared.Services.Authentication; -using ChatTailorAI.Shared.Models.Speech; using ChatTailorAI.Shared.Services.Files; using ChatTailorAI.Shared.Factories.ViewModels; using ChatTailorAI.Shared.Builders; @@ -44,8 +43,6 @@ using ChatTailorAI.Services.Chat.OpenAI; using ChatTailorAI.Shared.ViewModels.Dialogs; using ChatTailorAI.Shared.ViewModels.Pages; -using ChatTailorAI.Shared.Services.Prompts; -using ChatTailorAI.Services.Prompts; using ChatTailorAI.DataAccess.Database.Providers.SQLite; using ChatTailorAI.Shared.Transformers.Anthropic; using ChatTailorAI.Shared.Services.Chat.Anthropic; @@ -65,6 +62,10 @@ using ChatTailorAI.Services.Uwp.UI.Navigation; using ChatTailorAI.Uwp.Services.UI.Dialogs; using ChatTailorAI.Services.Uwp.UI.Views; +using ChatTailorAI.Services.Image.OpenAI; +using ChatTailorAI.Shared.Services.Audio; +using ChatTailorAI.Shared.Services.Common.Navigation; +using Windows.Storage; namespace ChatTailorAI.Uwp.Services.Configuration { @@ -150,15 +151,16 @@ private static void ConfigureServices(IServiceCollection services, IConfiguratio services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); - services.AddSingleton(); + services.AddSingleton, FolderService>(); services.AddSingleton(); services.AddHttpClient(); services.AddSingleton(); services.AddHttpClient(); - services.AddHttpClient(); - services.AddHttpClient(); + services.AddHttpClient(); + services.AddHttpClient(); services.AddHttpClient(); - services.AddHttpClient(); + services.AddHttpClient(); + services.AddSingleton(); services.AddSingleton(); services.AddHttpClient(); services.AddHttpClient(); @@ -176,9 +178,7 @@ private static void ConfigureServices(IServiceCollection services, IConfiguratio services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); - services.AddSingleton(); services.AddSingleton(); - services.AddSingleton(); services.AddSingleton(); // Transformers diff --git a/src/ChatTailorAI.Uwp/Services/PageTypeResolver.cs b/src/ChatTailorAI.Uwp/Services/PageTypeResolver.cs index 6bf34b2..da6c2d2 100644 --- a/src/ChatTailorAI.Uwp/Services/PageTypeResolver.cs +++ b/src/ChatTailorAI.Uwp/Services/PageTypeResolver.cs @@ -1,5 +1,5 @@ using ChatTailorAI.Shared.Enums; -using ChatTailorAI.Shared.Services.Common; +using ChatTailorAI.Shared.Services.Common.Navigation; using ChatTailorAI.Uwp.Views; using System; using System.Collections.Generic; diff --git a/src/ChatTailorAI.Uwp/Views/ChatsPage.xaml.cs b/src/ChatTailorAI.Uwp/Views/ChatsPage.xaml.cs index 6012208..d30a7b9 100644 --- a/src/ChatTailorAI.Uwp/Views/ChatsPage.xaml.cs +++ b/src/ChatTailorAI.Uwp/Views/ChatsPage.xaml.cs @@ -1,5 +1,5 @@ using ChatTailorAI.Shared.Models.Conversations; -using ChatTailorAI.Shared.Services.Common; +using ChatTailorAI.Shared.Services.Common.Navigation; using ChatTailorAI.Shared.ViewModels; using ChatTailorAI.Shared.ViewModels.Pages; using Microsoft.Extensions.DependencyInjection; diff --git a/src/ChatTailorAI.Uwp/Views/ShellPage.xaml.cs b/src/ChatTailorAI.Uwp/Views/ShellPage.xaml.cs index a524e5b..29d05f6 100644 --- a/src/ChatTailorAI.Uwp/Views/ShellPage.xaml.cs +++ b/src/ChatTailorAI.Uwp/Views/ShellPage.xaml.cs @@ -1,4 +1,4 @@ -using ChatTailorAI.Shared.Services.Common; +using ChatTailorAI.Shared.Services.Common.Navigation; using ChatTailorAI.Shared.Services.Events; using ChatTailorAI.Shared.ViewModels.Pages; using Microsoft.Extensions.DependencyInjection;