mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 10:39:47 +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,15 +44,35 @@ 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)
|
||||||
//
|
{
|
||||||
// Trigger the retrieval part of the (R)AG process:
|
//
|
||||||
//
|
// 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
|
||||||
// Perform the augmentation of the R(A)G process:
|
// 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:
|
||||||
|
//
|
||||||
|
|
||||||
|
//
|
||||||
|
// 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
|
||||||
// new content or not. Depends on the energy saving mode
|
// new content or not. Depends on the energy saving mode
|
||||||
|
Loading…
Reference in New Issue
Block a user