Documentation
¶
Overview ¶
Package periodicprompts provides a Crush plugin for scheduled prompt execution. It allows users to configure cron-style schedules for prompts that are automatically sent to the LLM when periodic prompting is enabled.
Index ¶
Constants ¶
const ( // HookName is the name of this plugin. HookName = "periodic-prompts" // ToolName is the name of the toggle tool. ToolName = "periodic_prompts" // Description is shown to the LLM. Description = `` /* 617-byte string literal not displayed */ )
const (
// DialogID is the identifier for the periodic prompts dialog.
DialogID = "periodic-prompts-config"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Prompts is the list of scheduled prompts.
Prompts []PromptConfig `json:"prompts,omitempty"`
}
Config defines configuration options for this plugin. Users configure this in crush.json under options.plugins.periodic-prompts
type Dialog ¶
type Dialog struct {
// contains filtered or unexported fields
}
Dialog implements a dialog for configuring periodic prompts.
func (*Dialog) Update ¶
func (d *Dialog) Update(event plugin.DialogEvent) (done bool, action plugin.PluginAction, err error)
type Hook ¶
type Hook struct {
// contains filtered or unexported fields
}
Hook implements the periodic prompts hook.
func (*Hook) GetPrompts ¶
func (h *Hook) GetPrompts() []PromptConfig
GetPrompts returns the configured prompts.
func (*Hook) SetEnabled ¶
SetEnabled enables or disables periodic prompting.
type PromptConfig ¶
type PromptConfig struct {
// File is the path to the prompt file (supports ~ expansion).
File string `json:"file"`
// Schedule is a crontab-style schedule (e.g., "*/30 * * * *").
Schedule string `json:"schedule"`
// Name is an optional friendly name for the prompt.
Name string `json:"name,omitempty"`
}
PromptConfig defines a single scheduled prompt.
type Tool ¶
type Tool struct {
// contains filtered or unexported fields
}
Tool implements the periodic_prompts tool for enabling/disabling via chat.
type ToolParams ¶
type ToolParams struct {
// Action is the operation to perform: "status", "enable", "disable", "list".
Action string `json:"action" jsonschema:"description=Action to perform: status, enable, disable, or list"`
}
ToolParams defines the parameters the LLM can pass to the toggle tool.