mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-17 23:18:00 +00:00
Defined data structures for configuring the initial dats sources
This commit is contained in:
4 files changed
+118
No files matched your search
@@ -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;
|
||||||
|
}
|
||||||
@@ -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; }
|
||||||
|
}
|
||||||
Reference in new issue
Block a user