From 2e3fe1ac71f2540d50745b44331bd85f45a45f45 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 13 Feb 2025 19:04:26 +0800 Subject: [PATCH] fix: ensure expected type (#593) * ensure expected type * reformat --- rdagent/scenarios/data_science/proposal/exp_gen.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rdagent/scenarios/data_science/proposal/exp_gen.py b/rdagent/scenarios/data_science/proposal/exp_gen.py index 0e201ed7..99bb9afe 100644 --- a/rdagent/scenarios/data_science/proposal/exp_gen.py +++ b/rdagent/scenarios/data_science/proposal/exp_gen.py @@ -217,9 +217,10 @@ class DSExpGen(ExpGen): and component == "Model" ) ): # Assumption: when completing missing component, using component name as task name - resp_dict[ - "description" - ] += f"\n\nYou have tried to implement the same component and got the following exception: \n{exp_and_feedback[1].exception}\n Please try different methods to avoid the same errors and results in an infinite loop" + resp_dict["description"] = ( + str(resp_dict.get("description"), "") + + f"\n\nYou have tried to implement the same component and got the following exception: \n{exp_and_feedback[1].exception}\n Please try different methods to avoid the same errors and results in an infinite loop" + ) task = task_cls( name=component if component != "Model" else resp_dict.pop("model_name"),