Эх сурвалжийг харах

Refactor: Simplify message formatting (#2670)

Removed redundant `str()` conversion in f-string.
மனோஜ்குமார் பழனிச்சாமி 1 жил өмнө
parent
commit
af9385322b

+ 1 - 1
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
             )  # Write the list of JSON objects to a file
         print(f'Output JSON list created at {output_file}')
         print(f'Output JSON list created at {output_file}')
     except Exception as e:
     except Exception as e:
-        print(f'Error: {str(e)}')
+        print(f'Error: {e}')
 
 
 
 
 # Usage: python script.py input.jsonl model_name output.json
 # Usage: python script.py input.jsonl model_name output.json

+ 1 - 1
opendevin/controller/agent_controller.py

@@ -122,7 +122,7 @@ class AgentController:
         """
         """
         self.state.error = message
         self.state.error = message
         if exception:
         if exception:
-            self.state.error += f': {str(exception)}'
+            self.state.error += f': {exception}'
         await self.event_stream.add_event(ErrorObservation(message), EventSource.AGENT)
         await self.event_stream.add_event(ErrorObservation(message), EventSource.AGENT)
 
 
     async def add_history(self, action: Action, observation: Observation):
     async def add_history(self, action: Action, observation: Observation):