@@ -29,14 +29,14 @@ def __init__(
2929 model : Model ,
3030 env : Environment ,
3131 name : str ,
32- format_vars : dict ,
32+ template_vars : dict ,
3333 * ,
3434 config_class : Callable = AgentConfig ,
3535 ** kwargs ,
3636 ):
3737 super ().__init__ (model , env , config_class = config_class , ** kwargs )
3838 self .name = name
39- self .format_vars = format_vars
39+ self .template_vars = template_vars
4040 self .console = Console ()
4141
4242 def add_message (self , role : str , content : str , ** kwargs ):
@@ -52,7 +52,7 @@ def render_template(self, template: str, **kwargs) -> str:
5252 | asdict (self .env .config )
5353 | asdict (self .model .config )
5454 | platform .uname ()._asdict ()
55- | self .format_vars
55+ | self .template_vars
5656 )
5757 return Template (template ).render (** kwargs , ** cs , ** os .environ )
5858
@@ -65,16 +65,16 @@ def run(self) -> tuple[str, str]:
6565class MiniSWEAgent (Player ):
6666 """Player with agentic code editing capabilities"""
6767
68- def __init__ (self , config : dict , environment : Environment , format_vars : dict ):
69- super ().__init__ (config , environment = environment , format_vars = format_vars )
68+ def __init__ (self , config : dict , environment : Environment , template_vars : dict ):
69+ super ().__init__ (config , environment = environment , template_vars = template_vars )
7070 self .agent = ClashAgent (
7171 LitellmModel (
7272 model_name = config ["model" ],
7373 model_kwargs = {"api_key" : resolve_api_key (config ["model" ])},
7474 ),
7575 self .environment ,
7676 self .name ,
77- format_vars ,
77+ template_vars ,
7878 ** yaml .safe_load (Path (config ["config" ]).read_text ())["agent" ],
7979 )
8080
@@ -93,7 +93,7 @@ def run(self):
9393 save_traj (
9494 self .agent , # type: ignore
9595 DIR_LOGS
96- / f"{ self .format_vars ['game_id' ]} /{ player_id } _r{ self .format_vars ['round' ]} .traj.json" ,
96+ / f"{ self .template_vars ['game_id' ]} /{ player_id } _r{ self .template_vars ['round' ]} .traj.json" ,
9797 exit_status = exit_status ,
9898 result = result ,
9999 )
0 commit comments