Documentation
¶
Index ¶
- func New() engine.Plugin
- type Plugin
- func (p *Plugin) Capabilities() []engine.Capability
- func (p *Plugin) ConfigSchema() []byte
- func (p *Plugin) Dependencies() []string
- func (p *Plugin) Emissions() []string
- func (p *Plugin) ID() string
- func (p *Plugin) Init(ctx engine.PluginContext) error
- func (p *Plugin) Name() string
- func (p *Plugin) Ready() error
- func (p *Plugin) Requires() []engine.Requirement
- func (p *Plugin) Shutdown(_ context.Context) error
- func (p *Plugin) Subscriptions() []engine.EventSubscription
- func (p *Plugin) Version() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin injects dynamic runtime variables into the turn's own user message, as an XML block prepended to it on the way to the provider.
Why the user message and not the system prompt ¶
These variables CHANGE EVERY TURN — the clock most obviously. A system prompt is the most cache-stable region of a request and sits at the very front of it, so putting a per-turn value there invalidates the prompt cache at position zero and re-bills the entire conversation on every turn. Moving them to the live user message puts the only volatile bytes at the END of the prompt, which is exactly where a cache wants its variance.
Why it never reaches stored history ¶
The block is applied to the OUTBOUND llm.request, not to the message the memory plugin persisted. That is what stops the obvious failure of per-turn injection: ten turns in, a history carrying ten increasingly stale copies of "Current time", contradicting each other. Nothing has to detect or strip an old block, because no old block is ever written — see decorate.
func (*Plugin) Capabilities ¶
func (p *Plugin) Capabilities() []engine.Capability
func (*Plugin) ConfigSchema ¶
ConfigSchema implements engine.ConfigSchemaProvider.
func (*Plugin) Dependencies ¶
func (*Plugin) Requires ¶
func (p *Plugin) Requires() []engine.Requirement
func (*Plugin) Subscriptions ¶
func (p *Plugin) Subscriptions() []engine.EventSubscription
Subscriptions declares the one hook this plugin needs: the outbound request, where the block is applied.
Priority 20 puts it after the handlers that rewrite a request's shape — fanout (2), fallback (3), the schema registry (5), progressive discovery (8) and skills (15) — so none of them sees a message this plugin has already decorated, and a veto from any of them costs nothing to undo.