mind2web
This commit is contained in:
parent
2b5d923f63
commit
98d5e90894
754 changed files with 1175740 additions and 142424 deletions
47
stuff/debug_browser_tool.py
Normal file
47
stuff/debug_browser_tool.py
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
import os
|
||||
import sys
|
||||
import asyncio
|
||||
from dotenv import load_dotenv
|
||||
|
||||
PROJECT_ROOT = os.path.abspath(
|
||||
os.path.join(os.path.dirname(__file__), "")
|
||||
)
|
||||
|
||||
SKILLS_DIR = os.path.join(PROJECT_ROOT, "../BrowserUse_and_ComputerUse_skills")
|
||||
HERMES_CODE_DIR = os.path.join(SKILLS_DIR, "hermes_code")
|
||||
ENV_PATH = os.path.join(SKILLS_DIR, ".env")
|
||||
|
||||
for path in [PROJECT_ROOT, SKILLS_DIR, HERMES_CODE_DIR]:
|
||||
if path not in sys.path:
|
||||
sys.path.append(path)
|
||||
|
||||
load_dotenv(ENV_PATH, override=True)
|
||||
|
||||
os.environ["MODEL"] = "qwen3.5-122b"
|
||||
os.environ["MODEL_DEFAULT"] = "qwen3.5-122b"
|
||||
os.environ["BASE_URL"] = "https://llm.lambda.coredump.ru/v1"
|
||||
os.environ["OPENAI_BASE_URL"] = "https://llm.lambda.coredump.ru/v1"
|
||||
os.environ["API_KEY"] = "sk-4rzg5cB88S4MCSgNOLAzIw"
|
||||
os.environ["OPENAI_API_KEY"] = "sk-4rzg5cB88S4MCSgNOLAzIw"
|
||||
os.environ["PROVIDER"] = "custom"
|
||||
os.environ["BROWSER_URL"] = "http://localhost:9222"
|
||||
os.environ["BROWSER_VIEW_URL"] = "http://localhost:6080"
|
||||
|
||||
print("MODEL:", os.getenv("MODEL"), flush=True)
|
||||
print("BROWSER_URL:", os.getenv("BROWSER_URL"), flush=True)
|
||||
|
||||
from hermes_code.tools.browser_use_tool import run_browser_task
|
||||
|
||||
|
||||
async def main():
|
||||
print("DEBUG: before run_browser_task", flush=True)
|
||||
result = await asyncio.wait_for(
|
||||
run_browser_task("Открой nba.com"),
|
||||
timeout=60,
|
||||
)
|
||||
print("DEBUG: after run_browser_task", flush=True)
|
||||
print(result, flush=True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Loading…
Add table
Add a link
Reference in a new issue