mockmodel

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

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):

  1. 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).
  2. On the follow-up step the prompt now carries the tool result, so the mock emits final text quoting the tool's findings.
  3. 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

View Source
const ModelID = "patch-mock-v0"

ModelID is the model identifier reported by the mock model and recorded on usage attribution.

Variables

View Source
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.

func New

func New() *Model

New returns a mock model.

func (*Model) ModelID

func (m *Model) ModelID() string

ModelID implements agentcore.Model.

func (*Model) Stream

Stream implements agentcore.Model by running the canned script over the request and returning the resulting parts.

Jump to

Keyboard shortcuts

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