From 4ec3561c60e1abd0025adfb7df12d823da305e88 Mon Sep 17 00:00:00 2001 From: XianBW <36835909+XianBW@users.noreply.github.com> Date: Wed, 25 Jun 2025 10:38:20 +0800 Subject: [PATCH] fix LLM log bug (#985) --- rdagent/log/ui/ds_trace.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rdagent/log/ui/ds_trace.py b/rdagent/log/ui/ds_trace.py index c42f218b..d2fb81b3 100644 --- a/rdagent/log/ui/ds_trace.py +++ b/rdagent/log/ui/ds_trace.py @@ -239,10 +239,9 @@ def llm_log_win(llm_d: list): st.markdown(spec) rdict.pop("spec") else: - # show model codes showed_keys = [] for k, v in rdict.items(): - if k.startswith("model_") and k.endswith(".py"): + if k.endswith(".py"): st.markdown(f":red[**{k}**]") st.code(v, language="python", wrap_lines=True, line_numbers=True) showed_keys.append(k) @@ -251,7 +250,10 @@ def llm_log_win(llm_d: list): st.write(":red[**Other parts (except for the code or spec) in response dict:**]") st.json(rdict) except: - st.json(resp) + try: + st.json(resp) + except: + show_text(resp) with t2: show_text(user) with t3: