llamaindex support (#1758)
This commit is contained in:
@@ -1,44 +1,13 @@
|
||||
from typing import Any, Dict
|
||||
|
||||
from langchain.tools import tool
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from skyvern.agent.parameter import TaskV1Request, TaskV2Request
|
||||
from skyvern.agent.parameter import GetTaskSchema, RunTaskV1Schema, RunTaskV2Schema, TaskV1Request, TaskV2Request
|
||||
from skyvern.agent.remote import RemoteAgent
|
||||
from skyvern.forge.sdk.schemas.observers import ObserverTask
|
||||
from skyvern.forge.sdk.schemas.tasks import CreateTaskResponse, TaskResponse
|
||||
|
||||
|
||||
class RunTaskV1Schema(BaseModel):
|
||||
api_key: str = Field(
|
||||
description="The API key of the Skyvern API. You can get the API key from the Skyvern dashboard."
|
||||
)
|
||||
endpoint: str = Field(
|
||||
description="The endpoint of the Skyvern API. Don't add any path to the endpoint. Default is https://api.skyvern.com"
|
||||
)
|
||||
task: TaskV1Request
|
||||
|
||||
|
||||
class RunTaskV2Schema(BaseModel):
|
||||
api_key: str = Field(
|
||||
description="The API key of the Skyvern API. You can get the API key from the Skyvern dashboard."
|
||||
)
|
||||
endpoint: str = Field(
|
||||
description="The endpoint of the Skyvern API. Don't add any path to the endpoint. Default is https://api.skyvern.com"
|
||||
)
|
||||
task: TaskV2Request
|
||||
|
||||
|
||||
class GetTaskSchema(BaseModel):
|
||||
api_key: str = Field(
|
||||
description="The API key of the Skyvern API. You can get the API key from the Skyvern dashboard."
|
||||
)
|
||||
endpoint: str = Field(
|
||||
description="The endpoint of the Skyvern API. Don't add any path to the endpoint. Default is https://api.skyvern.com"
|
||||
)
|
||||
task_id: str
|
||||
|
||||
|
||||
@tool("run-remote-skyvern-simple-task", args_schema=RunTaskV1Schema)
|
||||
async def run_task_v1(
|
||||
task: Dict[str, Any], api_key: str, endpoint: str = "https://api.skyvern.com"
|
||||
|
||||
Reference in New Issue
Block a user