Documentation
¶
Index ¶
- Variables
- func GenerateCommandDocs(commands []Command, additionalDocs []string, ...) string
- func GuardMultilineInput(action string, getFirstMultilineCmd func(string) *regexp.Regexp) string
- func RegisterSpecializedTools(registry *tools.Registry) error
- type Bundle
- type Command
- type Environment
- type ToolConfig
- type ToolFilterConfig
- type ToolHandler
- func (h *ToolHandler) CheckForSubmissionCmd(output string) bool
- func (h *ToolHandler) GetState(env Environment) (map[string]string, error)
- func (h *ToolHandler) GuardMultilineInput(action string) string
- func (h *ToolHandler) Install(env Environment) error
- func (h *ToolHandler) ParseActions(output map[string]interface{}) (string, string, error)
- func (h *ToolHandler) Reset(env Environment) error
- func (h *ToolHandler) ShouldBlockAction(action string) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var BashCommand = Command{ Name: "bash", Description: "Execute a bash command", Schema: map[string]interface{}{ "type": "object", "properties": map[string]interface{}{ "command": map[string]interface{}{ "type": "string", "description": "The bash command to execute", }, }, "required": []string{"command"}, }, }
Functions ¶
func GenerateCommandDocs ¶
func GuardMultilineInput ¶
Types ¶
type Command ¶
type Command struct {
Name string `json:"name"`
Description string `json:"description"`
EndName string `json:"end_name,omitempty"`
Schema map[string]interface{} `json:"schema,omitempty"`
}
func (Command) GetFunctionCallingTool ¶
type Environment ¶
type ToolConfig ¶
type ToolConfig struct {
Filter *ToolFilterConfig `json:"filter"`
Bundles []Bundle `json:"bundles"`
EnvVariables map[string]interface{} `json:"env_variables"`
RegistryVariables map[string]interface{} `json:"registry_variables"`
SubmitCommand string `json:"submit_command"`
EnableBashTool bool `json:"enable_bash_tool"`
FormatErrorTemplate string `json:"format_error_template"`
CommandDocs string `json:"command_docs"`
MultiLineCommandEndings map[string]string `json:"multi_line_command_endings"`
SubmitCommandEndName string `json:"submit_command_end_name"`
ResetCommands []interface{} `json:"reset_commands"`
ExecutionTimeout int `json:"execution_timeout"`
InstallTimeout int `json:"install_timeout"`
TotalExecutionTimeout int `json:"total_execution_timeout"`
MaxConsecutiveExecutionTimeouts int `json:"max_consecutive_execution_timeouts"`
// contains filtered or unexported fields
}
func NewToolConfig ¶
func NewToolConfig() *ToolConfig
func (*ToolConfig) Commands ¶
func (c *ToolConfig) Commands() []Command
func (*ToolConfig) Initialize ¶
func (c *ToolConfig) Initialize()
func (*ToolConfig) StateCommands ¶
func (c *ToolConfig) StateCommands() []string
func (*ToolConfig) Tools ¶
func (c *ToolConfig) Tools() []map[string]interface{}
func (*ToolConfig) UseFunctionCalling ¶
func (c *ToolConfig) UseFunctionCalling() bool
type ToolFilterConfig ¶
type ToolFilterConfig struct {
BlocklistErrorTemplate string `json:"blocklist_error_template"`
Blocklist []string `json:"blocklist"`
BlocklistStandalone []string `json:"blocklist_standalone"`
BlockUnlessRegex map[string]string `json:"block_unless_regex"`
}
func DefaultToolFilterConfig ¶
func DefaultToolFilterConfig() *ToolFilterConfig
type ToolHandler ¶
type ToolHandler struct {
Config *ToolConfig
ResetCommands []string
CommandPatterns map[string]*regexp.Regexp
Logger tools.Logger
MockState map[string]string
}
func NewToolHandler ¶
func NewToolHandler(config *ToolConfig, logger tools.Logger) *ToolHandler
func (*ToolHandler) CheckForSubmissionCmd ¶
func (h *ToolHandler) CheckForSubmissionCmd(output string) bool
func (*ToolHandler) GetState ¶
func (h *ToolHandler) GetState(env Environment) (map[string]string, error)
func (*ToolHandler) GuardMultilineInput ¶
func (h *ToolHandler) GuardMultilineInput(action string) string
func (*ToolHandler) Install ¶
func (h *ToolHandler) Install(env Environment) error
func (*ToolHandler) ParseActions ¶
func (h *ToolHandler) ParseActions(output map[string]interface{}) (string, string, error)
func (*ToolHandler) Reset ¶
func (h *ToolHandler) Reset(env Environment) error
func (*ToolHandler) ShouldBlockAction ¶
func (h *ToolHandler) ShouldBlockAction(action string) bool
Click to show internal directories.
Click to hide internal directories.