mirror of
https://github.com/browser-use/web-ui.git
synced 2026-03-22 11:17:17 +08:00
fix: yields provider when agent settings change
Yields the provider when the agent settings change in order to run the callback. Also adds a short sleep to wait for Gradio UI callback. Fix Planner LLM Model Name not loaded correctly when Load Config #589 Signed-off-by: knowlet <knowlet@pm.me>
This commit is contained in:
@@ -7,6 +7,7 @@ from datetime import datetime
|
||||
from typing import Optional, Dict, List
|
||||
import uuid
|
||||
import asyncio
|
||||
import time
|
||||
|
||||
from gradio.components import Component
|
||||
from browser_use.browser.browser import Browser
|
||||
@@ -108,6 +109,9 @@ class WebuiManager:
|
||||
update_components[comp] = comp.__class__(value=comp_val, type="messages")
|
||||
else:
|
||||
update_components[comp] = comp.__class__(value=comp_val)
|
||||
if comp_id == "agent_settings.planner_llm_provider":
|
||||
yield update_components # yield provider, let callback run
|
||||
time.sleep(0.1) # wait for Gradio UI callback
|
||||
|
||||
config_status = self.id_to_component["load_save_config.config_status"]
|
||||
update_components.update(
|
||||
|
||||
Reference in New Issue
Block a user