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
This commit is contained in:
@@ -14,7 +14,7 @@ class CustomSystemPrompt(SystemPrompt):
|
||||
"""
|
||||
Returns the important rules for the agent.
|
||||
"""
|
||||
text = """
|
||||
text = r"""
|
||||
1. RESPONSE FORMAT: You must ALWAYS respond with valid JSON in this exact format:
|
||||
{
|
||||
"current_state": {
|
||||
|
||||
@@ -140,7 +140,7 @@ def get_llm_model(provider: str, **kwargs):
|
||||
# Predefined model names for common providers
|
||||
model_names = {
|
||||
"anthropic": ["claude-3-5-sonnet-20240620", "claude-3-opus-20240229"],
|
||||
"openai": ["gpt-4o", "gpt-4", "gpt-3.5-turbo"],
|
||||
"openai": ["gpt-4o", "gpt-4", "gpt-3.5-turbo", "o3-mini"],
|
||||
"deepseek": ["deepseek-chat", "deepseek-reasoner"],
|
||||
"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" ],
|
||||
"ollama": ["qwen2.5:7b", "llama2:7b", "deepseek-r1:14b", "deepseek-r1:32b"],
|
||||
|
||||
12
webui.py
12
webui.py
@@ -616,18 +616,8 @@ def create_ui(config, theme_name="Ocean"):
|
||||
}
|
||||
"""
|
||||
|
||||
js = """
|
||||
function refresh() {
|
||||
const url = new URL(window.location);
|
||||
if (url.searchParams.get('__theme') !== 'dark') {
|
||||
url.searchParams.set('__theme', 'dark');
|
||||
window.location.href = url.href;
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
with gr.Blocks(
|
||||
title="Browser Use WebUI", theme=theme_map[theme_name], css=css, js=js
|
||||
title="Browser Use WebUI", theme=theme_map[theme_name], css=css
|
||||
) as demo:
|
||||
with gr.Row():
|
||||
gr.Markdown(
|
||||
|
||||
Reference in New Issue
Block a user