Documentation
¶
Overview ¶
Package localstub implements a deterministic no-network backend for local dogfood and smoke tests. It is not a provider emulator and does not claim parity with any hosted API.
Index ¶
Constants ¶
const DefaultAssistantText = "[local-stub] deterministic assistant text"
DefaultAssistantText is used when text is empty or whitespace-only after normalization.
const DefaultToolArgs = "{}"
DefaultToolArgs is emitted when tool_name is set and tool_args is omitted/empty.
const ID = "local-stub"
ID is the registered backend factory kind for the standard distribution.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(cfg Config) execbackend.Backend
New returns an exec backend that emits a fixed canonical stream from cfg.
func NewFromYAML ¶
func NewFromYAML(n yaml.Node) (execbackend.Backend, error)
NewFromYAML builds a backend from opaque plugin YAML (composition root).
Types ¶
type Config ¶
type Config struct {
Text string `yaml:"text"`
InputTokens int `yaml:"input_tokens"`
OutputTokens int `yaml:"output_tokens"`
ToolName string `yaml:"tool_name"`
// ToolArgs is the raw tool-call arguments delta emitted when ToolName is set.
// Empty defaults to "{}". May be intentionally truncated/malformed JSON for
// dogfood of canonical tool-call repair (issue #152).
ToolArgs string `yaml:"tool_args"`
// StreamErrorAfterTextDelta, when true, yields the normal stream through the first assistant
// text delta then returns a non-recoverable error (dogfood invariant tests; not provider-like).
StreamErrorAfterTextDelta bool `yaml:"stream_error_after_text_delta"`
}
Config is YAML configuration for the local-stub backend (see stage-five design).
func NormalizeConfig ¶
NormalizeConfig applies defaults and validates counts and tool name.