From af9385322bc5f2a61c8a4f5331239759cb6ce565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=AE=AE=E0=AE=A9=E0=AF=8B=E0=AE=9C=E0=AF=8D=E0=AE=95?= =?UTF-8?q?=E0=AF=81=E0=AE=AE=E0=AE=BE=E0=AE=B0=E0=AF=8D=20=E0=AE=AA?= =?UTF-8?q?=E0=AE=B4=E0=AE=A9=E0=AE=BF=E0=AE=9A=E0=AF=8D=E0=AE=9A=E0=AE=BE?= =?UTF-8?q?=E0=AE=AE=E0=AE=BF?= Date: Fri, 28 Jun 2024 11:04:26 +0530 Subject: [PATCH] Refactor: Simplify message formatting (#2670) Removed redundant `str()` conversion in f-string. --- evaluation/swe_bench/scripts/setup/process_output_json_file.py | 2 +- opendevin/controller/agent_controller.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/evaluation/swe_bench/scripts/setup/process_output_json_file.py b/evaluation/swe_bench/scripts/setup/process_output_json_file.py index 6f903e7f7e..133d573160 100644 --- a/evaluation/swe_bench/scripts/setup/process_output_json_file.py +++ b/evaluation/swe_bench/scripts/setup/process_output_json_file.py @@ -21,7 +21,7 @@ def process_jsonl(input_file, model_name, output_file): ) # Write the list of JSON objects to a file print(f'Output JSON list created at {output_file}') except Exception as e: - print(f'Error: {str(e)}') + print(f'Error: {e}') # Usage: python script.py input.jsonl model_name output.json diff --git a/opendevin/controller/agent_controller.py b/opendevin/controller/agent_controller.py index 2dda8a4d48..c17e762e1f 100644 --- a/opendevin/controller/agent_controller.py +++ b/opendevin/controller/agent_controller.py @@ -122,7 +122,7 @@ class AgentController: """ self.state.error = message if exception: - self.state.error += f': {str(exception)}' + self.state.error += f': {exception}' await self.event_stream.add_event(ErrorObservation(message), EventSource.AGENT) async def add_history(self, action: Action, observation: Observation):