Documentation
¶
Overview ¶
Package mockmodel provides a scriptable, in-process agentcore.Model that needs no API key and no network. It exists so the full chat path — a tool call over a real tool, the tool result folded into a final answer, and usage reported — is provable in tests and in MODEL_MODE=mock without a language-model provider.
The script (ported verbatim from the TypeScript service's mock model):
- If the latest user message mentions "diagnose" AND a tool whose name matches /pipeline_diagnose/i is available, emit a single tool call to it. The loop executes the tool (a real round-trip when composed against a live MCP server).
- On the follow-up step the prompt now carries the tool result, so the mock emits final text quoting the tool's findings.
- Otherwise it emits a short generic reply.
Every response reports fake-but-nonzero token usage (Usage).
PARITY CAVEAT: this is a canned script, not a language model. It proves plumbing and event shapes, not answer quality or real tool selection.
Index ¶
Constants ¶
const ModelID = "patch-mock-v0"
ModelID is the model identifier reported by the mock model and recorded on usage attribution.
Variables ¶
var Usage = agentcore.Usage{Input: 42, Output: 23}
Usage is the fake-but-nonzero token usage every mock response reports. It mirrors the TypeScript mock's MOCK_USAGE (42 input, 23 output, no cache).
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct{}
Model is a scriptable agentcore.Model. The zero value is ready to use; construct one with New.