toolsim

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package toolsim provides simulated implementations of the agent's tool client interfaces. When the agent (its sub-agents) calls a simulated tool, a ToolSimulator LLM produces a realistic response from the scenario's background description for that tool, and the call is recorded for verification and diagnosis.

Coverage in v1: slack_search (SearchService) and notion_search (notiontool Client). The slack MessageRetriever is stubbed to return nothing (recorded). github_search is concrete (*githubtool.Client) and is therefore live-only in v1 — simulating it would require extracting an interface in production code, which is deferred (see the spec limitations). jira_search is likewise live-only: it wraps the external gollem-dev/tools/jira ToolSet, which has no simulatable interface seam either.

Index

Constants

View Source
const (
	ToolSlackSearch  = "slack_search"
	ToolNotionSearch = "notion_search"
	ToolGitHubSearch = "github_search"
	ToolJiraSearch   = "jira_search"
	ToolWebFetch     = "webfetch"

	// Knowledge tag management tools (in-process, simulatable).
	ToolKnowledgeCreateTag = "knowledge__create_tag"
	ToolKnowledgeUpdateTag = "knowledge__update_tag"
	ToolKnowledgeDeleteTag = "knowledge__delete_tag"
)

Tool names usable in a scenario [tools.*] table that map to simulated clients.

Variables

This section is empty.

Functions

func NotionSearch

func NotionSearch(completer evaltype.Completer, background string, rec *Recorder) notiontool.Client

NotionSearch returns a simulated notiontool.Client backed by background.

func RecordingNotion

func RecordingNotion(delegate notiontool.Client, rec *Recorder) notiontool.Client

RecordingNotion wraps a real notiontool.Client so live calls are captured.

func RecordingSlackSearch

func RecordingSlackSearch(delegate slacktool.SearchService, rec *Recorder) slacktool.SearchService

RecordingSlackSearch wraps a real SearchService so live calls are also captured in the trajectory (FR-12).

func SimulatableTools

func SimulatableTools() []string

SimulatableTools is the catalog of tool names the harness can simulate. github_search and jira_search are intentionally absent: both are live-only in v1.

func SlackRetriever

func SlackRetriever(rec *Recorder) slacktool.MessageRetriever

SlackRetriever returns a simulated MessageRetriever that surfaces no extra thread messages (the eval thread is synthetic). Calls are recorded.

func SlackSearch

func SlackSearch(completer evaltype.Completer, background string, rec *Recorder) slacktool.SearchService

SlackSearch returns a simulated slacktool.SearchService backed by background.

Types

type Recorder

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

Recorder collects tool-call records across the (parallel) sub-agent calls of one run. It is safe for concurrent use.

func NewRecorder

func NewRecorder() *Recorder

NewRecorder builds an empty Recorder.

func (*Recorder) Record

func (r *Recorder) Record(tool, mode string, args, result any) int

Record appends one tool call and returns its 1-based sequence number.

func (*Recorder) Records

func (r *Recorder) Records() []evaltype.ToolCallRecord

Records returns a copy of the collected records in call order.

Jump to

Keyboard shortcuts

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