updated example plugin.lua for dynamic assistants

This commit is contained in:
krut_ni 2025-11-11 20:01:22 +01:00
parent 0775b03529
commit 9374b56789

View File

@ -53,49 +53,59 @@ ASSISTANT = {
}, },
} }
-- An example of a assistant that resembles AI Studios translation assistant: -- usage example with the full feature set:
ASSISTANT = { ASSISTANT = {
["Title"] = "Grammatik- und Rechtschreibprüfung", ["Title"] = "<main title of assistant>", -- required
["Description"] = "Grammatik und Rechtschreibung eines Textes überprüfen.", ["Description"] = "<assitant description>", -- required
["SystemPrompt"] = "<prompt that fudamentally changes behaviour, personality and task focus of your assistant. Invisible to the user>", -- required
["SubmitText"] = "<label for submit button>", -- required
["AllowProfiles"] = true, -- if true, allows AiStudios profiles; required
["UI"] = { ["UI"] = {
["Type"] = "FORM", ["Type"] = "FORM",
["Children"] = { ["Children"] = {
{ {
["Type"] = "TEXT_AREA", ["Type"] = "TEXT_AREA", -- required
["Props"] = { ["Props"] = {
["Name"] = "input", ["Name"] = "<unique identifier of this component>", -- required
["Label"] = "Ihre Eingabe zur Überprüfung" ["Label"] = "<heading of your component>", -- required
["UserPrompt"] = "<direct input of instructions, questions, or tasks by a user>",
["PrefillText"] = "<text to show in the field initially>",
["IsSingleLine"] = false, -- if true, shows a text field instead of an area
["ReadOnly"] = false -- if true, deactivates user input (make sure to provide a PrefillText)
} }
}, },
{ {
["Type"] = "DROPDOWN", ["Type"] = "DROPDOWN", -- required
["ValueType"] = "string", ["Props"] = {
["Default"] = { ["Value"] = "", ["Display"] = "Sprache nicht angeben." }, ["Name"] = "<unique identifier of this component>", -- required
["Label"] = "<heading of your component>", -- required
["UserPrompt"] = "<direct input of instructions, questions, or tasks by a user>",
["ValueType"] = "<data type of item values>", -- required
["Default"] = { ["Value"] = "<internal data>", ["Display"] = "<user readable representation>" }, -- required
["Items"] = { ["Items"] = {
{ ["Value"] = "de-DE", ["Display"] = "Deutsch" }, { ["Value"] = "<internal data>", ["Display"] = "<user readable representation>" },
{ ["Value"] = "en-UK", ["Display"] = "Englisch (UK)" }, { ["Value"] = "<internal data>", ["Display"] = "<user readable representation>" },
{ ["Value"] = "en-US", ["Display"] = "Englisch (US)" }, } -- required
},
["Props"] = {
["Name"] = "language",
["Label"] = "Sprache",
} }
}, },
{ {
["Type"] = "PROVIDER_SELECTION", ["Type"] = "SWITCH",
["Props"] = {
["Name"] = "<unique identifier of this component>", -- required
["Label"] = "<heading of your component>", -- required
["Value"] = true, -- intial switch state
["UserPrompt"] = "<direct input of instructions, questions, or tasks by a user>",
["LabelOn"] = "<text if state is true>", -- required
["LabelOff"] = "<text if state is false>" -- required
}
},
{
["Type"] = "PROVIDER_SELECTION", -- required
["Props"] = { ["Props"] = {
["Name"] = "Anbieter", ["Name"] = "Anbieter",
["Label"] = "LLM auswählen" ["Label"] = "LLM auswählen"
} }
}, },
{
["Type"] = "BUTTON",
["Props"] = {
["Name"] = "submit",
["Text"] = "Korrekturlesen",
["Action"] = "OnSubmit"
}
},
} }
}, },
} }