@@ -86,7 +86,7 @@ async def run_browser_agent(
86
86
)
87
87
88
88
if agent_type == "org" :
89
- final_result , errors , model_actions , model_thoughts , recorded_files , trace_file = await run_org_agent (
89
+ final_result , errors , model_actions , model_thoughts = await run_org_agent (
90
90
llm = llm ,
91
91
headless = headless ,
92
92
disable_security = disable_security ,
@@ -158,19 +158,21 @@ async def run_org_agent(
158
158
trace_path = save_trace_path if save_trace_path else None ,
159
159
save_recording_path = save_recording_path if save_recording_path else None ,
160
160
no_viewport = False ,
161
- browser_window_size = BrowserContextWindowSize (width = window_w , height = window_h ),
161
+ browser_window_size = BrowserContextWindowSize (
162
+ width = window_w , height = window_h
163
+ ),
162
164
)
163
165
) as browser_context :
164
166
agent = Agent (
165
167
task = task ,
166
168
llm = llm ,
167
169
use_vision = use_vision ,
168
- max_actions_per_step = max_actions_per_step ,
169
- tool_call_in_content = tool_call_in_content ,
170
170
browser_context = browser_context ,
171
+ max_actions_per_step = max_actions_per_step ,
172
+ tool_call_in_content = tool_call_in_content
171
173
)
172
174
history = await agent .run (max_steps = max_steps )
173
-
175
+
174
176
final_result = history .final_result ()
175
177
errors = history .errors ()
176
178
model_actions = history .model_actions ()
@@ -196,7 +198,7 @@ async def run_custom_agent(
196
198
max_steps ,
197
199
use_vision ,
198
200
max_actions_per_step ,
199
- tool_call_in_content ,
201
+ tool_call_in_content
200
202
):
201
203
global _global_browser , _global_browser_context , _global_playwright
202
204
@@ -636,22 +638,22 @@ def create_ui(theme_name="Ocean"):
636
638
)
637
639
638
640
with gr .TabItem ("🤖 Run Agent" , id = 4 ):
639
- task = gr .Textbox (
640
- lines = 4 ,
641
- value = "go to google.com and type 'OpenAI' click search and give me the first url" ,
642
- info = "Describe what you want the agent to do" ,
643
- )
644
- add_infos = gr .Textbox (lines = 3 , label = "Additional Information" )
641
+ task = gr .Textbox (
642
+ lines = 4 ,
643
+ value = "go to google.com and type 'OpenAI' click search and give me the first url" ,
644
+ info = "Describe what you want the agent to do" ,
645
+ )
646
+ add_infos = gr .Textbox (lines = 3 , label = "Additional Information" )
647
+
648
+ with gr .Row ():
649
+ run_button = gr .Button ("▶️ Run Agent" , variant = "primary" , scale = 2 )
650
+ stop_button = gr .Button ("⏹️ Stop" , variant = "stop" , scale = 1 )
645
651
646
- with gr .Row ():
647
- run_button = gr .Button ("▶️ Run Agent" , variant = "primary" , scale = 2 )
648
- stop_button = gr .Button ("⏹️ Stop" , variant = "stop" , scale = 1 )
649
-
650
- with gr .Row ():
651
- browser_view = gr .HTML (
652
- value = "<div>Waiting for browser session...</div>" ,
653
- label = "Live Browser View" ,
654
- )
652
+ with gr .Row ():
653
+ browser_view = gr .HTML (
654
+ value = "<div>Waiting for browser session...</div>" ,
655
+ label = "Live Browser View" ,
656
+ )
655
657
656
658
with gr .TabItem ("📊 Results" , id = 5 ):
657
659
with gr .Group ():
0 commit comments