Skip to content

Commit 2d2aa0d

Browse files
committed
feat: add default config to load from hard-code instead of a file
1 parent 704ea64 commit 2d2aa0d

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

default_config.pkl

-554 Bytes
Binary file not shown.

src/utils/default_config_settings.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,33 @@
33
import uuid
44

55

6+
def default_config():
7+
"""Prepare the default configuration"""
8+
return {
9+
"agent_type": "custom",
10+
"max_steps": 100,
11+
"max_actions_per_step": 10,
12+
"use_vision": True,
13+
"tool_call_in_content": True,
14+
"llm_provider": "openai",
15+
"llm_model_name": "gpt-4o",
16+
"llm_temperature": 1.0,
17+
"llm_base_url": "",
18+
"llm_api_key": "",
19+
"use_own_browser": False,
20+
"keep_browser_open": False,
21+
"headless": False,
22+
"disable_security": True,
23+
"enable_recording": True,
24+
"window_w": 1280,
25+
"window_h": 1100,
26+
"save_recording_path": "./tmp/record_videos",
27+
"save_trace_path": "./tmp/traces",
28+
"save_agent_history_path": "./tmp/agent_history",
29+
"task": "go to google.com and type 'OpenAI' click search and give me the first url",
30+
}
31+
32+
633
def load_config_from_file(config_file):
734
"""Load settings from a UUID.pkl file."""
835
try:

webui.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
from src.browser.custom_context import BrowserContextConfig, CustomBrowserContext
4040
from src.controller.custom_controller import CustomController
4141
from gradio.themes import Citrus, Default, Glass, Monochrome, Ocean, Origin, Soft, Base
42-
from src.utils.default_config_settings import load_config_from_file, save_config_to_file
42+
from src.utils.default_config_settings import default_config, load_config_from_file, save_config_to_file
4343
from src.utils.utils import update_model_dropdown, get_latest_files, capture_screenshot
4444

4545
from dotenv import load_dotenv
@@ -1024,7 +1024,7 @@ def main():
10241024
parser.add_argument("--dark-mode", action="store_true", help="Enable dark mode")
10251025
args = parser.parse_args()
10261026

1027-
config_dict = load_config_from_file("./default_config.pkl") or {}
1027+
config_dict = default_config()
10281028

10291029
demo = create_ui(config_dict, theme_name=args.theme)
10301030
demo.launch(server_name=args.ip, server_port=args.port)

0 commit comments

Comments
 (0)