Spaces:
Paused
Paused
Update tools/ai_tools.py
Browse files- tools/ai_tools.py +6 -4
tools/ai_tools.py
CHANGED
|
@@ -70,10 +70,10 @@ class AITools():
|
|
| 70 |
project_id=os.environ["BROWSERBASE_PROJECT_ID"],
|
| 71 |
model_api_key=os.environ["MODEL_API_KEY"],
|
| 72 |
model_name=WEB_BROWSER_MODEL,
|
| 73 |
-
dom_settle_timeout_ms=5000,
|
| 74 |
-
headless=True,
|
| 75 |
-
self_heal=True,
|
| 76 |
-
wait_for_captcha_solves=True,
|
| 77 |
verbose=3
|
| 78 |
)
|
| 79 |
|
|
@@ -83,6 +83,8 @@ class AITools():
|
|
| 83 |
)
|
| 84 |
except Exception as e:
|
| 85 |
raise RuntimeError(f"Processing failed: {str(e)}")
|
|
|
|
|
|
|
| 86 |
|
| 87 |
@tool("Image Analysis Tool")
|
| 88 |
def image_analysis_tool(question: str, file_path: str) -> str:
|
|
|
|
| 70 |
project_id=os.environ["BROWSERBASE_PROJECT_ID"],
|
| 71 |
model_api_key=os.environ["MODEL_API_KEY"],
|
| 72 |
model_name=WEB_BROWSER_MODEL,
|
| 73 |
+
#dom_settle_timeout_ms=5000,
|
| 74 |
+
#headless=True,
|
| 75 |
+
#self_heal=True,
|
| 76 |
+
#wait_for_captcha_solves=True,
|
| 77 |
verbose=3
|
| 78 |
)
|
| 79 |
|
|
|
|
| 83 |
)
|
| 84 |
except Exception as e:
|
| 85 |
raise RuntimeError(f"Processing failed: {str(e)}")
|
| 86 |
+
finally:
|
| 87 |
+
stagehand_tool.close()
|
| 88 |
|
| 89 |
@tool("Image Analysis Tool")
|
| 90 |
def image_analysis_tool(question: str, file_path: str) -> str:
|