Skip to content

Commit 585800f

Browse files
author
katiue
committed
reduce amount of changes for merge
1 parent 9acd566 commit 585800f

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

webui.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ async def run_browser_agent(
5858
use_vision,
5959
max_actions_per_step,
6060
tool_call_in_content,
61-
browser_context=None
6261
):
6362
# Disable recording if the checkbox is unchecked
6463
if not enable_recording:
@@ -84,7 +83,6 @@ async def run_browser_agent(
8483
base_url=llm_base_url,
8584
api_key=llm_api_key,
8685
)
87-
8886
if agent_type == "org":
8987
final_result, errors, model_actions, model_thoughts = await run_org_agent(
9088
llm=llm,
@@ -115,7 +113,7 @@ async def run_browser_agent(
115113
max_steps=max_steps,
116114
use_vision=use_vision,
117115
max_actions_per_step=max_actions_per_step,
118-
tool_call_in_content=tool_call_in_content,
116+
tool_call_in_content=tool_call_in_content
119117
)
120118
else:
121119
raise ValueError(f"Invalid agent type: {agent_type}")
@@ -144,7 +142,7 @@ async def run_org_agent(
144142
max_steps,
145143
use_vision,
146144
max_actions_per_step,
147-
tool_call_in_content,
145+
tool_call_in_content
148146
):
149147
browser = Browser(
150148
config=BrowserConfig(
@@ -378,8 +376,7 @@ async def run_with_stream(
378376
max_steps=max_steps,
379377
use_vision=use_vision,
380378
max_actions_per_step=max_actions_per_step,
381-
tool_call_in_content=tool_call_in_content,
382-
browser_context=_global_browser_context
379+
tool_call_in_content=tool_call_in_content
383380
)
384381
)
385382

@@ -467,6 +464,7 @@ def create_ui(theme_name="Ocean"):
467464
border-radius: 10px;
468465
}
469466
"""
467+
470468
js = """
471469
function refresh() {
472470
const url = new URL(window.location);
@@ -615,11 +613,18 @@ def create_ui(theme_name="Ocean"):
615613

616614
with gr.TabItem("🤖 Run Agent", id=4):
617615
task = gr.Textbox(
616+
label="Task Description",
618617
lines=4,
618+
placeholder="Enter your task here...",
619619
value="go to google.com and type 'OpenAI' click search and give me the first url",
620620
info="Describe what you want the agent to do",
621621
)
622-
add_infos = gr.Textbox(lines=3, label="Additional Information")
622+
add_infos = gr.Textbox(
623+
label="Additional Information",
624+
lines=3,
625+
placeholder="Add any helpful context or instructions...",
626+
info="Optional hints to help the LLM complete the task",
627+
)
623628

624629
with gr.Row():
625630
run_button = gr.Button("▶️ Run Agent", variant="primary", scale=2)
@@ -705,7 +710,7 @@ def list_recordings(save_recording_path):
705710
outputs=save_recording_path
706711
)
707712

708-
# Button logic
713+
# Run button click handler
709714
run_button.click(
710715
fn=run_with_stream,
711716
inputs=[
@@ -727,8 +732,6 @@ def list_recordings(save_recording_path):
727732

728733
return demo
729734

730-
731-
# Update the main function to handle cleanup
732735
def main():
733736
parser = argparse.ArgumentParser(description="Gradio UI for Browser Agent")
734737
parser.add_argument("--ip", type=str, default="127.0.0.1", help="IP address to bind to")

0 commit comments

Comments
 (0)