history

package
v0.48.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package history provides the read-only `history` tool: the agent searches the original messages of its own session — including those already summarised by a compaction, cut by a fresh start or elided by a trim — reads one by ID and looks at its neighbours.

It reads; it never changes the model's context, the compaction or the session. What it returns is bounded so that a 50 MB transcript cannot be dumped into one tool result.

Index

Constants

View Source
const (
	MaxOutputBytes = 16 << 10
	MaxQueryBytes  = 1 << 10
)

Output and argument bounds.

Variables

This section is empty.

Functions

func NewTool

func NewTool(visit Visitor) core.Tool

NewTool builds the history tool over a session's transcript.

Types

type Visitor

type Visitor func(fn func(*core.AgentMessage)) error

Visitor calls fn with every message of the session transcript in chronological order (the current branch, markers included). fn must not retain the pointer.

Jump to

Keyboard shortcuts

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