setmodel

package
v0.3.51 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

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

New registers tool/set-model: let the agent switch this session's LLM model (tool name: set_model).

Best practices:

  • Writes the same session runtime.json model override as /model; the new model takes effect on the next turn.
  • Configure allowModels in production so the agent can only pick deployed models.
  • Subagent contexts are denied: children keep their own definition model.

Types

type Config

type Config struct {
	// AllowModels is the whitelist of model ids the agent may switch to.
	// Empty means no restriction.
	AllowModels []string `json:"allowModels,omitempty"`
}

Config configures tool/set-model.

type Deps

type Deps struct {
	SessionStore agentkit.SessionStore `json:"sessionStore"`
}

Deps holds injected capabilities for tool/set-model.

type Input

type Input struct {
	Model string `json:"model" jsonschema:"Model id to use for this session from now on; use reset to clear the session override"`
}

Input is the set_model tool call payload.

type Output

type Output struct {
	Model string `json:"model"`
	Reset bool   `json:"reset,omitempty"`
	Note  string `json:"note"`
}

Output is the set_model tool result.

Jump to

Keyboard shortcuts

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