mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 11:59:48 +00:00
Store the AI-selected data sources to the chat thread so that the user can see the selection
This commit is contained in:
parent
171a83ba58
commit
906219dd25
@ -154,6 +154,9 @@ public sealed class ContentText : IContent
|
||||
// Transform the selected data sources to the actual data sources.
|
||||
selectedDataSources = aiSelectedDataSources.Select(x => settings.ConfigurationData.DataSources.FirstOrDefault(ds => ds.Id == x.Id)).Where(ds => ds is not null).ToList()!;
|
||||
}
|
||||
|
||||
// Store the changes in the chat thread:
|
||||
chatThread.DataSourceOptions.PreselectedDataSourceIds = selectedDataSources.Select(ds => ds.Id).ToList();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -481,6 +481,14 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
|
||||
|
||||
// Disable the stream state:
|
||||
this.isStreaming = false;
|
||||
|
||||
// Update the data source options. This is useful when
|
||||
// the AI is responsible for selecting the data source.
|
||||
// The user can then see the selected data source:
|
||||
if(this.ChatThread?.DataSourceOptions.AutomaticDataSourceSelection ?? false)
|
||||
this.dataSourceSelectionComponent?.ChangeOptionWithoutSaving(this.ChatThread!.DataSourceOptions);
|
||||
|
||||
// Update the UI:
|
||||
this.StateHasChanged();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user