mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 21:39:46 +00:00
Defined data structures for configuring the initial dats sources
This commit is contained in:
parent
425c888fd1
commit
b5fbbfae51
33
app/MindWork AI Studio/Settings/DataModel/DataSourceERI.cs
Normal file
33
app/MindWork AI Studio/Settings/DataModel/DataSourceERI.cs
Normal file
@ -0,0 +1,33 @@
|
||||
namespace AIStudio.Settings.DataModel;
|
||||
|
||||
/// <summary>
|
||||
/// An external data source, accessed via an ERI server, cf. https://github.com/MindWorkAI/ERI.
|
||||
/// </summary>
|
||||
public readonly record struct DataSourceERI : IDataSource
|
||||
{
|
||||
public DataSourceERI()
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public uint Num { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Id { get; init; } = Guid.Empty.ToString();
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Name { get; init; } = string.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
public DataSourceType Type { get; init; } = DataSourceType.NONE;
|
||||
|
||||
/// <summary>
|
||||
/// The hostname of the ERI server.
|
||||
/// </summary>
|
||||
public string Hostname { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The port of the ERI server.
|
||||
/// </summary>
|
||||
public int Port { get; init; }
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
namespace AIStudio.Settings.DataModel;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a local directory as a data source.
|
||||
/// </summary>
|
||||
public readonly record struct DataSourceLocalDirectory : IDataSource
|
||||
{
|
||||
public DataSourceLocalDirectory()
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public uint Num { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Id { get; init; } = Guid.Empty.ToString();
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Name { get; init; } = string.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
public DataSourceType Type { get; init; } = DataSourceType.NONE;
|
||||
|
||||
/// <summary>
|
||||
/// The path to the directory.
|
||||
/// </summary>
|
||||
public string Path { get; init; } = string.Empty;
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
namespace AIStudio.Settings.DataModel;
|
||||
|
||||
/// <summary>
|
||||
/// Represents one local file as a data source.
|
||||
/// </summary>
|
||||
public readonly record struct DataSourceLocalFile : IDataSource
|
||||
{
|
||||
public DataSourceLocalFile()
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public uint Num { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Id { get; init; } = Guid.Empty.ToString();
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Name { get; init; } = string.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
public DataSourceType Type { get; init; } = DataSourceType.NONE;
|
||||
|
||||
/// <summary>
|
||||
/// The path to the file.
|
||||
/// </summary>
|
||||
public string FilePath { get; init; } = string.Empty;
|
||||
}
|
29
app/MindWork AI Studio/Settings/IDataSource.cs
Normal file
29
app/MindWork AI Studio/Settings/IDataSource.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using AIStudio.Settings.DataModel;
|
||||
|
||||
namespace AIStudio.Settings;
|
||||
|
||||
/// <summary>
|
||||
/// The common interface for all data sources.
|
||||
/// </summary>
|
||||
public interface IDataSource
|
||||
{
|
||||
/// <summary>
|
||||
/// The number of the data source.
|
||||
/// </summary>
|
||||
public uint Num { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// The unique identifier of the data source.
|
||||
/// </summary>
|
||||
public string Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// The name of the data source.
|
||||
/// </summary>
|
||||
public string Name { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Which type of data source is this?
|
||||
/// </summary>
|
||||
public DataSourceType Type { get; init; }
|
||||
}
|
Loading…
Reference in New Issue
Block a user