Documentation
¶
Overview ¶
Package systemprompt is the built-in system_prompt plugin: it injects, overrides, or decorates the system message before the provider call.
Index ¶
- Constants
- func New() pluginapi.Plugin
- type Config
- type Mode
- type Plugin
- func (p *Plugin) Close(context.Context) error
- func (p *Plugin) Init(_ context.Context, raw json.RawMessage, _ pluginapi.Host) error
- func (p *Plugin) Manifest() pluginapi.Manifest
- func (p *Plugin) OnPrompt(_ context.Context, x *pluginapi.Exchange) (pluginapi.Decision, error)
- func (p *Plugin) Summarize(raw json.RawMessage) string
Constants ¶
View Source
const Name = "system_prompt"
Name is the plugin's manifest name.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
Config is the instance configuration.
func ParseConfig ¶
func ParseConfig(raw json.RawMessage) (Config, error)
ParseConfig decodes and validates a config: mode defaults to inject and content is required.
type Mode ¶
type Mode string
Mode selects how the configured content is applied.
const ( // ModeInject adds a system message only if none exists. ModeInject Mode = "inject" // ModeOverride replaces every system and developer message with one. ModeOverride Mode = "override" // ModeDecorator prepends the content to the first system message, or // injects one when there is none. ModeDecorator Mode = "decorator" )
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin implements the prompt hook.
Click to show internal directories.
Click to hide internal directories.