feat: add example prompt in CustomPersona help_text, remove broken code fallback
This commit is contained in:
+1
-1
@@ -108,7 +108,7 @@
|
|||||||
"key": "CustomPersona",
|
"key": "CustomPersona",
|
||||||
"display_name": "Custom Persona (overrides dropdown)",
|
"display_name": "Custom Persona (overrides dropdown)",
|
||||||
"type": "longtext",
|
"type": "longtext",
|
||||||
"help_text": "Type a custom persona here to override the dropdown. Leave empty to use the dropdown selection. E.g. \"a sarcastic AI that quotes Monty Python\".",
|
"help_text": "Type a custom persona here. Leave empty to use the dropdown selection.\n\nExample prompt (Matty, Support Agent):\na helpful technical support assistant who knows WordPress and Mattermost inside out. You've fixed more PHP white screens than you've had hot dinners and you can recite the Mattermost plugin API from memory. You explain complex issues simply, always include the exact command or config line, and never assume prior knowledge. You're patient, direct, and you don't flinch at legacy code.\n\nGive the diagnosis and fix plainly first. Then explain why it works so the user learns something. Keep responses under 5 sentences unless the user asks for details. Suggest the simplest fix first, then mention the deeper approach as a fallback. Never guess — if you're unsure, say so.",
|
||||||
"placeholder": "",
|
"placeholder": "",
|
||||||
"default": "a helpful technical support assistant who knows WordPress and Mattermost inside out. You've fixed more PHP white screens than you've had hot dinners and you can recite the Mattermost plugin API from memory. You explain complex issues simply, always include the exact command or config line, and never assume prior knowledge. You're patient, direct, and you don't flinch at legacy code.\n\nGive the diagnosis and fix plainly first. Then explain why it works so the user learns something. Keep responses under 5 sentences unless the user asks for details. Suggest the simplest fix first, then mention the deeper approach as a fallback. Never guess — if you're unsure, say so."
|
"default": "a helpful technical support assistant who knows WordPress and Mattermost inside out. You've fixed more PHP white screens than you've had hot dinners and you can recite the Mattermost plugin API from memory. You explain complex issues simply, always include the exact command or config line, and never assume prior knowledge. You're patient, direct, and you don't flinch at legacy code.\n\nGive the diagnosis and fix plainly first. Then explain why it works so the user learns something. Keep responses under 5 sentences unless the user asks for details. Suggest the simplest fix first, then mention the deeper approach as a fallback. Never guess — if you're unsure, say so."
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ const botUsername = "matty"
|
|||||||
const botDisplayName = "Matty AI"
|
const botDisplayName = "Matty AI"
|
||||||
const botDescription = "AI chat agent powered by Ollama."
|
const botDescription = "AI chat agent powered by Ollama."
|
||||||
|
|
||||||
// defaultCustomPersona is used when "Custom" is selected but the textarea is empty.
|
|
||||||
const defaultCustomPersona = "a helpful technical support assistant who knows WordPress and Mattermost inside out. You've fixed more PHP white screens than you've had hot dinners and you can recite the Mattermost plugin API from memory. You explain complex issues simply, always include the exact command or config line, and never assume prior knowledge. You're patient, direct, and you don't flinch at legacy code.\n\nGive the diagnosis and fix plainly first. Then explain why it works so the user learns something. Keep responses under 5 sentences unless the user asks for details. Suggest the simplest fix first, then mention the deeper approach as a fallback. Never guess — if you're unsure, say so."
|
|
||||||
|
|
||||||
// OnActivate is invoked when the plugin is activated.
|
// OnActivate is invoked when the plugin is activated.
|
||||||
func (p *Plugin) OnActivate() error {
|
func (p *Plugin) OnActivate() error {
|
||||||
// Register the /ai slash command.
|
// Register the /ai slash command.
|
||||||
@@ -206,9 +203,6 @@ func (p *Plugin) MessageHasBeenPosted(c *plugin.Context, post *model.Post) {
|
|||||||
var personaDesc string
|
var personaDesc string
|
||||||
if persona == "custom" {
|
if persona == "custom" {
|
||||||
personaDesc = cfg.CustomPersona
|
personaDesc = cfg.CustomPersona
|
||||||
if personaDesc == "" {
|
|
||||||
personaDesc = defaultCustomPersona
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
personaDesc = resolvePersona(persona)
|
personaDesc = resolvePersona(persona)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user