SDK: use Skyvern.local() factory method (#4206)
This commit is contained in:
committed by
GitHub
parent
32fb2315f0
commit
e1693b2fef
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user