Skip to content

Commit 6b48f24

Browse files
authored
change something for ui compatiblity (#1149)
1 parent 6974292 commit 6b48f24

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

rdagent/log/ui/ds_trace.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,19 +390,30 @@ def evolving_win(data, key, llm_data=None, base_workspace=None):
390390
if evo_id in data:
391391
if state.show_llm_log and llm_data is not None:
392392
llm_log_win(llm_data[evo_id])
393-
if data[evo_id]["evolving code"][0] is not None:
393+
394+
# get evolving workspace
395+
if "evolving code" in data[evo_id] and data[evo_id]["evolving code"][0] is not None:
396+
evolving_code_workspace = data[evo_id]["evolving code"][0]
397+
else:
398+
evolving_code_workspace = None
399+
400+
if evolving_code_workspace is not None:
394401
st.subheader("codes")
395402
workspace_win(
396-
data[evo_id]["evolving code"][0],
403+
evolving_code_workspace,
397404
cmp_workspace=data[evo_id - 1]["evolving code"][0] if evo_id > 0 else base_workspace,
398405
cmp_name="last evolving code" if evo_id > 0 else "base workspace",
399406
)
400407
fb = data[evo_id]["evolving feedback"][0]
401408
st.subheader("evolving feedback" + ("✅" if bool(fb) else "❌"))
402-
f1, f2, f3 = st.tabs(["execution", "return_checking", "code"])
409+
f1, f2, f3, f4 = st.tabs(["execution", "return_checking", "code", "others"])
410+
other_attributes = {
411+
k: v for k, v in fb.__dict__.items() if k not in ["execution", "return_checking", "code"]
412+
}
403413
f1.code(fb.execution, wrap_lines=True)
404414
f2.code(fb.return_checking, wrap_lines=True)
405415
f3.code(fb.code, wrap_lines=True)
416+
f4.json(other_attributes)
406417
else:
407418
st.write("data[evo_id]['evolving code'][0] is None.")
408419
st.write(data[evo_id])

rdagent/scenarios/data_science/dev/runner/eval.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ def is_acceptable(self) -> bool:
4444
return super().is_acceptable()
4545

4646

47+
DSCoSTEEREvalFeedback = DSRunnerFeedback # FIXME: Alias for backward compatibility
48+
49+
4750
class DSRunnerEvaluator(CoSTEEREvaluator):
4851

4952
def evaluate(

rdagent/scenarios/data_science/proposal/exp_gen/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def __str__(self) -> str:
4646
lines.append(f"Hypothesis: {self.hypothesis}")
4747
if self.reason is not None:
4848
lines.append(f"Reason: {self.reason}")
49-
if self.appendix is not None:
49+
if hasattr(self, "appendix") and self.appendix is not None: # FIXME: compatibility with old traces
5050
lines.append(f"Appendix: {self.appendix}")
5151
return "\n".join(lines)
5252

0 commit comments

Comments
 (0)