Skip to content

Commit 31f56b5

Browse files
Update webui.py
1 parent 7a09983 commit 31f56b5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

webui.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ async def run_custom_agent(
238238
"Ocean": Ocean()
239239
}
240240

241-
def create_ui():
241+
def create_ui(theme_name="Ocean"):
242242
"""Create the UI with the specified theme"""
243243
# Enhanced styling for better visual appeal
244244
css = """
@@ -258,7 +258,7 @@ def create_ui():
258258
}
259259
"""
260260

261-
with gr.Blocks(title="Browser Use WebUI", theme=theme_map["Ocean"], css=css) as demo:
261+
with gr.Blocks(title="Browser Use WebUI", theme=theme_map[theme_name], css=css) as demo:
262262
with gr.Row():
263263
gr.Markdown(
264264
"""
@@ -294,7 +294,7 @@ def create_ui():
294294
with gr.TabItem("🔧 LLM Configuration", id=2):
295295
with gr.Group():
296296
llm_provider = gr.Dropdown(
297-
["anthropic", "openai", "gemini", "azure_openai", "deepseek", ""],
297+
["anthropic", "openai", "gemini", "azure_openai", "deepseek"],
298298
label="LLM Provider",
299299
value="gemini",
300300
info="Select your preferred language model provider"
@@ -457,9 +457,11 @@ def main():
457457
parser = argparse.ArgumentParser(description="Gradio UI for Browser Agent")
458458
parser.add_argument("--ip", type=str, default="127.0.0.1", help="IP address to bind to")
459459
parser.add_argument("--port", type=int, default=7788, help="Port to listen on")
460+
parser.add_argument("--theme", type=str, default="Citrus", choices=theme_map.keys(), help="Theme to use for the UI")
460461
args = parser.parse_args()
461462

462-
demo = create_ui()
463+
# Create the UI with the specified theme
464+
demo = create_ui(theme_name=args.theme)
463465
demo.launch(server_name=args.ip, server_port=args.port)
464466

465467
if __name__ == '__main__':

0 commit comments

Comments
 (0)