diff --git a/app/MindWork AI Studio/Chat/ContentText.cs b/app/MindWork AI Studio/Chat/ContentText.cs index 9f51175..82b5334 100644 --- a/app/MindWork AI Studio/Chat/ContentText.cs +++ b/app/MindWork AI Studio/Chat/ContentText.cs @@ -44,8 +44,16 @@ public sealed class ContentText : IContent // Call the RAG process. Right now, we only have one RAG process: if (lastPrompt is not null) { - var rag = new AISrcSelWithRetCtxVal(); - chatThread = await rag.ProcessAsync(provider, lastPrompt, chatThread, token); + try + { + var rag = new AISrcSelWithRetCtxVal(); + chatThread = await rag.ProcessAsync(provider, lastPrompt, chatThread, token); + } + catch (Exception e) + { + var logger = Program.SERVICE_PROVIDER.GetService>()!; + logger.LogError(e, "Skipping the RAG process due to an error."); + } } // Store the last time we got a response. We use this later diff --git a/app/MindWork AI Studio/Dialogs/DataSourceERI-V1InfoDialog.razor b/app/MindWork AI Studio/Dialogs/DataSourceERI-V1InfoDialog.razor index 984d2e4..41344b9 100644 --- a/app/MindWork AI Studio/Dialogs/DataSourceERI-V1InfoDialog.razor +++ b/app/MindWork AI Studio/Dialogs/DataSourceERI-V1InfoDialog.razor @@ -59,7 +59,8 @@ Embeddings - @if (!info.Embeddings.Any()) + @* ReSharper disable once ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract *@ + @if (info.Embeddings is null || !info.Embeddings.Any()) { The data source does not provide any embedding information. diff --git a/app/MindWork AI Studio/Dialogs/DataSourceERI-V1InfoDialog.razor.cs b/app/MindWork AI Studio/Dialogs/DataSourceERI-V1InfoDialog.razor.cs index 192347d..5f5a442 100644 --- a/app/MindWork AI Studio/Dialogs/DataSourceERI-V1InfoDialog.razor.cs +++ b/app/MindWork AI Studio/Dialogs/DataSourceERI-V1InfoDialog.razor.cs @@ -130,7 +130,6 @@ public partial class DataSourceERI_V1InfoDialog : ComponentBase, IAsyncDisposabl } this.retrievalInfoformation = retrievalInfoResult.Data ?? []; - this.StateHasChanged(); } catch (Exception e) diff --git a/app/MindWork AI Studio/Tools/ERIClient/ERIClientBase.cs b/app/MindWork AI Studio/Tools/ERIClient/ERIClientBase.cs index 18f5d2e..58811b0 100644 --- a/app/MindWork AI Studio/Tools/ERIClient/ERIClientBase.cs +++ b/app/MindWork AI Studio/Tools/ERIClient/ERIClientBase.cs @@ -9,9 +9,10 @@ public abstract class ERIClientBase(string baseAddress) : IDisposable { WriteIndented = true, AllowTrailingCommas = true, + PropertyNameCaseInsensitive = true, PropertyNamingPolicy = JsonNamingPolicy.CamelCase, DictionaryKeyPolicy = JsonNamingPolicy.CamelCase, - PropertyNameCaseInsensitive = true, + UnmappedMemberHandling = JsonUnmappedMemberHandling.Disallow, Converters = { new JsonStringEnumConverter(JsonNamingPolicy.SnakeCaseUpper), diff --git a/app/MindWork AI Studio/wwwroot/changelog/v0.9.32.md b/app/MindWork AI Studio/wwwroot/changelog/v0.9.32.md index b1797bd..5cdac4d 100644 --- a/app/MindWork AI Studio/wwwroot/changelog/v0.9.32.md +++ b/app/MindWork AI Studio/wwwroot/changelog/v0.9.32.md @@ -1,3 +1,6 @@ # v0.9.32, build 207 (2025-03-xx xx:xx UTC) - Added the "Community & Code" section to the about page. It includes links to the GitHub repositories and the project website. -- Improved the ERI client to expect JSON responses and send JSON requests using camel case. \ No newline at end of file +- Improved the ERI client to expect JSON responses and send JSON requests using camel case. +- Improved the ERI client to raise an error when the server responds with additional JSON data that is not expected. +- Improved the error handling in the ERI data source info dialog in cases where servers respond with an invalid message. +- Improved the error handling for the entire RAG process. \ No newline at end of file