mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-15 21:41:37 +00:00
Added a description field to local data sources
This commit is contained in:
parent
ab9b27f1f4
commit
134c018117
@ -188,11 +188,17 @@ public sealed class AgentDataSourceSelection (ILogger<AgentDataSourceSelection>
|
|||||||
switch (ds)
|
switch (ds)
|
||||||
{
|
{
|
||||||
case DataSourceLocalDirectory localDirectory:
|
case DataSourceLocalDirectory localDirectory:
|
||||||
sb.AppendLine($"- Id={ds.Id}, name='{localDirectory.Name}', type=local directory, path='{localDirectory.Path}'");
|
if (string.IsNullOrWhiteSpace(localDirectory.Description))
|
||||||
|
sb.AppendLine($"- Id={ds.Id}, name='{localDirectory.Name}', type=local directory, path='{localDirectory.Path}'");
|
||||||
|
else
|
||||||
|
sb.AppendLine($"- Id={ds.Id}, name='{localDirectory.Name}', type=local directory, path='{localDirectory.Path}', description='{localDirectory.Description}'");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DataSourceLocalFile localFile:
|
case DataSourceLocalFile localFile:
|
||||||
sb.AppendLine($"- Id={ds.Id}, name='{localFile.Name}', type=local file, path='{localFile.FilePath}'");
|
if (string.IsNullOrWhiteSpace(localFile.Description))
|
||||||
|
sb.AppendLine($"- Id={ds.Id}, name='{localFile.Name}', type=local file, path='{localFile.FilePath}'");
|
||||||
|
else
|
||||||
|
sb.AppendLine($"- Id={ds.Id}, name='{localFile.Name}', type=local file, path='{localFile.FilePath}', description='{localFile.Description}'");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IERIDataSource eriDataSource:
|
case IERIDataSource eriDataSource:
|
||||||
|
|||||||
@ -20,6 +20,22 @@
|
|||||||
UserAttributes="@SPELLCHECK_ATTRIBUTES"
|
UserAttributes="@SPELLCHECK_ATTRIBUTES"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<MudTextField
|
||||||
|
T="string"
|
||||||
|
@bind-Text="@this.dataDescription"
|
||||||
|
Label="@T("Description")"
|
||||||
|
Class="mb-6"
|
||||||
|
MaxLength="200"
|
||||||
|
Counter="200"
|
||||||
|
Immediate="@true"
|
||||||
|
Adornment="Adornment.Start"
|
||||||
|
AdornmentIcon="@Icons.Material.Filled.Description"
|
||||||
|
AdornmentColor="Color.Info"
|
||||||
|
HelperText="@T("Describe what kind of data this source contains to help the AI select it appropriately.")"
|
||||||
|
UserAttributes="@SPELLCHECK_ATTRIBUTES"
|
||||||
|
Lines="3"
|
||||||
|
/>
|
||||||
|
|
||||||
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
|
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
|
||||||
@T("Select a root directory for this data source. All data in this directory and all its subdirectories will be processed for this data source.")
|
@T("Select a root directory for this data source. All data in this directory and all its subdirectories will be processed for this data source.")
|
||||||
</MudJustifiedText>
|
</MudJustifiedText>
|
||||||
|
|||||||
@ -37,6 +37,7 @@ public partial class DataSourceLocalDirectoryDialog : MSGComponentBase
|
|||||||
private uint dataNum;
|
private uint dataNum;
|
||||||
private string dataId = Guid.NewGuid().ToString();
|
private string dataId = Guid.NewGuid().ToString();
|
||||||
private string dataName = string.Empty;
|
private string dataName = string.Empty;
|
||||||
|
private string dataDescription = string.Empty;
|
||||||
private bool dataUserAcknowledgedCloudEmbedding;
|
private bool dataUserAcknowledgedCloudEmbedding;
|
||||||
private string dataEmbeddingId = string.Empty;
|
private string dataEmbeddingId = string.Empty;
|
||||||
private string dataPath = string.Empty;
|
private string dataPath = string.Empty;
|
||||||
@ -73,6 +74,7 @@ public partial class DataSourceLocalDirectoryDialog : MSGComponentBase
|
|||||||
this.dataNum = this.DataSource.Num;
|
this.dataNum = this.DataSource.Num;
|
||||||
this.dataId = this.DataSource.Id;
|
this.dataId = this.DataSource.Id;
|
||||||
this.dataName = this.DataSource.Name;
|
this.dataName = this.DataSource.Name;
|
||||||
|
this.dataDescription = this.DataSource.Description;
|
||||||
this.dataEmbeddingId = this.DataSource.EmbeddingId;
|
this.dataEmbeddingId = this.DataSource.EmbeddingId;
|
||||||
this.dataPath = this.DataSource.Path;
|
this.dataPath = this.DataSource.Path;
|
||||||
this.dataSecurityPolicy = this.DataSource.SecurityPolicy;
|
this.dataSecurityPolicy = this.DataSource.SecurityPolicy;
|
||||||
@ -101,6 +103,7 @@ public partial class DataSourceLocalDirectoryDialog : MSGComponentBase
|
|||||||
Id = this.dataId,
|
Id = this.dataId,
|
||||||
Num = this.dataNum,
|
Num = this.dataNum,
|
||||||
Name = this.dataName,
|
Name = this.dataName,
|
||||||
|
Description = this.dataDescription,
|
||||||
Type = DataSourceType.LOCAL_DIRECTORY,
|
Type = DataSourceType.LOCAL_DIRECTORY,
|
||||||
EmbeddingId = this.dataEmbeddingId,
|
EmbeddingId = this.dataEmbeddingId,
|
||||||
Path = this.dataPath,
|
Path = this.dataPath,
|
||||||
|
|||||||
@ -4,6 +4,10 @@
|
|||||||
<MudDialog>
|
<MudDialog>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<TextInfoLine Icon="@Icons.Material.Filled.Tag" Label="@T("Data source name")" Value="@this.DataSource.Name" ClipboardTooltipSubject="@T("the data source name")"/>
|
<TextInfoLine Icon="@Icons.Material.Filled.Tag" Label="@T("Data source name")" Value="@this.DataSource.Name" ClipboardTooltipSubject="@T("the data source name")"/>
|
||||||
|
@if (!string.IsNullOrWhiteSpace(this.DataSource.Description))
|
||||||
|
{
|
||||||
|
<TextInfoLine Icon="@Icons.Material.Filled.Description" Label="@T("Description")" Value="@this.DataSource.Description" ClipboardTooltipSubject="@T("the description")"/>
|
||||||
|
}
|
||||||
|
|
||||||
<TextInfoLine Icon="@Icons.Material.Filled.FolderOpen" Label="@T("Path")" Value="@this.DataSource.Path" ClipboardTooltipSubject="@T("this path")"/>
|
<TextInfoLine Icon="@Icons.Material.Filled.FolderOpen" Label="@T("Path")" Value="@this.DataSource.Path" ClipboardTooltipSubject="@T("this path")"/>
|
||||||
@if (!this.IsDirectoryAvailable)
|
@if (!this.IsDirectoryAvailable)
|
||||||
|
|||||||
@ -20,6 +20,22 @@
|
|||||||
UserAttributes="@SPELLCHECK_ATTRIBUTES"
|
UserAttributes="@SPELLCHECK_ATTRIBUTES"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<MudTextField
|
||||||
|
T="string"
|
||||||
|
@bind-Text="@this.dataDescription"
|
||||||
|
Label="@T("Description")"
|
||||||
|
Class="mb-6"
|
||||||
|
MaxLength="200"
|
||||||
|
Counter="200"
|
||||||
|
Immediate="@true"
|
||||||
|
Adornment="Adornment.Start"
|
||||||
|
AdornmentIcon="@Icons.Material.Filled.Description"
|
||||||
|
AdornmentColor="Color.Info"
|
||||||
|
HelperText="@T("Describe what kind of data this source contains to help the AI select it appropriately.")"
|
||||||
|
UserAttributes="@SPELLCHECK_ATTRIBUTES"
|
||||||
|
Lines="3"
|
||||||
|
/>
|
||||||
|
|
||||||
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
|
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
|
||||||
@T("Select a file for this data source. The content of this file will be processed for the data source.")
|
@T("Select a file for this data source. The content of this file will be processed for the data source.")
|
||||||
</MudJustifiedText>
|
</MudJustifiedText>
|
||||||
|
|||||||
@ -37,6 +37,7 @@ public partial class DataSourceLocalFileDialog : MSGComponentBase
|
|||||||
private uint dataNum;
|
private uint dataNum;
|
||||||
private string dataId = Guid.NewGuid().ToString();
|
private string dataId = Guid.NewGuid().ToString();
|
||||||
private string dataName = string.Empty;
|
private string dataName = string.Empty;
|
||||||
|
private string dataDescription = string.Empty;
|
||||||
private bool dataUserAcknowledgedCloudEmbedding;
|
private bool dataUserAcknowledgedCloudEmbedding;
|
||||||
private string dataEmbeddingId = string.Empty;
|
private string dataEmbeddingId = string.Empty;
|
||||||
private string dataFilePath = string.Empty;
|
private string dataFilePath = string.Empty;
|
||||||
@ -73,6 +74,7 @@ public partial class DataSourceLocalFileDialog : MSGComponentBase
|
|||||||
this.dataNum = this.DataSource.Num;
|
this.dataNum = this.DataSource.Num;
|
||||||
this.dataId = this.DataSource.Id;
|
this.dataId = this.DataSource.Id;
|
||||||
this.dataName = this.DataSource.Name;
|
this.dataName = this.DataSource.Name;
|
||||||
|
this.dataDescription = this.DataSource.Description;
|
||||||
this.dataEmbeddingId = this.DataSource.EmbeddingId;
|
this.dataEmbeddingId = this.DataSource.EmbeddingId;
|
||||||
this.dataFilePath = this.DataSource.FilePath;
|
this.dataFilePath = this.DataSource.FilePath;
|
||||||
this.dataSecurityPolicy = this.DataSource.SecurityPolicy;
|
this.dataSecurityPolicy = this.DataSource.SecurityPolicy;
|
||||||
@ -101,6 +103,7 @@ public partial class DataSourceLocalFileDialog : MSGComponentBase
|
|||||||
Id = this.dataId,
|
Id = this.dataId,
|
||||||
Num = this.dataNum,
|
Num = this.dataNum,
|
||||||
Name = this.dataName,
|
Name = this.dataName,
|
||||||
|
Description = this.dataDescription,
|
||||||
Type = DataSourceType.LOCAL_FILE,
|
Type = DataSourceType.LOCAL_FILE,
|
||||||
EmbeddingId = this.dataEmbeddingId,
|
EmbeddingId = this.dataEmbeddingId,
|
||||||
FilePath = this.dataFilePath,
|
FilePath = this.dataFilePath,
|
||||||
|
|||||||
@ -4,6 +4,11 @@
|
|||||||
<MudDialog>
|
<MudDialog>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<TextInfoLine Icon="@Icons.Material.Filled.Tag" Label="@T("Data source name")" Value="@this.DataSource.Name" ClipboardTooltipSubject="@T("the data source name")"/>
|
<TextInfoLine Icon="@Icons.Material.Filled.Tag" Label="@T("Data source name")" Value="@this.DataSource.Name" ClipboardTooltipSubject="@T("the data source name")"/>
|
||||||
|
@if (!string.IsNullOrWhiteSpace(this.DataSource.Description))
|
||||||
|
{
|
||||||
|
<TextInfoLine Icon="@Icons.Material.Filled.Description" Label="@T("Description")" Value="@this.DataSource.Description" ClipboardTooltipSubject="@T("the description")"/>
|
||||||
|
}
|
||||||
|
|
||||||
<TextInfoLine Icon="@Icons.Material.Filled.FolderOpen" Label="@T("File path")" Value="@this.DataSource.FilePath" ClipboardTooltipSubject="@T("this path")"/>
|
<TextInfoLine Icon="@Icons.Material.Filled.FolderOpen" Label="@T("File path")" Value="@this.DataSource.FilePath" ClipboardTooltipSubject="@T("this path")"/>
|
||||||
@if (!this.IsFileAvailable)
|
@if (!this.IsFileAvailable)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -21,6 +21,12 @@ public readonly record struct DataSourceLocalDirectory : IInternalDataSource
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public string Name { get; init; } = string.Empty;
|
public string Name { get; init; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The description of the data source. What kind of data does it contain?
|
||||||
|
/// What is the data source used for?
|
||||||
|
/// </summary>
|
||||||
|
public string Description { get; init; } = string.Empty;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public DataSourceType Type { get; init; } = DataSourceType.NONE;
|
public DataSourceType Type { get; init; } = DataSourceType.NONE;
|
||||||
|
|
||||||
|
|||||||
@ -21,6 +21,12 @@ public readonly record struct DataSourceLocalFile : IInternalDataSource
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public string Name { get; init; } = string.Empty;
|
public string Name { get; init; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The description of the data source. What kind of data does it contain?
|
||||||
|
/// What is the data source used for?
|
||||||
|
/// </summary>
|
||||||
|
public string Description { get; init; } = string.Empty;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public DataSourceType Type { get; init; } = DataSourceType.NONE;
|
public DataSourceType Type { get; init; } = DataSourceType.NONE;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user