Documentation
¶
Overview ¶
Package assistant answers questions about the connected broker with Claude, using read-only broker queries as tools. It never changes broker state: changes are suggested as mqx commands for the user to run.
Index ¶
Constants ¶
const DefaultModel = "claude-opus-5-5"
DefaultModel is used when the config names none.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Input ¶
Input is a tool call's arguments.
type InputError ¶ added in v0.5.0
type InputError struct{ Label, Msg string }
InputError is a tool call the model got wrong: Label is the short form the TUI shows, Error the full text sent back to the model.
func (*InputError) Error ¶ added in v0.5.0
func (e *InputError) Error() string
type Options ¶
type Options struct {
// SendPayloads offers peek_messages, which sends message keys, headers
// and values to the API. Off unless the config enables it.
SendPayloads bool
}
Options decide which tools a session offers.
type Sender ¶
type Sender func(ctx context.Context, p anthropic.BetaMessageNewParams) (*anthropic.BetaMessage, error)
Sender sends one Messages API request. Client.Send is the real one; tests pass a fake.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is one conversation. It is not safe for concurrent use: the TUI runs one Step at a time.
func NewSession ¶
NewSession starts a conversation about ctx using tools.
type Settings ¶
type Settings struct {
Model string
Effort string // low, medium, high, xhigh or max; "" means medium
}
Settings are the request settings from the config.
type Tool ¶
type Tool struct {
Name string
Description string
// Params are the JSON Schema properties of the input; Required lists the
// mandatory ones.
Params map[string]any
Required []string
// Run executes the call; its result is sent to the model as JSON.
Run func(ctx context.Context, in Input) (any, error)
}
Tool is one read-only broker query the model may call.