@@ -148,7 +148,7 @@ async def run_browser_agent(
148
148
tool_call_in_content = tool_call_in_content
149
149
)
150
150
elif agent_type == "custom" :
151
- final_result , errors , model_actions , model_thoughts , trace_file = await run_custom_agent (
151
+ final_result , errors , model_actions , model_thoughts , trace_file , history_file = await run_custom_agent (
152
152
llm = llm ,
153
153
use_own_browser = use_own_browser ,
154
154
keep_browser_open = keep_browser_open ,
@@ -186,6 +186,7 @@ async def run_browser_agent(
186
186
model_thoughts ,
187
187
latest_video ,
188
188
trace_file ,
189
+ history_file ,
189
190
gr .update (value = "Stop" , interactive = True ), # Re-enable stop button
190
191
gr .update (value = "Run" , interactive = True ) # Re-enable run button
191
192
)
@@ -201,6 +202,7 @@ async def run_browser_agent(
201
202
'' , # model_thoughts
202
203
None , # latest_video
203
204
None , # trace_file
205
+ None , # history_file
204
206
gr .update (value = "Stop" , interactive = True ), # Re-enable stop button
205
207
gr .update (value = "Run" , interactive = True ) # Re-enable run button
206
208
)
@@ -374,7 +376,7 @@ async def run_custom_agent(
374
376
375
377
trace_file = get_latest_files (save_trace_path )
376
378
377
- return final_result , errors , model_actions , model_thoughts , trace_file .get ('.zip' )
379
+ return final_result , errors , model_actions , model_thoughts , trace_file .get ('.zip' ), history_file
378
380
except Exception as e :
379
381
import traceback
380
382
traceback .print_exc ()
@@ -794,13 +796,7 @@ def create_ui(theme_name="Ocean"):
794
796
795
797
trace_file = gr .File (label = "Trace File" )
796
798
797
- history_download_button = gr .Button ("⬇️ Download Agent History" )
798
-
799
- history_download_button .click (
800
- fn = utils .download_agent_history ,
801
- inputs = save_agent_history_path ,
802
- outputs = gr .File (),
803
- )
799
+ agent_history_file = gr .File (label = "Agent History" )
804
800
805
801
# Bind the stop button click event after errors_output is defined
806
802
stop_button .click (
@@ -826,6 +822,7 @@ def create_ui(theme_name="Ocean"):
826
822
model_thoughts_output , # Model thoughts
827
823
recording_display , # Latest recording
828
824
trace_file , # Trace file
825
+ agent_history_file , # Agent history file
829
826
stop_button , # Stop button
830
827
run_button # Run button
831
828
],
0 commit comments