mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-04 19:27:21 +00:00
Added importing of configurations exported from AI Studio (#1007)
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
1 parent
f8c0232cfd
commit
22065783c2
49 files changed
+3257
-263
No files matched your search
@@ -1,3 +1,5 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
using AIStudio.Settings.DataModel;
|
||||
|
||||
using Lua;
|
||||
@@ -22,6 +24,11 @@ public abstract class PluginConfigurationObjectDescriptor
|
||||
/// </summary>
|
||||
public abstract PluginConfigurationObjectType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The Lua table in which a configuration plugin defines these objects, e.g., LLM_PROVIDERS.
|
||||
/// </summary>
|
||||
public abstract string LuaTableName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Reads the configuration objects of this type which a configuration plugin defines, and stores
|
||||
/// them in the settings unless the plugin is only checked.
|
||||
@@ -34,6 +41,19 @@ public abstract class PluginConfigurationObjectDescriptor
|
||||
/// <returns>True when the plugin defines a table for this type.</returns>
|
||||
public abstract bool TryParse(LuaTable mainTable, Guid configPluginId, List<PluginConfigurationObject> configObjects, bool dryRun, string pluginPath);
|
||||
|
||||
/// <summary>
|
||||
/// Reads the configuration object of a configuration snippet, which belongs to no configuration
|
||||
/// plugin. It is read as a dry run, so neither the object nor its secret is stored.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Without the directory of a plugin, a path relative to it cannot be resolved, so the parsers
|
||||
/// leave out what such a path points to, e.g., a custom icon.
|
||||
/// </remarks>
|
||||
/// <param name="table">The table which the snippet assigns.</param>
|
||||
/// <param name="configObject">The configuration object read from the table.</param>
|
||||
/// <returns>True when the table defines a valid configuration object.</returns>
|
||||
public abstract bool TryParseSnippet(LuaTable table, [NotNullWhen(true)] out IConfigurationObject? configObject);
|
||||
|
||||
/// <summary>
|
||||
/// Removes the configuration objects of this type which belong to a configuration plugin that is
|
||||
/// gone or no longer defines them, along with their secrets and tokenizers.
|
||||
|
||||
Reference in new issue
Block a user