SDK: use Skyvern.local() factory method (#4206)

This commit is contained in:
Stanislav Novosad
2025-12-05 13:21:40 -07:00
committed by GitHub
parent 32fb2315f0
commit e1693b2fef
7 changed files with 89 additions and 94 deletions

View File

@@ -15,7 +15,7 @@ from skyvern.schemas.runs import RunEngine
class SkyvernTaskBaseTool(BaseTool):
engine: RunEngine = Field(default=settings.engine)
run_task_timeout_seconds: int = Field(default=settings.run_task_timeout_seconds)
agent: Skyvern = Skyvern()
agent: Skyvern = Skyvern.local()
def _run(self, *args: Any, **kwargs: Any) -> None:
raise NotImplementedError("skyvern task tool does not support sync")

View File

@@ -13,7 +13,7 @@ from skyvern.schemas.runs import RunEngine
class SkyvernTool:
def __init__(self, agent: Skyvern | None = None):
if agent is None:
agent = Skyvern()
agent = Skyvern.local()
self.agent = agent
def run_task(self) -> FunctionTool:
@@ -44,7 +44,7 @@ class SkyvernTaskToolSpec(BaseToolSpec):
run_task_timeout_seconds: int = settings.run_task_timeout_seconds,
) -> None:
if agent is None:
agent = Skyvern()
agent = Skyvern.local()
self.agent = agent
self.engine = engine
self.run_task_timeout_seconds = run_task_timeout_seconds