Documentation
¶
Overview ¶
Package optimizerdec provides a MultiSession decorator that replaces the full tool list with two optimizer tools: find_tool and call_tool.
Index ¶
Constants ¶
const ( // FindToolName is the tool name for semantic tool discovery. FindToolName = "find_tool" // CallToolName is the tool name for routing a call to any backend tool. CallToolName = "call_tool" // CallToolArgToolName is the JSON argument key for the backend tool name in a call_tool request. // It must match the json tag on optimizer.CallToolInput.ToolName. CallToolArgToolName = "tool_name" // CallToolArgParameters is the JSON argument key for the backend tool parameters in a call_tool request. // It must match the json tag on optimizer.CallToolInput.Parameters. CallToolArgParameters = "parameters" )
Variables ¶
This section is empty.
Functions ¶
func NewDecorator ¶
func NewDecorator(sess sessiontypes.MultiSession, opt optimizer.Optimizer) sessiontypes.MultiSession
NewDecorator wraps sess with optimizer mode. Only find_tool and call_tool are exposed via Tools(). find_tool calls opt.FindTool. call_tool calls opt.CallTool, which routes through the instrumented optimizer (telemetry, traces, metrics).
func OptimizerTools ¶ added in v0.30.1
OptimizerTools returns the find_tool and call_tool meta-tool definitions (name, description, input schema) that replace the full backend tool list in optimizer mode. The definitions are shared so that the legacy MultiSession decorator (this package) and the Serve-path optimizer wiring (pkg/vmcp/server) advertise an identical pair; each consumer wires its own handlers around these definitions. A fresh slice is returned on every call so callers cannot mutate shared state.
Types ¶
This section is empty.