Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionTool ¶ added in v1.15.0
ActionTool bundles a definition, executor, and display config for the generic action model.
func NewActionTool ¶ added in v1.15.0
func NewActionTool( def chat.Tool, executor func(input json.RawMessage) (domaintools.Result, error), config action.Config, ) ActionTool
NewActionTool is a helper to build an ActionTool from parts.
func NewSetServiceEnabledAction ¶ added in v1.15.0
func NewSetServiceEnabledAction(db sqlite.DB) ActionTool
NewSetServiceEnabledAction creates an ActionTool for set_service_enabled.
func UnknownTool ¶ added in v1.15.0
func UnknownTool(name string) ActionTool
UnknownTool returns an ActionTool for tools not in the registry. It shows the tool name and completes with an error so the result is reported back to the model.
type QueryTool ¶
type QueryTool struct {
// contains filtered or unexported fields
}
QueryTool executes read-only SQL queries against the local catalog.
func NewQueryTool ¶
NewQueryTool creates a new query tool.
func (*QueryTool) Definition ¶
Definition returns the tool definition for the chat API.
func (*QueryTool) Execute ¶
func (t *QueryTool) Execute(input json.RawMessage) (tools.QueryResult, error)
Execute runs the query and returns a typed result.
type Registry ¶
type Registry struct {
Query *QueryTool // kept for direct access from query UI model
// contains filtered or unexported fields
}
Registry holds tool instances and provides definitions.
func NewRegistry ¶ added in v1.15.0
func NewRegistry(query *QueryTool, actions map[string]ActionTool) *Registry
NewRegistry creates a registry with the query tool and a map of action tools.
func (*Registry) Definitions ¶
Definitions returns tool definitions for the chat API.