mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-12 09:21:36 +00:00
included allowProfiles and system prompt properties to the lua parser
This commit is contained in:
parent
09b187d3f7
commit
488747b762
@ -5356,12 +5356,18 @@ UI_TEXT_CONTENT["AISTUDIO::TOOLS::PANDOC::T726914939"] = "The latest Pandoc vers
|
||||
-- The ASSISTANT table does not contain a valid description.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::PLUGINSYSTEM::ASSISTANTS::PLUGINASSISTANTS::T2080819991"] = "The ASSISTANT table does not contain a valid description."
|
||||
|
||||
-- The ASSISTANT table does not contain a the boolean flag to control the allowance of profiles.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::PLUGINSYSTEM::ASSISTANTS::PLUGINASSISTANTS::T221472268"] = "The ASSISTANT table does not contain a the boolean flag to control the allowance of profiles."
|
||||
|
||||
-- Failed to parse the UI render tree.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::PLUGINSYSTEM::ASSISTANTS::PLUGINASSISTANTS::T2583341941"] = "Failed to parse the UI render tree."
|
||||
|
||||
-- The ASSISTANT table does not contain a valid UI section.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::PLUGINSYSTEM::ASSISTANTS::PLUGINASSISTANTS::T3126717084"] = "The ASSISTANT table does not contain a valid UI section."
|
||||
|
||||
-- The ASSISTANT table does not contain a valid system prompt.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::PLUGINSYSTEM::ASSISTANTS::PLUGINASSISTANTS::T3723171842"] = "The ASSISTANT table does not contain a valid system prompt."
|
||||
|
||||
-- The ASSISTANT table does not exist or is not a valid table.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::PLUGINSYSTEM::ASSISTANTS::PLUGINASSISTANTS::T6004146"] = "The ASSISTANT table does not exist or is not a valid table."
|
||||
|
||||
|
||||
@ -12,7 +12,9 @@ public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType
|
||||
|
||||
public AssistantForm? RootComponent { get; set; }
|
||||
public string AssistantTitle { get; set; } = string.Empty;
|
||||
private string AssistantDescription { get; set; } = string.Empty;
|
||||
public string AssistantDescription { get; set; } = string.Empty;
|
||||
public string SystemPrompt { get; set; } = string.Empty;
|
||||
public bool AllowProfiles { get; set; } = true;
|
||||
|
||||
public void TryLoad()
|
||||
{
|
||||
@ -54,9 +56,25 @@ public sealed class PluginAssistants(bool isInternal, LuaState state, PluginType
|
||||
message = TB("The ASSISTANT table does not contain a valid description.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!assistantTable.TryGetValue("SystemPrompt", out var assistantSystemPromptValue) ||
|
||||
!assistantSystemPromptValue.TryRead<string>(out var assistantSystemPrompt))
|
||||
{
|
||||
message = TB("The ASSISTANT table does not contain a valid system prompt.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!assistantTable.TryGetValue("AllowProfiles", out var assistantAllowProfilesValue) ||
|
||||
!assistantAllowProfilesValue.TryRead<bool>(out var assistantAllowProfiles))
|
||||
{
|
||||
message = TB("The ASSISTANT table does not contain a the boolean flag to control the allowance of profiles.");
|
||||
return false;
|
||||
}
|
||||
|
||||
this.AssistantTitle = assistantTitle;
|
||||
this.AssistantDescription = assistantDescription;
|
||||
this.SystemPrompt = assistantSystemPrompt;
|
||||
this.AllowProfiles = assistantAllowProfiles;
|
||||
|
||||
// Ensure that the UI table exists nested in the ASSISTANT table and is a valid Lua table:
|
||||
if (!assistantTable.TryGetValue("UI", out var uiVal) || !uiVal.TryRead<LuaTable>(out var uiTable))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user