|
9 | 9 | ExperimentFeedback, |
10 | 10 | HypothesisFeedback, |
11 | 11 | ) |
| 12 | +from rdagent.log.utils import dict_get_with_warning |
12 | 13 | from rdagent.oai.llm_utils import APIBackend |
13 | 14 | from rdagent.scenarios.data_science.experiment.experiment import DSExperiment |
14 | 15 | from rdagent.scenarios.data_science.proposal.exp_gen import DSTrace |
@@ -114,11 +115,14 @@ def generate_feedback(self, exp: DSExperiment, trace: DSTrace) -> ExperimentFeed |
114 | 115 | # Currently, we do not use `observations`, `hypothesis_evaluation`, and `new_hypothesis` in the framework. |
115 | 116 | # `new_hypothesis` should not exist in the feedback. |
116 | 117 | hypothesis_feedback = HypothesisFeedback( |
117 | | - observations=resp_dict.get("Observations", "No observations provided"), |
118 | | - hypothesis_evaluation=resp_dict.get("Feedback for Hypothesis", "No feedback provided"), |
119 | | - new_hypothesis=resp_dict.get("New Hypothesis", "No new hypothesis provided"), |
120 | | - reason=resp_dict.get("Reasoning", "No reasoning provided"), |
121 | | - decision=convert2bool(resp_dict.get("Replace Best Result", "no")), |
| 118 | + observations=dict_get_with_warning(resp_dict, "Observations", "No observations provided"), |
| 119 | + hypothesis_evaluation=dict_get_with_warning(resp_dict, "Feedback for Hypothesis", "No feedback provided"), |
| 120 | + new_hypothesis=dict_get_with_warning(resp_dict, "New Hypothesis", "No new hypothesis provided"), |
| 121 | + reason=dict_get_with_warning(resp_dict, "Reasoning", "No reasoning provided"), |
| 122 | + code_change_summary=dict_get_with_warning( |
| 123 | + resp_dict, "Code Change Summary", "No code change summary provided" |
| 124 | + ), |
| 125 | + decision=convert2bool(dict_get_with_warning(resp_dict, "Replace Best Result", "no")), |
122 | 126 | ) |
123 | 127 |
|
124 | 128 | if hypothesis_feedback and DS_RD_SETTING.enable_knowledge_base: |
|
0 commit comments