Improved the error handling for the entire RAG process

This commit is contained in:
Thorsten Sommer 2025-03-08 10:42:03 +01:00
parent 8e39fb85c5
commit 4a5daed77b
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 12 additions and 3 deletions

View File

@ -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<ILogger<ContentText>>()!;
logger.LogError(e, "Skipping the RAG process due to an error.");
}
}
// Store the last time we got a response. We use this later

View File

@ -2,3 +2,4 @@
- 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.
- Improved the ERI client to raise an error when the server responds with additional JSON data that is not expected.
- Improved the error handling for the entire RAG process.