Tool bundle configuration
Tool bundle configuration
This is the page for configuring a tool bundle, not for setting up the tools that are being used for the agent. For the latter, see tools configuration.
            sweagent.tools.bundle.BundleConfig
  
      pydantic-model
  
    
              Bases: BaseModel
Fields:
- 
              
tools(dict[str, dict]) - 
              
state_command(str | None) 
            tools
  
      pydantic-field
  
tools: dict[str, dict]
            state_command
  
      pydantic-field
  
state_command: str | None = None
            sweagent.tools.commands.Command
  
      pydantic-model
  
    
              Bases: BaseModel
Represents an executable command with arguments and documentation.
A command can be either a simple bash command or a multi-line command terminated by an end marker.
Attributes:
| Name | Type | Description | 
|---|---|---|
name | 
            
                  str
             | 
            
               The command name  | 
          
docstring | 
            
                  str | None
             | 
            
               Human readable description of what the command does  | 
          
signature | 
            
                  str | None
             | 
            
               Optional custom signature override  | 
          
end_name | 
            
                  str | None
             | 
            
               For multi-line commands, the terminating marker  | 
          
arguments | 
            
                  list[Argument]
             | 
            
               List of arguments accepted by the command  | 
          
Properties
invoke_format: Format string for constructing the full command invocation
Fields:
- 
              
name(str) - 
              
docstring(str | None) - 
              
signature(str | None) - 
              
end_name(str | None) - 
              
arguments(list[Argument]) 
Validators:
            name
  
      pydantic-field
  
name: str
            docstring
  
      pydantic-field
  
docstring: str | None
            signature
  
      pydantic-field
  
signature: str | None = None
            end_name
  
      pydantic-field
  
end_name: str | None = None
            invoke_format
  
      cached
      property
  
invoke_format: str
Gets the format string for invoking this command with arguments.
Returns either the custom signature with argument placeholders replaced, or a default format of "command arg1 arg2 ...".
            get_function_calling_tool
get_function_calling_tool() -> dict
Converts this command into an OpenAI function calling tool definition.
Returns:
| Type | Description | 
|---|---|
                  dict
             | 
            
               Dict containing the OpenAI function schema for this command  | 
          
Source code in sweagent/tools/commands.py
              133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162  |  | 
            validate_arguments
  
      pydantic-validator
  
validate_arguments() -> Command
Validates command argument configuration.
Checks: - Required arguments come before optional ones - Argument names are unique - Argument names match the pattern - Arguments match the signature
Returns:
| Type | Description | 
|---|---|
                  Command
             | 
            
               The validated Command instance  | 
          
Raises:
| Type | Description | 
|---|---|
                  ValueError
             | 
            
               If validation fails  | 
          
Source code in sweagent/tools/commands.py
              164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202  |  | 
            sweagent.tools.commands.Argument
  
      pydantic-model
  
    
              Bases: BaseModel
Fields:
- 
              
name(str) - 
              
type(str) - 
              
items(dict[str, str] | None) - 
              
description(str) - 
              
required(bool) - 
              
enum(list[str] | None) - 
              
argument_format(str) 
Validators:
            name
  
      pydantic-field
  
name: str
            type
  
      pydantic-field
  
type: str
            items
  
      pydantic-field
  
items: dict[str, str] | None = None
            description
  
      pydantic-field
  
description: str
            required
  
      pydantic-field
  
required: bool
            enum
  
      pydantic-field
  
enum: list[str] | None = None
            argument_format
  
      pydantic-field
  
argument_format: str = '{{value}}'
How to invoke the argument in the command. Make sure to use jinja syntax ({{value}}) instead of {value}).
            validate_argument_format
  
      pydantic-validator
  
validate_argument_format(value: str) -> str
Source code in sweagent/tools/commands.py
              73 74 75 76  |  |