Improved RAG issue handling (#313)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2025-03-08 11:14:20 +01:00
1 parent 3bfca45e11
commit df01ce188e
5 files changed
+18 -6

No files matched your search

+10 -2
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