metadata

package
v0.32.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package metadata implements a declarative per-step model router.

The plugin subscribes high-priority on before:llm.request and rewrites LLMRequest.Model based on rules that match against the request's Metadata (e.g. _source, task_kind, iteration) and Tags (e.g. tenant, project, source_plugin). It is the 80% case for per-step routing — fast, predictable, no extra LLM call. The classifier router (idea 09 part 2) handles the long tail where rules can't tell whether a step needs the strong model.

Rule ordering matters: the first matching rule wins. The terminal `default` rule is matched last and applies when nothing else does.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() engine.Plugin

New creates a new metadata router instance.

Types

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

Plugin implements the metadata-driven router. It is stateless across requests — every routing decision is a pure function of the rule set and the inbound request's Metadata + Tags.

func (*Plugin) Capabilities

func (p *Plugin) Capabilities() []engine.Capability

func (*Plugin) ConfigSchema

func (p *Plugin) ConfigSchema() []byte

ConfigSchema implements engine.ConfigSchemaProvider.

func (*Plugin) Dependencies

func (p *Plugin) Dependencies() []string

func (*Plugin) Emissions

func (p *Plugin) Emissions() []string

func (*Plugin) ID

func (p *Plugin) ID() string

func (*Plugin) Init

func (p *Plugin) Init(ctx engine.PluginContext) error

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) Ready

func (p *Plugin) Ready() error

func (*Plugin) Requires

func (p *Plugin) Requires() []engine.Requirement

func (*Plugin) Shutdown

func (p *Plugin) Shutdown(_ context.Context) error

func (*Plugin) Subscriptions

func (p *Plugin) Subscriptions() []engine.EventSubscription

func (*Plugin) Version

func (p *Plugin) Version() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL