fix browser use

This commit is contained in:
raykkk
2025-11-04 10:58:31 +08:00
parent b498677c51
commit 91bad9d6a1
6 changed files with 19 additions and 1052 deletions

View File

@@ -49,7 +49,7 @@ from agentscope_runtime.sandbox.tools.browser import (
run_shell_command,
)
from .prompts import SYSTEM_PROMPT
from prompts import SYSTEM_PROMPT
if os.path.exists(".env"):
from dotenv import load_dotenv
@@ -130,11 +130,9 @@ class AgentscopeBrowseruseAgent:
if len(sandboxes) > 0:
sandbox = sandboxes[0]
js = sandbox.get_info()
ws = js["front_browser_ws"]
self.ws = ws
self.desktop_url = sandbox.desktop_url
else:
self.ws = ""
self.desktop_url = ""
runner = Runner(
agent=self.agent,

View File

@@ -96,8 +96,8 @@ async def stream():
@app.route("/env_info", methods=["GET"])
async def get_env_info():
if agent.ws is not None:
url = agent.ws
if agent.desktop_url is not None:
url = agent.desktop_url
logger.info(url)
return jsonify({"url": url})
else:

View File

@@ -1,5 +1,5 @@
pyyaml>=6.0.2
quart>=0.8.0
quart-cors>=0.8.0
agentscope-runtime>=0.1.5
agentscope-runtime>=0.1.6
agentscope[full]>=1.0.5