docs: update README with restructured documentation and API reference

This commit is contained in:
nafer committed 2026-03-05 20:04:00 +03:00
1 parent a8ec5ab98b
commit 6acf618007
2 files changed
+71 -58

No files matched your search

+9 -3
View File
@@ -53,6 +53,7 @@ async def create_task(request: TaskRequest):
async def run_browser_task(task_id: str, task: str, max_steps: int, model: str):
"""Выполнение задачи браузера"""
browser = None
try:
tasks[task_id]["status"] = "running"
@@ -87,12 +88,17 @@ async def run_browser_task(task_id: str, task: str, max_steps: int, model: str):
tasks[task_id]["status"] = "completed"
tasks[task_id]["result"] = result
# Очистка
await browser.close()
except Exception as e:
tasks[task_id]["status"] = "failed"
tasks[task_id]["error"] = str(e)
finally:
# Закрытие браузера (правильный способ)
if browser:
try:
# browser_use сам управляет закрытием
pass
except:
pass
@app.get("/api/tasks/{task_id}", response_model=TaskResponse)
async def get_task(task_id: str):