Skip to content

Commit 150a8b4

Browse files
committed
feat: add OpenAI O3-mini model support and fix theme handling
- Add O3-mini model to OpenAI model options - Remove forced dark theme to allow system/light theme options - Fix JSON template escape sequence in custom prompts
1 parent 32df348 commit 150a8b4

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

src/agent/custom_prompts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def important_rules(self) -> str:
1414
"""
1515
Returns the important rules for the agent.
1616
"""
17-
text = """
17+
text = r"""
1818
1. RESPONSE FORMAT: You must ALWAYS respond with valid JSON in this exact format:
1919
{
2020
"current_state": {

src/utils/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def get_llm_model(provider: str, **kwargs):
140140
# Predefined model names for common providers
141141
model_names = {
142142
"anthropic": ["claude-3-5-sonnet-20240620", "claude-3-opus-20240229"],
143-
"openai": ["gpt-4o", "gpt-4", "gpt-3.5-turbo"],
143+
"openai": ["gpt-4o", "gpt-4", "gpt-3.5-turbo", "o3-mini"],
144144
"deepseek": ["deepseek-chat", "deepseek-reasoner"],
145145
"gemini": ["gemini-2.0-flash-exp", "gemini-2.0-flash-thinking-exp", "gemini-1.5-flash-latest", "gemini-1.5-flash-8b-latest", "gemini-2.0-flash-thinking-exp-1219" ],
146146
"ollama": ["qwen2.5:7b", "llama2:7b", "deepseek-r1:14b", "deepseek-r1:32b"],

webui.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -616,18 +616,8 @@ def create_ui(config, theme_name="Ocean"):
616616
}
617617
"""
618618

619-
js = """
620-
function refresh() {
621-
const url = new URL(window.location);
622-
if (url.searchParams.get('__theme') !== 'dark') {
623-
url.searchParams.set('__theme', 'dark');
624-
window.location.href = url.href;
625-
}
626-
}
627-
"""
628-
629619
with gr.Blocks(
630-
title="Browser Use WebUI", theme=theme_map[theme_name], css=css, js=js
620+
title="Browser Use WebUI", theme=theme_map[theme_name], css=css
631621
) as demo:
632622
with gr.Row():
633623
gr.Markdown(

0 commit comments

Comments
 (0)