mirror of
				https://github.com/MindWorkAI/AI-Studio.git
				synced 2025-11-04 12:40:21 +00:00 
			
		
		
		
	Improved the error handling for the entire RAG process
This commit is contained in:
		
							parent
							
								
									8e39fb85c5
								
							
						
					
					
						commit
						4a5daed77b
					
				@ -43,10 +43,18 @@ public sealed class ContentText : IContent
 | 
				
			|||||||
        
 | 
					        
 | 
				
			||||||
        // Call the RAG process. Right now, we only have one RAG process:
 | 
					        // Call the RAG process. Right now, we only have one RAG process:
 | 
				
			||||||
        if (lastPrompt is not null)
 | 
					        if (lastPrompt is not null)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            try
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                var rag = new AISrcSelWithRetCtxVal();
 | 
					                var rag = new AISrcSelWithRetCtxVal();
 | 
				
			||||||
                chatThread = await rag.ProcessAsync(provider, lastPrompt, chatThread, token);
 | 
					                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
 | 
					        // Store the last time we got a response. We use this later
 | 
				
			||||||
        // to determine whether we should notify the UI about the
 | 
					        // to determine whether we should notify the UI about the
 | 
				
			||||||
 | 
				
			|||||||
@ -2,3 +2,4 @@
 | 
				
			|||||||
- Added the "Community & Code" section to the about page. It includes links to the GitHub repositories and the project website.
 | 
					- 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 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 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.
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user