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:
BioInfo
2025-02-01 20:37:04 -05:00
parent 32df3485c9
commit 150a8b4384
3 changed files with 3 additions and 13 deletions

View File

@@ -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": {

View File

@@ -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"],

View File

@@ -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(