Template configuration
sweagent.agent.agents.TemplateConfig
pydantic-model
Bases: BaseModel
This configuration is used to define almost all message templates that are formatted by the agent and sent to the LM.
Fields:
-
system_template
(str
) -
instance_template
(str
) -
next_step_template
(str
) -
next_step_no_output_template
(str
) -
strategy_template
(str | None
) -
demonstration_template
(str | None
) -
demonstrations
(list[Path]
) -
put_demos_in_history
(bool
) -
shell_check_error_template
(str
) -
command_cancelled_timeout_template
(str
)
Validators:
command_cancelled_timeout_template
pydantic-field
command_cancelled_timeout_template: str = "The command '{{command}}' was cancelled because it took more than {{timeout}} seconds. Please try a different command that completes more quickly."
Message template for when the agent's command was cancelled because it took too long.
Available variables: timeout
, command
demonstration_template
pydantic-field
demonstration_template: str | None = None
demonstrations
pydantic-field
demonstrations: list[Path]
Paths to demonstrations. If path is not absolute, it is assumed to be relative to the SWE_AGENT_CONFIG_ROOT (if set) or the SWE-agent repository root
instance_template
pydantic-field
instance_template: str = ''
next_step_no_output_template
pydantic-field
next_step_no_output_template: str = None
Template for the next step when the last output was empty. Defaults to next_step_template.
next_step_template
pydantic-field
next_step_template: str = 'Observation: {{observation}}'
put_demos_in_history
pydantic-field
put_demos_in_history: bool = False
If True, add demonstration to history instead of as a single message
shell_check_error_template
pydantic-field
shell_check_error_template: str = 'Your bash command contained syntax errors and was NOT executed. Please fix the syntax errors and try again. This can be the result of not adhering to the syntax for multi-line commands. Here is the output of `bash -n`:\n{{bash_stdout}}\n{{bash_stderr}}'
Message template for when the agent's bash command contains syntax errors.
Available variables: bash_stdout
, bash_stderr
strategy_template
pydantic-field
strategy_template: str | None = None
system_template
pydantic-field
system_template: str = ''
validate_template_jinja_syntax
pydantic-validator
validate_template_jinja_syntax() -> Self
Source code in sweagent/agent/agents.py
89 90 91 92 93 94 95 |
|
warn_models_in_history
pydantic-validator
warn_models_in_history() -> Self
Source code in sweagent/agent/agents.py
97 98 99 100 101 102 |
|