mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-03-29 21:31:39 +00:00
minor improvements (removed unused using directives; make private setters)
This commit is contained in:
parent
4c92fe8d2c
commit
379940caf8
@ -1,5 +1,3 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
||||||
|
|
||||||
internal static class AssistantComponentPropHelper
|
internal static class AssistantComponentPropHelper
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
||||||
|
|
||||||
internal sealed class AssistantDropdown : AssistantComponentBase
|
internal sealed class AssistantDropdown : AssistantComponentBase
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
||||||
|
|
||||||
internal sealed class AssistantHeading : AssistantComponentBase
|
internal sealed class AssistantHeading : AssistantComponentBase
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
||||||
|
|
||||||
internal sealed class AssistantImage : AssistantComponentBase
|
internal sealed class AssistantImage : AssistantComponentBase
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
||||||
|
|
||||||
internal sealed class AssistantList : AssistantComponentBase
|
internal sealed class AssistantList : AssistantComponentBase
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
||||||
|
|
||||||
internal sealed class AssistantProfileSelection : AssistantComponentBase
|
internal sealed class AssistantProfileSelection : AssistantComponentBase
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
||||||
|
|
||||||
internal sealed class AssistantProviderSelection : AssistantComponentBase
|
internal sealed class AssistantProviderSelection : AssistantComponentBase
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
||||||
|
|
||||||
internal sealed class AssistantSwitch : AssistantComponentBase
|
internal sealed class AssistantSwitch : AssistantComponentBase
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
||||||
|
|
||||||
internal sealed class AssistantText : AssistantComponentBase
|
internal sealed class AssistantText : AssistantComponentBase
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
||||||
|
|
||||||
internal sealed class AssistantTextArea : AssistantComponentBase
|
internal sealed class AssistantTextArea : AssistantComponentBase
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
||||||
|
|
||||||
internal sealed class AssistantWebContentReader : AssistantComponentBase
|
internal sealed class AssistantWebContentReader : AssistantComponentBase
|
||||||
|
|||||||
@ -1,22 +1,20 @@
|
|||||||
using System.Xml.XPath;
|
|
||||||
using AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
using AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
||||||
using Lua;
|
using Lua;
|
||||||
using System.Globalization;
|
|
||||||
|
|
||||||
namespace AIStudio.Tools.PluginSystem.Assistants;
|
namespace AIStudio.Tools.PluginSystem.Assistants;
|
||||||
|
|
||||||
public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType type) : PluginBase(isInternal, state, type)
|
public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType type) : PluginBase(isInternal, state, type)
|
||||||
{
|
{
|
||||||
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(PluginAssistants).Namespace, nameof(PluginAssistants));
|
private static string TB(string fallbackEn) => I18N.I.T(fallbackEn, typeof(PluginAssistants).Namespace, nameof(PluginAssistants));
|
||||||
|
|
||||||
private static readonly ILogger<PluginAssistants> LOGGER = Program.LOGGER_FACTORY.CreateLogger<PluginAssistants>();
|
private static readonly ILogger<PluginAssistants> LOGGER = Program.LOGGER_FACTORY.CreateLogger<PluginAssistants>();
|
||||||
|
|
||||||
public AssistantForm? RootComponent { get; set; }
|
public AssistantForm? RootComponent { get; private set; }
|
||||||
public string AssistantTitle { get; set; } = string.Empty;
|
public string AssistantTitle { get; private set; } = string.Empty;
|
||||||
public string AssistantDescription { get; set; } = string.Empty;
|
public string AssistantDescription { get; private set; } = string.Empty;
|
||||||
public string SystemPrompt { get; set; } = string.Empty;
|
public string SystemPrompt { get; private set; } = string.Empty;
|
||||||
public string SubmitText { get; set; } = string.Empty;
|
public string SubmitText { get; private set; } = string.Empty;
|
||||||
public bool AllowProfiles { get; set; } = true;
|
public bool AllowProfiles { get; private set; } = true;
|
||||||
public bool HasEmbeddedProfileSelection { get; private set; }
|
public bool HasEmbeddedProfileSelection { get; private set; }
|
||||||
public bool HasCustomPromptBuilder => this.buildPromptFunction is not null;
|
public bool HasCustomPromptBuilder => this.buildPromptFunction is not null;
|
||||||
|
|
||||||
@ -414,7 +412,7 @@ public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType
|
|||||||
private void RegisterLuaHelpers()
|
private void RegisterLuaHelpers()
|
||||||
{
|
{
|
||||||
|
|
||||||
this.state.Environment["LogInfo"] = new LuaFunction((context, buffer, ct) =>
|
this.state.Environment["LogInfo"] = new LuaFunction((context, _, _) =>
|
||||||
{
|
{
|
||||||
if (context.ArgumentCount == 0) return new(0);
|
if (context.ArgumentCount == 0) return new(0);
|
||||||
|
|
||||||
@ -423,7 +421,7 @@ public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType
|
|||||||
return new (1);
|
return new (1);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.state.Environment["LogDebug"] = new LuaFunction((context, buffer, ct) =>
|
this.state.Environment["LogDebug"] = new LuaFunction((context, _, _) =>
|
||||||
{
|
{
|
||||||
if (context.ArgumentCount == 0) return new(0);
|
if (context.ArgumentCount == 0) return new(0);
|
||||||
|
|
||||||
@ -432,7 +430,7 @@ public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType
|
|||||||
return new (1);
|
return new (1);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.state.Environment["LogWarning"] = new LuaFunction((context, buffer, ct) =>
|
this.state.Environment["LogWarning"] = new LuaFunction((context, _, _) =>
|
||||||
{
|
{
|
||||||
if (context.ArgumentCount == 0) return new(0);
|
if (context.ArgumentCount == 0) return new(0);
|
||||||
|
|
||||||
@ -441,7 +439,7 @@ public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType
|
|||||||
return new (1);
|
return new (1);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.state.Environment["LogError"] = new LuaFunction((context, buffer, ct) =>
|
this.state.Environment["LogError"] = new LuaFunction((context, _, _) =>
|
||||||
{
|
{
|
||||||
if (context.ArgumentCount == 0) return new(0);
|
if (context.ArgumentCount == 0) return new(0);
|
||||||
|
|
||||||
@ -450,7 +448,7 @@ public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType
|
|||||||
return new (1);
|
return new (1);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.state.Environment["DateTime"] = new LuaFunction((context, buffer, ct) =>
|
this.state.Environment["DateTime"] = new LuaFunction((context, buffer, _) =>
|
||||||
{
|
{
|
||||||
var format = context.ArgumentCount > 0 ? context.GetArgument<string>(0) : "yyyy-MM-dd HH:mm:ss";
|
var format = context.ArgumentCount > 0 ? context.GetArgument<string>(0) : "yyyy-MM-dd HH:mm:ss";
|
||||||
var now = DateTime.Now;
|
var now = DateTime.Now;
|
||||||
@ -472,7 +470,7 @@ public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType
|
|||||||
return new(1);
|
return new(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.state.Environment["Timestamp"] = new LuaFunction((context, buffer, ct) =>
|
this.state.Environment["Timestamp"] = new LuaFunction((_, buffer, _) =>
|
||||||
{
|
{
|
||||||
var timestamp = DateTime.UtcNow.ToString("o");
|
var timestamp = DateTime.UtcNow.ToString("o");
|
||||||
buffer.Span[0] = timestamp;
|
buffer.Span[0] = timestamp;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user