Documentation
¶
Overview ¶
Package citations parses and structures source attributions in LLM responses that follow a retrieval pass. Two paths:
"tag" (default): the system prompt instructs the model to wrap cited spans with `<cite source="..." chunk="N"/>` markers. The plugin parses the tags, validates each against the current turn's retrieval context, strips tags from user-visible text, and emits a structured CitedResponse on `llm.response.cited`.
"anthropic_native": when the LLM provider already populates LLMResponse.Citations[], reuse those structured spans instead of parsing tags.
Either way the user-visible Text on the emitted CitedResponse is free of any in-band citation markup so IO renderers can footnote without post-processing.
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 parses citation tags out of LLM responses and emits the structured counterpart event.
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