deferred

package
v0.3.27 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ToolSearch   = "tool_search"
	ToolDescribe = "tool_describe"
	ToolCall     = "tool_call"
)

Variables

This section is empty.

Functions

func IsBridge

func IsBridge(name string) bool

func New

func New(cfg Config, deps Deps) (agentkit.ToolRuntime, error)

New registers tools/deferred: same config/deps shape as tools/runtime; builds runtime internally.

Set config.enabled true to replace dynamic tool schemas with tool_search / tool_describe / tool_call.

Types

type Config

type Config struct {
	tools.RuntimeConfig
	DisclosureConfig
}

Config matches tools/runtime config at the top level, plus disclosure fields. Swap use: tools/runtime → tools/deferred without changing deps or timeout/allowTools keys.

func (Config) Normalize

func (c Config) Normalize() Config

type Deps

type Deps = tools.RuntimeDeps

Deps are the same slots as tools/runtime (hooks, tools, toolPacks, dynamicTools, policies, approval).

type DisclosureConfig

type DisclosureConfig struct {
	Enabled            EnabledSetting `json:"enabled"`
	ThresholdPct       float64        `json:"thresholdPct"`
	ListingMaxTokens   int            `json:"listingMaxTokens"`
	SearchDefaultLimit int            `json:"searchDefaultLimit"`
	MaxSearchLimit     int            `json:"maxSearchLimit"`
	Listing            string         `json:"listing"` // auto | on | off
	EagerTools         []string       `json:"eagerTools,omitempty"`
	DeferTools         []string       `json:"deferTools,omitempty"`
}

DisclosureConfig controls progressive tool disclosure only.

func (DisclosureConfig) Normalize

func (c DisclosureConfig) Normalize() DisclosureConfig

type EnabledSetting

type EnabledSetting string

EnabledSetting controls when deferred bridges replace deferrable tools.

const (
	EnabledOff  EnabledSetting = "off"
	EnabledOn   EnabledSetting = "on"
	EnabledAuto EnabledSetting = "auto"
)

func (*EnabledSetting) UnmarshalJSON

func (e *EnabledSetting) UnmarshalJSON(data []byte) error

type Runtime

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

Runtime wraps tools/runtime with progressive disclosure for dynamic tools.

func (*Runtime) Execute

func (d *Runtime) Execute(ctx context.Context, call agentkit.ToolCall) (agentkit.ToolResult, error)

func (*Runtime) Visible

func (d *Runtime) Visible(ctx context.Context) ([]agentkit.ToolSpec, error)

Jump to

Keyboard shortcuts

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