mirror of
				https://github.com/MindWorkAI/AI-Studio.git
				synced 2025-11-04 04:00:21 +00:00 
			
		
		
		
	Implemented the final data source filter step just before eventually the RAG process starts
This commit is contained in:
		
							parent
							
								
									5ee7f2f2f1
								
							
						
					
					
						commit
						762b4ba628
					
				@ -2,6 +2,7 @@ using System.Text.Json.Serialization;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
using AIStudio.Provider;
 | 
					using AIStudio.Provider;
 | 
				
			||||||
using AIStudio.Settings;
 | 
					using AIStudio.Settings;
 | 
				
			||||||
 | 
					using AIStudio.Tools.Services;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace AIStudio.Chat;
 | 
					namespace AIStudio.Chat;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -43,6 +44,25 @@ public sealed class ContentText : IContent
 | 
				
			|||||||
        //
 | 
					        //
 | 
				
			||||||
        // Check if the user wants to bind any data sources to the chat:
 | 
					        // Check if the user wants to bind any data sources to the chat:
 | 
				
			||||||
        //
 | 
					        //
 | 
				
			||||||
 | 
					        if (chatThread.UseDataSources)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            //
 | 
				
			||||||
 | 
					            // When the user wants to bind data sources to the chat, we
 | 
				
			||||||
 | 
					            // have to check if the data sources are available for the
 | 
				
			||||||
 | 
					            // selected provider. Also, we have to check if any ERI
 | 
				
			||||||
 | 
					            // data sources changed its security requirements.
 | 
				
			||||||
 | 
					            //
 | 
				
			||||||
 | 
					            List<IDataSource> preselectedDataSources = chatThread.DataSourceOptions.PreselectedDataSourceIds.Select(id => settings.ConfigurationData.DataSources.FirstOrDefault(ds => ds.Id == id)).Where(ds => ds is not null).ToList()!;
 | 
				
			||||||
 | 
					            var dataSources = await dataSourceService.GetDataSources(provider, preselectedDataSources);
 | 
				
			||||||
 | 
					            var selectedDataSources = dataSources.SelectedDataSources;
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
 | 
					            //
 | 
				
			||||||
 | 
					            // Should the AI select the data sources?
 | 
				
			||||||
 | 
					            //
 | 
				
			||||||
 | 
					            if (chatThread.DataSourceOptions.AutomaticDataSourceSelection)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                // TODO: Start agent based on allowed data sources.
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            //
 | 
					            //
 | 
				
			||||||
            // Trigger the retrieval part of the (R)AG process:
 | 
					            // Trigger the retrieval part of the (R)AG process:
 | 
				
			||||||
@ -51,6 +71,7 @@ public sealed class ContentText : IContent
 | 
				
			|||||||
            //
 | 
					            //
 | 
				
			||||||
            // Perform the augmentation of the R(A)G process:
 | 
					            // Perform the augmentation of the R(A)G process:
 | 
				
			||||||
            //
 | 
					            //
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // 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
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user