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 NewApprovePolicyAction ¶ added in v1.21.0
func NewApprovePolicyAction(db sqlite.DB, userIDFunc func() string) ActionTool
NewApprovePolicyAction creates an ActionTool for approve_policy. userIDFunc is called at execution time to get the current user's ID.
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
Show *ShowTool // kept for direct access from show 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, show *ShowTool, actions map[string]ActionTool) *Registry
NewRegistry creates a registry with the query tool, show tool, and a map of action tools.
func (*Registry) Definitions ¶
Definitions returns tool definitions for the chat API.
type ShowTool ¶ added in v1.18.0
type ShowTool struct {
// contains filtered or unexported fields
}
ShowTool resolves entity IDs and fetches card data from the local catalog.
func NewShowTool ¶ added in v1.18.0
NewShowTool creates a new show tool.
func (*ShowTool) Definition ¶ added in v1.18.0
Definition returns the tool definition for the chat API.
func (*ShowTool) Execute ¶ added in v1.18.0
func (t *ShowTool) Execute(input json.RawMessage) (tools.ShowResult, error)
Execute resolves the entity ID and fetches card data.