add fern sdk (#1786)
This commit is contained in:
@@ -20,6 +20,10 @@ repos:
|
||||
# Run the linter.
|
||||
- id: ruff
|
||||
args: [--fix]
|
||||
exclude: |
|
||||
(?x)(
|
||||
^skyvern/client/*
|
||||
)
|
||||
# Run the formatter.
|
||||
- id: ruff-format
|
||||
- repo: https://github.com/pycqa/isort
|
||||
@@ -27,6 +31,10 @@ repos:
|
||||
hooks:
|
||||
- id: isort
|
||||
language_version: python3.11
|
||||
exclude: |
|
||||
(?x)(
|
||||
^skyvern/client/*
|
||||
)
|
||||
|
||||
- repo: https://github.com/pre-commit/pygrep-hooks
|
||||
rev: v1.10.0
|
||||
@@ -53,7 +61,8 @@ repos:
|
||||
(?x)(
|
||||
^tests.*|
|
||||
^streamlit_app.*|
|
||||
^alembic.*
|
||||
^alembic.*|
|
||||
^skyvern/client/*
|
||||
)
|
||||
|
||||
- repo: https://github.com/PyCQA/autoflake
|
||||
@@ -64,6 +73,10 @@ repos:
|
||||
entry: autoflake --in-place --remove-all-unused-imports --recursive --ignore-init-module-imports
|
||||
language: python
|
||||
types: [ python ]
|
||||
exclude: |
|
||||
(?x)(
|
||||
^skyvern/client/*
|
||||
)
|
||||
# Mono repo has bronken this TODO: fix
|
||||
# - id: pytest-check
|
||||
# name: pytest-check
|
||||
|
||||
3
skyvern/agent/__init__.py
Normal file
3
skyvern/agent/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from skyvern.agent.local import Agent
|
||||
|
||||
__all__ = ["Agent"]
|
||||
@@ -1,13 +1,14 @@
|
||||
import asyncio
|
||||
|
||||
from dotenv import load_dotenv
|
||||
|
||||
from skyvern.agent.parameter import TaskV1Request, TaskV2Request
|
||||
from skyvern.forge import app
|
||||
from skyvern.forge.sdk.core import security, skyvern_context
|
||||
from skyvern.forge.sdk.core.skyvern_context import SkyvernContext
|
||||
from skyvern.forge.sdk.db.enums import OrganizationAuthTokenType
|
||||
from skyvern.forge.sdk.schemas.observers import ObserverTask, ObserverTaskStatus
|
||||
from skyvern.forge.sdk.schemas.observers import ObserverTask, ObserverTaskRequest, ObserverTaskStatus
|
||||
from skyvern.forge.sdk.schemas.organizations import Organization
|
||||
from skyvern.forge.sdk.schemas.tasks import TaskResponse, TaskStatus
|
||||
from skyvern.forge.sdk.schemas.tasks import CreateTaskResponse, Task, TaskRequest, TaskResponse, TaskStatus
|
||||
from skyvern.forge.sdk.services import observer_service
|
||||
from skyvern.forge.sdk.services.org_auth_token_service import API_KEY_LIFETIME
|
||||
from skyvern.forge.sdk.workflow.models.workflow import WorkflowRunStatus
|
||||
@@ -40,32 +41,20 @@ class Agent:
|
||||
)
|
||||
return organization
|
||||
|
||||
async def run_task_v1(self, task_request: TaskV1Request) -> TaskResponse:
|
||||
organization = await self._get_organization()
|
||||
|
||||
async def _run_task(self, organization: Organization, task: Task) -> None:
|
||||
org_auth_token = await app.DATABASE.get_valid_org_auth_token(
|
||||
organization_id=organization.organization_id,
|
||||
token_type=OrganizationAuthTokenType.api,
|
||||
)
|
||||
|
||||
created_task = await app.agent.create_task(task_request, organization.organization_id)
|
||||
|
||||
skyvern_context.set(
|
||||
SkyvernContext(
|
||||
organization_id=organization.organization_id,
|
||||
task_id=created_task.task_id,
|
||||
max_steps_override=task_request.max_steps,
|
||||
)
|
||||
)
|
||||
|
||||
step = await app.DATABASE.create_step(
|
||||
created_task.task_id,
|
||||
task.task_id,
|
||||
order=0,
|
||||
retry_index=0,
|
||||
organization_id=organization.organization_id,
|
||||
)
|
||||
updated_task = await app.DATABASE.update_task(
|
||||
created_task.task_id,
|
||||
task.task_id,
|
||||
status=TaskStatus.running,
|
||||
organization_id=organization.organization_id,
|
||||
)
|
||||
@@ -77,18 +66,65 @@ class Agent:
|
||||
api_key=org_auth_token.token if org_auth_token else None,
|
||||
)
|
||||
|
||||
refreshed_task = await app.DATABASE.get_task(created_task.task_id, organization.organization_id)
|
||||
if refreshed_task:
|
||||
updated_task = refreshed_task
|
||||
async def _run_observer_task(self, organization: Organization, observer_task: ObserverTask) -> None:
|
||||
# mark observer cruise as queued
|
||||
await app.DATABASE.update_observer_cruise(
|
||||
observer_cruise_id=observer_task.observer_cruise_id,
|
||||
status=ObserverTaskStatus.queued,
|
||||
organization_id=organization.organization_id,
|
||||
)
|
||||
|
||||
assert observer_task.workflow_run_id
|
||||
await app.DATABASE.update_workflow_run(
|
||||
workflow_run_id=observer_task.workflow_run_id,
|
||||
status=WorkflowRunStatus.queued,
|
||||
)
|
||||
|
||||
await observer_service.run_observer_task(
|
||||
organization=organization,
|
||||
observer_cruise_id=observer_task.observer_cruise_id,
|
||||
)
|
||||
|
||||
async def create_task(
|
||||
self,
|
||||
task_request: TaskRequest,
|
||||
) -> CreateTaskResponse:
|
||||
organization = await self._get_organization()
|
||||
|
||||
created_task = await app.agent.create_task(task_request, organization.organization_id)
|
||||
skyvern_context.set(
|
||||
SkyvernContext(
|
||||
organization_id=organization.organization_id,
|
||||
task_id=created_task.task_id,
|
||||
max_steps_override=created_task.max_steps_per_run,
|
||||
)
|
||||
)
|
||||
|
||||
asyncio.create_task(self._run_task(organization, created_task))
|
||||
return CreateTaskResponse(task_id=created_task.task_id)
|
||||
|
||||
async def get_task(
|
||||
self,
|
||||
task_id: str,
|
||||
) -> TaskResponse | None:
|
||||
organization = await self._get_organization()
|
||||
task = await app.DATABASE.get_task(task_id, organization.organization_id)
|
||||
|
||||
if task is None:
|
||||
return None
|
||||
|
||||
latest_step = await app.DATABASE.get_latest_step(task_id, organization_id=organization.organization_id)
|
||||
if not latest_step:
|
||||
return await app.agent.build_task_response(task=task)
|
||||
|
||||
failure_reason: str | None = None
|
||||
if updated_task.status == TaskStatus.failed and (step.output or updated_task.failure_reason):
|
||||
if task.status == TaskStatus.failed and (task.failure_reason):
|
||||
failure_reason = ""
|
||||
if updated_task.failure_reason:
|
||||
failure_reason += updated_task.failure_reason or ""
|
||||
if step.output is not None and step.output.actions_and_results is not None:
|
||||
if task.failure_reason:
|
||||
failure_reason += task.failure_reason or ""
|
||||
if latest_step.output is not None and latest_step.output.actions_and_results is not None:
|
||||
action_results_string: list[str] = []
|
||||
for action, results in step.output.actions_and_results:
|
||||
for action, results in latest_step.output.actions_and_results:
|
||||
if len(results) == 0:
|
||||
continue
|
||||
if results[-1].success:
|
||||
@@ -97,11 +133,27 @@ class Agent:
|
||||
|
||||
if len(action_results_string) > 0:
|
||||
failure_reason += "(Exceptions: " + str(action_results_string) + ")"
|
||||
|
||||
return await app.agent.build_task_response(
|
||||
task=updated_task, last_step=step, failure_reason=failure_reason, need_browser_log=True
|
||||
task=task, last_step=latest_step, failure_reason=failure_reason, need_browser_log=True
|
||||
)
|
||||
|
||||
async def run_task_v2(self, task_request: TaskV2Request) -> ObserverTask:
|
||||
async def run_task(
|
||||
self,
|
||||
task_request: TaskRequest,
|
||||
timeout_seconds: int = 600,
|
||||
) -> TaskResponse:
|
||||
created_task = await self.create_task(task_request)
|
||||
|
||||
while True:
|
||||
async with asyncio.timeout(timeout_seconds):
|
||||
task_response = await self.get_task(created_task.task_id)
|
||||
assert task_response is not None
|
||||
if task_response.status.is_final():
|
||||
return task_response
|
||||
await asyncio.sleep(1)
|
||||
|
||||
async def observer_task_v_2(self, task_request: ObserverTaskRequest) -> ObserverTask:
|
||||
organization = await self._get_organization()
|
||||
|
||||
observer_task = await observer_service.initialize_observer_task(
|
||||
@@ -118,27 +170,22 @@ class Agent:
|
||||
if not observer_task.workflow_run_id:
|
||||
raise Exception("Observer cruise missing workflow run id")
|
||||
|
||||
# mark observer cruise as queued
|
||||
await app.DATABASE.update_observer_cruise(
|
||||
observer_cruise_id=observer_task.observer_cruise_id,
|
||||
status=ObserverTaskStatus.queued,
|
||||
organization_id=organization.organization_id,
|
||||
)
|
||||
await app.DATABASE.update_workflow_run(
|
||||
workflow_run_id=observer_task.workflow_run_id,
|
||||
status=WorkflowRunStatus.queued,
|
||||
)
|
||||
|
||||
await observer_service.run_observer_task(
|
||||
organization=organization,
|
||||
observer_cruise_id=observer_task.observer_cruise_id,
|
||||
max_iterations_override=task_request.max_iterations,
|
||||
)
|
||||
|
||||
refreshed_observer_task = await app.DATABASE.get_observer_cruise(
|
||||
observer_cruise_id=observer_task.observer_cruise_id, organization_id=organization.organization_id
|
||||
)
|
||||
if refreshed_observer_task:
|
||||
return refreshed_observer_task
|
||||
|
||||
asyncio.create_task(self._run_observer_task(organization, observer_task))
|
||||
return observer_task
|
||||
|
||||
async def get_observer_task_v_2(self, task_id: str) -> ObserverTask | None:
|
||||
organization = await self._get_organization()
|
||||
return await app.DATABASE.get_observer_cruise(task_id, organization.organization_id)
|
||||
|
||||
async def run_observer_task_v_2(
|
||||
self, task_request: ObserverTaskRequest, timeout_seconds: int = 600
|
||||
) -> ObserverTask:
|
||||
observer_task = await self.observer_task_v_2(task_request)
|
||||
|
||||
while True:
|
||||
async with asyncio.timeout(timeout_seconds):
|
||||
refreshed_observer_task = await self.get_observer_task_v_2(observer_task.observer_cruise_id)
|
||||
assert refreshed_observer_task is not None
|
||||
if refreshed_observer_task.status.is_final():
|
||||
return refreshed_observer_task
|
||||
await asyncio.sleep(1)
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from skyvern.forge.sdk.schemas.observers import ObserverTaskRequest
|
||||
from skyvern.forge.sdk.schemas.tasks import TaskRequest
|
||||
|
||||
|
||||
class TaskV1Request(TaskRequest):
|
||||
max_steps: int = 10
|
||||
|
||||
|
||||
class TaskV2Request(ObserverTaskRequest):
|
||||
max_iterations: int = 10
|
||||
|
||||
|
||||
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",
|
||||
default="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",
|
||||
default="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",
|
||||
default="https://api.skyvern.com",
|
||||
)
|
||||
task_id: str
|
||||
@@ -1,43 +0,0 @@
|
||||
import httpx
|
||||
|
||||
from skyvern.agent.parameter import TaskV1Request, TaskV2Request
|
||||
from skyvern.forge.sdk.schemas.observers import ObserverTask
|
||||
from skyvern.forge.sdk.schemas.tasks import CreateTaskResponse, TaskResponse
|
||||
|
||||
|
||||
class RemoteAgent:
|
||||
def __init__(self, api_key: str, endpoint: str = "https://api.skyvern.com"):
|
||||
self.endpoint = endpoint
|
||||
self.api_key = api_key
|
||||
self.client = httpx.AsyncClient(
|
||||
headers={
|
||||
"Content-Type": "application/json",
|
||||
"x-api-key": self.api_key,
|
||||
}
|
||||
)
|
||||
|
||||
async def run_task_v1(self, task: TaskV1Request) -> CreateTaskResponse:
|
||||
url = f"{self.endpoint}/api/v1/tasks"
|
||||
payload = task.model_dump_json()
|
||||
headers = {"x_max_steps_override": str(task.max_steps)}
|
||||
response = await self.client.post(url, headers=headers, data=payload)
|
||||
return CreateTaskResponse.model_validate(response.json())
|
||||
|
||||
async def run_task_v2(self, task: TaskV2Request) -> ObserverTask:
|
||||
url = f"{self.endpoint}/api/v2/tasks"
|
||||
payload = task.model_dump_json()
|
||||
headers = {"x_max_iterations_override": str(task.max_iterations)}
|
||||
response = await self.client.post(url, headers=headers, data=payload)
|
||||
return ObserverTask.model_validate(response.json())
|
||||
|
||||
async def get_task_v1(self, task_id: str) -> TaskResponse:
|
||||
"""Get a task by id."""
|
||||
url = f"{self.endpoint}/api/v1/tasks/{task_id}"
|
||||
response = await self.client.get(url)
|
||||
return TaskResponse.model_validate(response.json())
|
||||
|
||||
async def get_task_v2(self, task_id: str) -> ObserverTask:
|
||||
"""Get a task by id."""
|
||||
url = f"{self.endpoint}/api/v2/tasks/{task_id}"
|
||||
response = await self.client.get(url)
|
||||
return ObserverTask.model_validate(response.json())
|
||||
520
skyvern/client/__init__.py
Normal file
520
skyvern/client/__init__.py
Normal file
@@ -0,0 +1,520 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from .types import (
|
||||
Action,
|
||||
ActionBlock,
|
||||
ActionBlockDataSchema,
|
||||
ActionBlockParametersItem,
|
||||
ActionBlockParametersItem_AwsSecret,
|
||||
ActionBlockParametersItem_BitwardenCreditCardData,
|
||||
ActionBlockParametersItem_BitwardenLoginCredential,
|
||||
ActionBlockParametersItem_BitwardenSensitiveInformation,
|
||||
ActionBlockParametersItem_Context,
|
||||
ActionBlockParametersItem_Output,
|
||||
ActionBlockParametersItem_Workflow,
|
||||
ActionResult,
|
||||
ActionResultData,
|
||||
ActionStatus,
|
||||
ActionType,
|
||||
AgentStepOutput,
|
||||
AiSuggestionBase,
|
||||
AiSuggestionBaseOutput,
|
||||
AiSuggestionType,
|
||||
Artifact,
|
||||
ArtifactType,
|
||||
AwsSecretParameter,
|
||||
BitwardenCreditCardDataParameter,
|
||||
BitwardenLoginCredentialParameter,
|
||||
BitwardenSensitiveInformationParameter,
|
||||
BlockType,
|
||||
BrowserSessionResponse,
|
||||
CodeBlock,
|
||||
CodeBlockParametersItem,
|
||||
CodeBlockParametersItem_AwsSecret,
|
||||
CodeBlockParametersItem_BitwardenCreditCardData,
|
||||
CodeBlockParametersItem_BitwardenLoginCredential,
|
||||
CodeBlockParametersItem_BitwardenSensitiveInformation,
|
||||
CodeBlockParametersItem_Context,
|
||||
CodeBlockParametersItem_Output,
|
||||
CodeBlockParametersItem_Workflow,
|
||||
ContextParameter,
|
||||
ContextParameterSource,
|
||||
ContextParameterSource_AwsSecret,
|
||||
ContextParameterSource_BitwardenCreditCardData,
|
||||
ContextParameterSource_BitwardenLoginCredential,
|
||||
ContextParameterSource_BitwardenSensitiveInformation,
|
||||
ContextParameterSource_Context,
|
||||
ContextParameterSource_Output,
|
||||
ContextParameterSource_Workflow,
|
||||
ContextParameterValue,
|
||||
CreateTaskResponse,
|
||||
DownloadToS3Block,
|
||||
EntityType,
|
||||
ExtractionBlock,
|
||||
ExtractionBlockDataSchema,
|
||||
ExtractionBlockParametersItem,
|
||||
ExtractionBlockParametersItem_AwsSecret,
|
||||
ExtractionBlockParametersItem_BitwardenCreditCardData,
|
||||
ExtractionBlockParametersItem_BitwardenLoginCredential,
|
||||
ExtractionBlockParametersItem_BitwardenSensitiveInformation,
|
||||
ExtractionBlockParametersItem_Context,
|
||||
ExtractionBlockParametersItem_Output,
|
||||
ExtractionBlockParametersItem_Workflow,
|
||||
FileDownloadBlock,
|
||||
FileDownloadBlockDataSchema,
|
||||
FileDownloadBlockParametersItem,
|
||||
FileDownloadBlockParametersItem_AwsSecret,
|
||||
FileDownloadBlockParametersItem_BitwardenCreditCardData,
|
||||
FileDownloadBlockParametersItem_BitwardenLoginCredential,
|
||||
FileDownloadBlockParametersItem_BitwardenSensitiveInformation,
|
||||
FileDownloadBlockParametersItem_Context,
|
||||
FileDownloadBlockParametersItem_Output,
|
||||
FileDownloadBlockParametersItem_Workflow,
|
||||
FileParserBlock,
|
||||
FileType,
|
||||
ForLoopBlock,
|
||||
ForLoopBlockLoopBlocksItem,
|
||||
ForLoopBlockLoopBlocksItem_Action,
|
||||
ForLoopBlockLoopBlocksItem_Code,
|
||||
ForLoopBlockLoopBlocksItem_DownloadToS3,
|
||||
ForLoopBlockLoopBlocksItem_Extraction,
|
||||
ForLoopBlockLoopBlocksItem_FileDownload,
|
||||
ForLoopBlockLoopBlocksItem_FileUrlParser,
|
||||
ForLoopBlockLoopBlocksItem_ForLoop,
|
||||
ForLoopBlockLoopBlocksItem_GotoUrl,
|
||||
ForLoopBlockLoopBlocksItem_Login,
|
||||
ForLoopBlockLoopBlocksItem_Navigation,
|
||||
ForLoopBlockLoopBlocksItem_PdfParser,
|
||||
ForLoopBlockLoopBlocksItem_SendEmail,
|
||||
ForLoopBlockLoopBlocksItem_Task,
|
||||
ForLoopBlockLoopBlocksItem_TaskV2,
|
||||
ForLoopBlockLoopBlocksItem_TextPrompt,
|
||||
ForLoopBlockLoopBlocksItem_UploadToS3,
|
||||
ForLoopBlockLoopBlocksItem_Validation,
|
||||
ForLoopBlockLoopBlocksItem_Wait,
|
||||
ForLoopBlockLoopOver,
|
||||
ForLoopBlockLoopOver_AwsSecret,
|
||||
ForLoopBlockLoopOver_BitwardenCreditCardData,
|
||||
ForLoopBlockLoopOver_BitwardenLoginCredential,
|
||||
ForLoopBlockLoopOver_BitwardenSensitiveInformation,
|
||||
ForLoopBlockLoopOver_Context,
|
||||
ForLoopBlockLoopOver_Output,
|
||||
ForLoopBlockLoopOver_Workflow,
|
||||
GetOrganizationApiKeysResponse,
|
||||
GetOrganizationsResponse,
|
||||
HttpValidationError,
|
||||
LoginBlock,
|
||||
LoginBlockDataSchema,
|
||||
LoginBlockParametersItem,
|
||||
LoginBlockParametersItem_AwsSecret,
|
||||
LoginBlockParametersItem_BitwardenCreditCardData,
|
||||
LoginBlockParametersItem_BitwardenLoginCredential,
|
||||
LoginBlockParametersItem_BitwardenSensitiveInformation,
|
||||
LoginBlockParametersItem_Context,
|
||||
LoginBlockParametersItem_Output,
|
||||
LoginBlockParametersItem_Workflow,
|
||||
NavigationBlock,
|
||||
NavigationBlockDataSchema,
|
||||
NavigationBlockParametersItem,
|
||||
NavigationBlockParametersItem_AwsSecret,
|
||||
NavigationBlockParametersItem_BitwardenCreditCardData,
|
||||
NavigationBlockParametersItem_BitwardenLoginCredential,
|
||||
NavigationBlockParametersItem_BitwardenSensitiveInformation,
|
||||
NavigationBlockParametersItem_Context,
|
||||
NavigationBlockParametersItem_Output,
|
||||
NavigationBlockParametersItem_Workflow,
|
||||
ObserverTask,
|
||||
ObserverTaskOutput,
|
||||
ObserverTaskStatus,
|
||||
ObserverThought,
|
||||
ObserverThoughtScenario,
|
||||
ObserverThoughtType,
|
||||
OrderBy,
|
||||
Organization,
|
||||
OrganizationAuthToken,
|
||||
OrganizationAuthTokenType,
|
||||
OutputParameter,
|
||||
PdfParserBlock,
|
||||
ProxyLocation,
|
||||
RunWorkflowResponse,
|
||||
SelectOption,
|
||||
SendEmailBlock,
|
||||
SortDirection,
|
||||
Step,
|
||||
StepStatus,
|
||||
Task,
|
||||
TaskBase,
|
||||
TaskBaseExtractedInformationSchema,
|
||||
TaskBaseNavigationPayload,
|
||||
TaskBlock,
|
||||
TaskBlockDataSchema,
|
||||
TaskBlockParametersItem,
|
||||
TaskBlockParametersItem_AwsSecret,
|
||||
TaskBlockParametersItem_BitwardenCreditCardData,
|
||||
TaskBlockParametersItem_BitwardenLoginCredential,
|
||||
TaskBlockParametersItem_BitwardenSensitiveInformation,
|
||||
TaskBlockParametersItem_Context,
|
||||
TaskBlockParametersItem_Output,
|
||||
TaskBlockParametersItem_Workflow,
|
||||
TaskExtractedInformation,
|
||||
TaskExtractedInformationSchema,
|
||||
TaskGeneration,
|
||||
TaskNavigationPayload,
|
||||
TaskResponse,
|
||||
TaskResponseExtractedInformation,
|
||||
TaskStatus,
|
||||
TaskType,
|
||||
TaskV2Block,
|
||||
TextPromptBlock,
|
||||
TextPromptBlockParametersItem,
|
||||
TextPromptBlockParametersItem_AwsSecret,
|
||||
TextPromptBlockParametersItem_BitwardenCreditCardData,
|
||||
TextPromptBlockParametersItem_BitwardenLoginCredential,
|
||||
TextPromptBlockParametersItem_BitwardenSensitiveInformation,
|
||||
TextPromptBlockParametersItem_Context,
|
||||
TextPromptBlockParametersItem_Output,
|
||||
TextPromptBlockParametersItem_Workflow,
|
||||
TotpCode,
|
||||
UploadToS3Block,
|
||||
UrlBlock,
|
||||
UrlBlockDataSchema,
|
||||
UrlBlockParametersItem,
|
||||
UrlBlockParametersItem_AwsSecret,
|
||||
UrlBlockParametersItem_BitwardenCreditCardData,
|
||||
UrlBlockParametersItem_BitwardenLoginCredential,
|
||||
UrlBlockParametersItem_BitwardenSensitiveInformation,
|
||||
UrlBlockParametersItem_Context,
|
||||
UrlBlockParametersItem_Output,
|
||||
UrlBlockParametersItem_Workflow,
|
||||
UserDefinedError,
|
||||
ValidationBlock,
|
||||
ValidationBlockDataSchema,
|
||||
ValidationBlockParametersItem,
|
||||
ValidationBlockParametersItem_AwsSecret,
|
||||
ValidationBlockParametersItem_BitwardenCreditCardData,
|
||||
ValidationBlockParametersItem_BitwardenLoginCredential,
|
||||
ValidationBlockParametersItem_BitwardenSensitiveInformation,
|
||||
ValidationBlockParametersItem_Context,
|
||||
ValidationBlockParametersItem_Output,
|
||||
ValidationBlockParametersItem_Workflow,
|
||||
ValidationError,
|
||||
ValidationErrorLocItem,
|
||||
WaitBlock,
|
||||
WaitBlockParametersItem,
|
||||
WaitBlockParametersItem_AwsSecret,
|
||||
WaitBlockParametersItem_BitwardenCreditCardData,
|
||||
WaitBlockParametersItem_BitwardenLoginCredential,
|
||||
WaitBlockParametersItem_BitwardenSensitiveInformation,
|
||||
WaitBlockParametersItem_Context,
|
||||
WaitBlockParametersItem_Output,
|
||||
WaitBlockParametersItem_Workflow,
|
||||
Workflow,
|
||||
WorkflowDefinition,
|
||||
WorkflowDefinitionBlocksItem,
|
||||
WorkflowDefinitionBlocksItem_Action,
|
||||
WorkflowDefinitionBlocksItem_Code,
|
||||
WorkflowDefinitionBlocksItem_DownloadToS3,
|
||||
WorkflowDefinitionBlocksItem_Extraction,
|
||||
WorkflowDefinitionBlocksItem_FileDownload,
|
||||
WorkflowDefinitionBlocksItem_FileUrlParser,
|
||||
WorkflowDefinitionBlocksItem_ForLoop,
|
||||
WorkflowDefinitionBlocksItem_GotoUrl,
|
||||
WorkflowDefinitionBlocksItem_Login,
|
||||
WorkflowDefinitionBlocksItem_Navigation,
|
||||
WorkflowDefinitionBlocksItem_PdfParser,
|
||||
WorkflowDefinitionBlocksItem_SendEmail,
|
||||
WorkflowDefinitionBlocksItem_Task,
|
||||
WorkflowDefinitionBlocksItem_TaskV2,
|
||||
WorkflowDefinitionBlocksItem_TextPrompt,
|
||||
WorkflowDefinitionBlocksItem_UploadToS3,
|
||||
WorkflowDefinitionBlocksItem_Validation,
|
||||
WorkflowDefinitionBlocksItem_Wait,
|
||||
WorkflowDefinitionParametersItem,
|
||||
WorkflowDefinitionParametersItem_AwsSecret,
|
||||
WorkflowDefinitionParametersItem_BitwardenCreditCardData,
|
||||
WorkflowDefinitionParametersItem_BitwardenLoginCredential,
|
||||
WorkflowDefinitionParametersItem_BitwardenSensitiveInformation,
|
||||
WorkflowDefinitionParametersItem_Context,
|
||||
WorkflowDefinitionParametersItem_Output,
|
||||
WorkflowDefinitionParametersItem_Workflow,
|
||||
WorkflowParameter,
|
||||
WorkflowParameterDefaultValue,
|
||||
WorkflowParameterType,
|
||||
WorkflowRun,
|
||||
WorkflowRunBlock,
|
||||
WorkflowRunBlockDataSchema,
|
||||
WorkflowRunBlockNavigationPayload,
|
||||
WorkflowRunBlockOutput,
|
||||
WorkflowRunStatus,
|
||||
WorkflowRunStatusResponse,
|
||||
WorkflowRunTimeline,
|
||||
WorkflowRunTimelineType,
|
||||
WorkflowStatus,
|
||||
)
|
||||
from .errors import UnprocessableEntityError
|
||||
from . import agent, server
|
||||
from .agent import TaskRequestExtractedInformationSchema, TaskRequestNavigationPayload
|
||||
from .client import AsyncSkyvern, Skyvern
|
||||
from .environment import SkyvernEnvironment
|
||||
from .version import __version__
|
||||
|
||||
__all__ = [
|
||||
"Action",
|
||||
"ActionBlock",
|
||||
"ActionBlockDataSchema",
|
||||
"ActionBlockParametersItem",
|
||||
"ActionBlockParametersItem_AwsSecret",
|
||||
"ActionBlockParametersItem_BitwardenCreditCardData",
|
||||
"ActionBlockParametersItem_BitwardenLoginCredential",
|
||||
"ActionBlockParametersItem_BitwardenSensitiveInformation",
|
||||
"ActionBlockParametersItem_Context",
|
||||
"ActionBlockParametersItem_Output",
|
||||
"ActionBlockParametersItem_Workflow",
|
||||
"ActionResult",
|
||||
"ActionResultData",
|
||||
"ActionStatus",
|
||||
"ActionType",
|
||||
"AgentStepOutput",
|
||||
"AiSuggestionBase",
|
||||
"AiSuggestionBaseOutput",
|
||||
"AiSuggestionType",
|
||||
"Artifact",
|
||||
"ArtifactType",
|
||||
"AsyncSkyvern",
|
||||
"AwsSecretParameter",
|
||||
"BitwardenCreditCardDataParameter",
|
||||
"BitwardenLoginCredentialParameter",
|
||||
"BitwardenSensitiveInformationParameter",
|
||||
"BlockType",
|
||||
"BrowserSessionResponse",
|
||||
"CodeBlock",
|
||||
"CodeBlockParametersItem",
|
||||
"CodeBlockParametersItem_AwsSecret",
|
||||
"CodeBlockParametersItem_BitwardenCreditCardData",
|
||||
"CodeBlockParametersItem_BitwardenLoginCredential",
|
||||
"CodeBlockParametersItem_BitwardenSensitiveInformation",
|
||||
"CodeBlockParametersItem_Context",
|
||||
"CodeBlockParametersItem_Output",
|
||||
"CodeBlockParametersItem_Workflow",
|
||||
"ContextParameter",
|
||||
"ContextParameterSource",
|
||||
"ContextParameterSource_AwsSecret",
|
||||
"ContextParameterSource_BitwardenCreditCardData",
|
||||
"ContextParameterSource_BitwardenLoginCredential",
|
||||
"ContextParameterSource_BitwardenSensitiveInformation",
|
||||
"ContextParameterSource_Context",
|
||||
"ContextParameterSource_Output",
|
||||
"ContextParameterSource_Workflow",
|
||||
"ContextParameterValue",
|
||||
"CreateTaskResponse",
|
||||
"DownloadToS3Block",
|
||||
"EntityType",
|
||||
"ExtractionBlock",
|
||||
"ExtractionBlockDataSchema",
|
||||
"ExtractionBlockParametersItem",
|
||||
"ExtractionBlockParametersItem_AwsSecret",
|
||||
"ExtractionBlockParametersItem_BitwardenCreditCardData",
|
||||
"ExtractionBlockParametersItem_BitwardenLoginCredential",
|
||||
"ExtractionBlockParametersItem_BitwardenSensitiveInformation",
|
||||
"ExtractionBlockParametersItem_Context",
|
||||
"ExtractionBlockParametersItem_Output",
|
||||
"ExtractionBlockParametersItem_Workflow",
|
||||
"FileDownloadBlock",
|
||||
"FileDownloadBlockDataSchema",
|
||||
"FileDownloadBlockParametersItem",
|
||||
"FileDownloadBlockParametersItem_AwsSecret",
|
||||
"FileDownloadBlockParametersItem_BitwardenCreditCardData",
|
||||
"FileDownloadBlockParametersItem_BitwardenLoginCredential",
|
||||
"FileDownloadBlockParametersItem_BitwardenSensitiveInformation",
|
||||
"FileDownloadBlockParametersItem_Context",
|
||||
"FileDownloadBlockParametersItem_Output",
|
||||
"FileDownloadBlockParametersItem_Workflow",
|
||||
"FileParserBlock",
|
||||
"FileType",
|
||||
"ForLoopBlock",
|
||||
"ForLoopBlockLoopBlocksItem",
|
||||
"ForLoopBlockLoopBlocksItem_Action",
|
||||
"ForLoopBlockLoopBlocksItem_Code",
|
||||
"ForLoopBlockLoopBlocksItem_DownloadToS3",
|
||||
"ForLoopBlockLoopBlocksItem_Extraction",
|
||||
"ForLoopBlockLoopBlocksItem_FileDownload",
|
||||
"ForLoopBlockLoopBlocksItem_FileUrlParser",
|
||||
"ForLoopBlockLoopBlocksItem_ForLoop",
|
||||
"ForLoopBlockLoopBlocksItem_GotoUrl",
|
||||
"ForLoopBlockLoopBlocksItem_Login",
|
||||
"ForLoopBlockLoopBlocksItem_Navigation",
|
||||
"ForLoopBlockLoopBlocksItem_PdfParser",
|
||||
"ForLoopBlockLoopBlocksItem_SendEmail",
|
||||
"ForLoopBlockLoopBlocksItem_Task",
|
||||
"ForLoopBlockLoopBlocksItem_TaskV2",
|
||||
"ForLoopBlockLoopBlocksItem_TextPrompt",
|
||||
"ForLoopBlockLoopBlocksItem_UploadToS3",
|
||||
"ForLoopBlockLoopBlocksItem_Validation",
|
||||
"ForLoopBlockLoopBlocksItem_Wait",
|
||||
"ForLoopBlockLoopOver",
|
||||
"ForLoopBlockLoopOver_AwsSecret",
|
||||
"ForLoopBlockLoopOver_BitwardenCreditCardData",
|
||||
"ForLoopBlockLoopOver_BitwardenLoginCredential",
|
||||
"ForLoopBlockLoopOver_BitwardenSensitiveInformation",
|
||||
"ForLoopBlockLoopOver_Context",
|
||||
"ForLoopBlockLoopOver_Output",
|
||||
"ForLoopBlockLoopOver_Workflow",
|
||||
"GetOrganizationApiKeysResponse",
|
||||
"GetOrganizationsResponse",
|
||||
"HttpValidationError",
|
||||
"LoginBlock",
|
||||
"LoginBlockDataSchema",
|
||||
"LoginBlockParametersItem",
|
||||
"LoginBlockParametersItem_AwsSecret",
|
||||
"LoginBlockParametersItem_BitwardenCreditCardData",
|
||||
"LoginBlockParametersItem_BitwardenLoginCredential",
|
||||
"LoginBlockParametersItem_BitwardenSensitiveInformation",
|
||||
"LoginBlockParametersItem_Context",
|
||||
"LoginBlockParametersItem_Output",
|
||||
"LoginBlockParametersItem_Workflow",
|
||||
"NavigationBlock",
|
||||
"NavigationBlockDataSchema",
|
||||
"NavigationBlockParametersItem",
|
||||
"NavigationBlockParametersItem_AwsSecret",
|
||||
"NavigationBlockParametersItem_BitwardenCreditCardData",
|
||||
"NavigationBlockParametersItem_BitwardenLoginCredential",
|
||||
"NavigationBlockParametersItem_BitwardenSensitiveInformation",
|
||||
"NavigationBlockParametersItem_Context",
|
||||
"NavigationBlockParametersItem_Output",
|
||||
"NavigationBlockParametersItem_Workflow",
|
||||
"ObserverTask",
|
||||
"ObserverTaskOutput",
|
||||
"ObserverTaskStatus",
|
||||
"ObserverThought",
|
||||
"ObserverThoughtScenario",
|
||||
"ObserverThoughtType",
|
||||
"OrderBy",
|
||||
"Organization",
|
||||
"OrganizationAuthToken",
|
||||
"OrganizationAuthTokenType",
|
||||
"OutputParameter",
|
||||
"PdfParserBlock",
|
||||
"ProxyLocation",
|
||||
"RunWorkflowResponse",
|
||||
"SelectOption",
|
||||
"SendEmailBlock",
|
||||
"Skyvern",
|
||||
"SkyvernEnvironment",
|
||||
"SortDirection",
|
||||
"Step",
|
||||
"StepStatus",
|
||||
"Task",
|
||||
"TaskBase",
|
||||
"TaskBaseExtractedInformationSchema",
|
||||
"TaskBaseNavigationPayload",
|
||||
"TaskBlock",
|
||||
"TaskBlockDataSchema",
|
||||
"TaskBlockParametersItem",
|
||||
"TaskBlockParametersItem_AwsSecret",
|
||||
"TaskBlockParametersItem_BitwardenCreditCardData",
|
||||
"TaskBlockParametersItem_BitwardenLoginCredential",
|
||||
"TaskBlockParametersItem_BitwardenSensitiveInformation",
|
||||
"TaskBlockParametersItem_Context",
|
||||
"TaskBlockParametersItem_Output",
|
||||
"TaskBlockParametersItem_Workflow",
|
||||
"TaskExtractedInformation",
|
||||
"TaskExtractedInformationSchema",
|
||||
"TaskGeneration",
|
||||
"TaskNavigationPayload",
|
||||
"TaskRequestExtractedInformationSchema",
|
||||
"TaskRequestNavigationPayload",
|
||||
"TaskResponse",
|
||||
"TaskResponseExtractedInformation",
|
||||
"TaskStatus",
|
||||
"TaskType",
|
||||
"TaskV2Block",
|
||||
"TextPromptBlock",
|
||||
"TextPromptBlockParametersItem",
|
||||
"TextPromptBlockParametersItem_AwsSecret",
|
||||
"TextPromptBlockParametersItem_BitwardenCreditCardData",
|
||||
"TextPromptBlockParametersItem_BitwardenLoginCredential",
|
||||
"TextPromptBlockParametersItem_BitwardenSensitiveInformation",
|
||||
"TextPromptBlockParametersItem_Context",
|
||||
"TextPromptBlockParametersItem_Output",
|
||||
"TextPromptBlockParametersItem_Workflow",
|
||||
"TotpCode",
|
||||
"UnprocessableEntityError",
|
||||
"UploadToS3Block",
|
||||
"UrlBlock",
|
||||
"UrlBlockDataSchema",
|
||||
"UrlBlockParametersItem",
|
||||
"UrlBlockParametersItem_AwsSecret",
|
||||
"UrlBlockParametersItem_BitwardenCreditCardData",
|
||||
"UrlBlockParametersItem_BitwardenLoginCredential",
|
||||
"UrlBlockParametersItem_BitwardenSensitiveInformation",
|
||||
"UrlBlockParametersItem_Context",
|
||||
"UrlBlockParametersItem_Output",
|
||||
"UrlBlockParametersItem_Workflow",
|
||||
"UserDefinedError",
|
||||
"ValidationBlock",
|
||||
"ValidationBlockDataSchema",
|
||||
"ValidationBlockParametersItem",
|
||||
"ValidationBlockParametersItem_AwsSecret",
|
||||
"ValidationBlockParametersItem_BitwardenCreditCardData",
|
||||
"ValidationBlockParametersItem_BitwardenLoginCredential",
|
||||
"ValidationBlockParametersItem_BitwardenSensitiveInformation",
|
||||
"ValidationBlockParametersItem_Context",
|
||||
"ValidationBlockParametersItem_Output",
|
||||
"ValidationBlockParametersItem_Workflow",
|
||||
"ValidationError",
|
||||
"ValidationErrorLocItem",
|
||||
"WaitBlock",
|
||||
"WaitBlockParametersItem",
|
||||
"WaitBlockParametersItem_AwsSecret",
|
||||
"WaitBlockParametersItem_BitwardenCreditCardData",
|
||||
"WaitBlockParametersItem_BitwardenLoginCredential",
|
||||
"WaitBlockParametersItem_BitwardenSensitiveInformation",
|
||||
"WaitBlockParametersItem_Context",
|
||||
"WaitBlockParametersItem_Output",
|
||||
"WaitBlockParametersItem_Workflow",
|
||||
"Workflow",
|
||||
"WorkflowDefinition",
|
||||
"WorkflowDefinitionBlocksItem",
|
||||
"WorkflowDefinitionBlocksItem_Action",
|
||||
"WorkflowDefinitionBlocksItem_Code",
|
||||
"WorkflowDefinitionBlocksItem_DownloadToS3",
|
||||
"WorkflowDefinitionBlocksItem_Extraction",
|
||||
"WorkflowDefinitionBlocksItem_FileDownload",
|
||||
"WorkflowDefinitionBlocksItem_FileUrlParser",
|
||||
"WorkflowDefinitionBlocksItem_ForLoop",
|
||||
"WorkflowDefinitionBlocksItem_GotoUrl",
|
||||
"WorkflowDefinitionBlocksItem_Login",
|
||||
"WorkflowDefinitionBlocksItem_Navigation",
|
||||
"WorkflowDefinitionBlocksItem_PdfParser",
|
||||
"WorkflowDefinitionBlocksItem_SendEmail",
|
||||
"WorkflowDefinitionBlocksItem_Task",
|
||||
"WorkflowDefinitionBlocksItem_TaskV2",
|
||||
"WorkflowDefinitionBlocksItem_TextPrompt",
|
||||
"WorkflowDefinitionBlocksItem_UploadToS3",
|
||||
"WorkflowDefinitionBlocksItem_Validation",
|
||||
"WorkflowDefinitionBlocksItem_Wait",
|
||||
"WorkflowDefinitionParametersItem",
|
||||
"WorkflowDefinitionParametersItem_AwsSecret",
|
||||
"WorkflowDefinitionParametersItem_BitwardenCreditCardData",
|
||||
"WorkflowDefinitionParametersItem_BitwardenLoginCredential",
|
||||
"WorkflowDefinitionParametersItem_BitwardenSensitiveInformation",
|
||||
"WorkflowDefinitionParametersItem_Context",
|
||||
"WorkflowDefinitionParametersItem_Output",
|
||||
"WorkflowDefinitionParametersItem_Workflow",
|
||||
"WorkflowParameter",
|
||||
"WorkflowParameterDefaultValue",
|
||||
"WorkflowParameterType",
|
||||
"WorkflowRun",
|
||||
"WorkflowRunBlock",
|
||||
"WorkflowRunBlockDataSchema",
|
||||
"WorkflowRunBlockNavigationPayload",
|
||||
"WorkflowRunBlockOutput",
|
||||
"WorkflowRunStatus",
|
||||
"WorkflowRunStatusResponse",
|
||||
"WorkflowRunTimeline",
|
||||
"WorkflowRunTimelineType",
|
||||
"WorkflowStatus",
|
||||
"__version__",
|
||||
"agent",
|
||||
"server",
|
||||
]
|
||||
5
skyvern/client/agent/__init__.py
Normal file
5
skyvern/client/agent/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from .types import TaskRequestExtractedInformationSchema, TaskRequestNavigationPayload
|
||||
|
||||
__all__ = ["TaskRequestExtractedInformationSchema", "TaskRequestNavigationPayload"]
|
||||
8327
skyvern/client/agent/client.py
Normal file
8327
skyvern/client/agent/client.py
Normal file
File diff suppressed because it is too large
Load Diff
6
skyvern/client/agent/types/__init__.py
Normal file
6
skyvern/client/agent/types/__init__.py
Normal file
@@ -0,0 +1,6 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from .task_request_extracted_information_schema import TaskRequestExtractedInformationSchema
|
||||
from .task_request_navigation_payload import TaskRequestNavigationPayload
|
||||
|
||||
__all__ = ["TaskRequestExtractedInformationSchema", "TaskRequestNavigationPayload"]
|
||||
@@ -0,0 +1,7 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
TaskRequestExtractedInformationSchema = typing.Union[
|
||||
typing.Dict[str, typing.Optional[typing.Any]], typing.List[typing.Optional[typing.Any]], str
|
||||
]
|
||||
@@ -0,0 +1,7 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
TaskRequestNavigationPayload = typing.Union[
|
||||
typing.Dict[str, typing.Optional[typing.Any]], typing.List[typing.Optional[typing.Any]], str
|
||||
]
|
||||
134
skyvern/client/client.py
Normal file
134
skyvern/client/client.py
Normal file
@@ -0,0 +1,134 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
from .environment import SkyvernEnvironment
|
||||
import httpx
|
||||
from .core.client_wrapper import SyncClientWrapper
|
||||
from .server.client import ServerClient
|
||||
from .agent.client import AgentClient
|
||||
from .core.client_wrapper import AsyncClientWrapper
|
||||
from .server.client import AsyncServerClient
|
||||
from .agent.client import AsyncAgentClient
|
||||
|
||||
|
||||
class Skyvern:
|
||||
"""
|
||||
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
base_url : typing.Optional[str]
|
||||
The base url to use for requests from the client.
|
||||
|
||||
environment : SkyvernEnvironment
|
||||
The environment to use for requests from the client. from .environment import SkyvernEnvironment
|
||||
|
||||
|
||||
|
||||
Defaults to SkyvernEnvironment.PRODUCTION
|
||||
|
||||
|
||||
|
||||
timeout : typing.Optional[float]
|
||||
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
|
||||
|
||||
follow_redirects : typing.Optional[bool]
|
||||
Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
|
||||
|
||||
httpx_client : typing.Optional[httpx.Client]
|
||||
The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
|
||||
|
||||
Examples
|
||||
--------
|
||||
from skyverndocs import Skyvern
|
||||
|
||||
client = Skyvern()
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
base_url: typing.Optional[str] = None,
|
||||
environment: SkyvernEnvironment = SkyvernEnvironment.PRODUCTION,
|
||||
timeout: typing.Optional[float] = None,
|
||||
follow_redirects: typing.Optional[bool] = True,
|
||||
httpx_client: typing.Optional[httpx.Client] = None,
|
||||
):
|
||||
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
|
||||
self._client_wrapper = SyncClientWrapper(
|
||||
base_url=_get_base_url(base_url=base_url, environment=environment),
|
||||
httpx_client=httpx_client
|
||||
if httpx_client is not None
|
||||
else httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
|
||||
if follow_redirects is not None
|
||||
else httpx.Client(timeout=_defaulted_timeout),
|
||||
timeout=_defaulted_timeout,
|
||||
)
|
||||
self.server = ServerClient(client_wrapper=self._client_wrapper)
|
||||
self.agent = AgentClient(client_wrapper=self._client_wrapper)
|
||||
|
||||
|
||||
class AsyncSkyvern:
|
||||
"""
|
||||
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
base_url : typing.Optional[str]
|
||||
The base url to use for requests from the client.
|
||||
|
||||
environment : SkyvernEnvironment
|
||||
The environment to use for requests from the client. from .environment import SkyvernEnvironment
|
||||
|
||||
|
||||
|
||||
Defaults to SkyvernEnvironment.PRODUCTION
|
||||
|
||||
|
||||
|
||||
timeout : typing.Optional[float]
|
||||
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
|
||||
|
||||
follow_redirects : typing.Optional[bool]
|
||||
Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
|
||||
|
||||
httpx_client : typing.Optional[httpx.AsyncClient]
|
||||
The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
|
||||
|
||||
Examples
|
||||
--------
|
||||
from skyverndocs import AsyncSkyvern
|
||||
|
||||
client = AsyncSkyvern()
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
base_url: typing.Optional[str] = None,
|
||||
environment: SkyvernEnvironment = SkyvernEnvironment.PRODUCTION,
|
||||
timeout: typing.Optional[float] = None,
|
||||
follow_redirects: typing.Optional[bool] = True,
|
||||
httpx_client: typing.Optional[httpx.AsyncClient] = None,
|
||||
):
|
||||
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
|
||||
self._client_wrapper = AsyncClientWrapper(
|
||||
base_url=_get_base_url(base_url=base_url, environment=environment),
|
||||
httpx_client=httpx_client
|
||||
if httpx_client is not None
|
||||
else httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
|
||||
if follow_redirects is not None
|
||||
else httpx.AsyncClient(timeout=_defaulted_timeout),
|
||||
timeout=_defaulted_timeout,
|
||||
)
|
||||
self.server = AsyncServerClient(client_wrapper=self._client_wrapper)
|
||||
self.agent = AsyncAgentClient(client_wrapper=self._client_wrapper)
|
||||
|
||||
|
||||
def _get_base_url(*, base_url: typing.Optional[str] = None, environment: SkyvernEnvironment) -> str:
|
||||
if base_url is not None:
|
||||
return base_url
|
||||
elif environment is not None:
|
||||
return environment.value
|
||||
else:
|
||||
raise Exception("Please pass in either base_url or environment to construct the client")
|
||||
47
skyvern/client/core/__init__.py
Normal file
47
skyvern/client/core/__init__.py
Normal file
@@ -0,0 +1,47 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from .api_error import ApiError
|
||||
from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper
|
||||
from .datetime_utils import serialize_datetime
|
||||
from .file import File, convert_file_dict_to_httpx_tuples, with_content_type
|
||||
from .http_client import AsyncHttpClient, HttpClient
|
||||
from .jsonable_encoder import jsonable_encoder
|
||||
from .pydantic_utilities import (
|
||||
IS_PYDANTIC_V2,
|
||||
UniversalBaseModel,
|
||||
UniversalRootModel,
|
||||
parse_obj_as,
|
||||
universal_field_validator,
|
||||
universal_root_validator,
|
||||
update_forward_refs,
|
||||
)
|
||||
from .query_encoder import encode_query
|
||||
from .remove_none_from_dict import remove_none_from_dict
|
||||
from .request_options import RequestOptions
|
||||
from .serialization import FieldMetadata, convert_and_respect_annotation_metadata
|
||||
|
||||
__all__ = [
|
||||
"ApiError",
|
||||
"AsyncClientWrapper",
|
||||
"AsyncHttpClient",
|
||||
"BaseClientWrapper",
|
||||
"FieldMetadata",
|
||||
"File",
|
||||
"HttpClient",
|
||||
"IS_PYDANTIC_V2",
|
||||
"RequestOptions",
|
||||
"SyncClientWrapper",
|
||||
"UniversalBaseModel",
|
||||
"UniversalRootModel",
|
||||
"convert_and_respect_annotation_metadata",
|
||||
"convert_file_dict_to_httpx_tuples",
|
||||
"encode_query",
|
||||
"jsonable_encoder",
|
||||
"parse_obj_as",
|
||||
"remove_none_from_dict",
|
||||
"serialize_datetime",
|
||||
"universal_field_validator",
|
||||
"universal_root_validator",
|
||||
"update_forward_refs",
|
||||
"with_content_type",
|
||||
]
|
||||
15
skyvern/client/core/api_error.py
Normal file
15
skyvern/client/core/api_error.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
|
||||
class ApiError(Exception):
|
||||
status_code: typing.Optional[int]
|
||||
body: typing.Any
|
||||
|
||||
def __init__(self, *, status_code: typing.Optional[int] = None, body: typing.Any = None):
|
||||
self.status_code = status_code
|
||||
self.body = body
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"status_code: {self.status_code}, body: {self.body}"
|
||||
48
skyvern/client/core/client_wrapper.py
Normal file
48
skyvern/client/core/client_wrapper.py
Normal file
@@ -0,0 +1,48 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
import httpx
|
||||
from .http_client import HttpClient
|
||||
from .http_client import AsyncHttpClient
|
||||
|
||||
|
||||
class BaseClientWrapper:
|
||||
def __init__(self, *, base_url: str, timeout: typing.Optional[float] = None):
|
||||
self._base_url = base_url
|
||||
self._timeout = timeout
|
||||
|
||||
def get_headers(self) -> typing.Dict[str, str]:
|
||||
headers: typing.Dict[str, str] = {
|
||||
"X-Fern-Language": "Python",
|
||||
"X-Fern-SDK-Name": "skyvern",
|
||||
"X-Fern-SDK-Version": "0.1.56",
|
||||
}
|
||||
return headers
|
||||
|
||||
def get_base_url(self) -> str:
|
||||
return self._base_url
|
||||
|
||||
def get_timeout(self) -> typing.Optional[float]:
|
||||
return self._timeout
|
||||
|
||||
|
||||
class SyncClientWrapper(BaseClientWrapper):
|
||||
def __init__(self, *, base_url: str, timeout: typing.Optional[float] = None, httpx_client: httpx.Client):
|
||||
super().__init__(base_url=base_url, timeout=timeout)
|
||||
self.httpx_client = HttpClient(
|
||||
httpx_client=httpx_client,
|
||||
base_headers=self.get_headers,
|
||||
base_timeout=self.get_timeout,
|
||||
base_url=self.get_base_url,
|
||||
)
|
||||
|
||||
|
||||
class AsyncClientWrapper(BaseClientWrapper):
|
||||
def __init__(self, *, base_url: str, timeout: typing.Optional[float] = None, httpx_client: httpx.AsyncClient):
|
||||
super().__init__(base_url=base_url, timeout=timeout)
|
||||
self.httpx_client = AsyncHttpClient(
|
||||
httpx_client=httpx_client,
|
||||
base_headers=self.get_headers,
|
||||
base_timeout=self.get_timeout,
|
||||
base_url=self.get_base_url,
|
||||
)
|
||||
28
skyvern/client/core/datetime_utils.py
Normal file
28
skyvern/client/core/datetime_utils.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import datetime as dt
|
||||
|
||||
|
||||
def serialize_datetime(v: dt.datetime) -> str:
|
||||
"""
|
||||
Serialize a datetime including timezone info.
|
||||
|
||||
Uses the timezone info provided if present, otherwise uses the current runtime's timezone info.
|
||||
|
||||
UTC datetimes end in "Z" while all other timezones are represented as offset from UTC, e.g. +05:00.
|
||||
"""
|
||||
|
||||
def _serialize_zoned_datetime(v: dt.datetime) -> str:
|
||||
if v.tzinfo is not None and v.tzinfo.tzname(None) == dt.timezone.utc.tzname(None):
|
||||
# UTC is a special case where we use "Z" at the end instead of "+00:00"
|
||||
return v.isoformat().replace("+00:00", "Z")
|
||||
else:
|
||||
# Delegate to the typical +/- offset format
|
||||
return v.isoformat()
|
||||
|
||||
if v.tzinfo is not None:
|
||||
return _serialize_zoned_datetime(v)
|
||||
else:
|
||||
local_tz = dt.datetime.now().astimezone().tzinfo
|
||||
localized_dt = v.replace(tzinfo=local_tz)
|
||||
return _serialize_zoned_datetime(localized_dt)
|
||||
67
skyvern/client/core/file.py
Normal file
67
skyvern/client/core/file.py
Normal file
@@ -0,0 +1,67 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from typing import IO, Dict, List, Mapping, Optional, Tuple, Union, cast
|
||||
|
||||
# File typing inspired by the flexibility of types within the httpx library
|
||||
# https://github.com/encode/httpx/blob/master/httpx/_types.py
|
||||
FileContent = Union[IO[bytes], bytes, str]
|
||||
File = Union[
|
||||
# file (or bytes)
|
||||
FileContent,
|
||||
# (filename, file (or bytes))
|
||||
Tuple[Optional[str], FileContent],
|
||||
# (filename, file (or bytes), content_type)
|
||||
Tuple[Optional[str], FileContent, Optional[str]],
|
||||
# (filename, file (or bytes), content_type, headers)
|
||||
Tuple[
|
||||
Optional[str],
|
||||
FileContent,
|
||||
Optional[str],
|
||||
Mapping[str, str],
|
||||
],
|
||||
]
|
||||
|
||||
|
||||
def convert_file_dict_to_httpx_tuples(
|
||||
d: Dict[str, Union[File, List[File]]],
|
||||
) -> List[Tuple[str, File]]:
|
||||
"""
|
||||
The format we use is a list of tuples, where the first element is the
|
||||
name of the file and the second is the file object. Typically HTTPX wants
|
||||
a dict, but to be able to send lists of files, you have to use the list
|
||||
approach (which also works for non-lists)
|
||||
https://github.com/encode/httpx/pull/1032
|
||||
"""
|
||||
|
||||
httpx_tuples = []
|
||||
for key, file_like in d.items():
|
||||
if isinstance(file_like, list):
|
||||
for file_like_item in file_like:
|
||||
httpx_tuples.append((key, file_like_item))
|
||||
else:
|
||||
httpx_tuples.append((key, file_like))
|
||||
return httpx_tuples
|
||||
|
||||
|
||||
def with_content_type(*, file: File, default_content_type: str) -> File:
|
||||
"""
|
||||
This function resolves to the file's content type, if provided, and defaults
|
||||
to the default_content_type value if not.
|
||||
"""
|
||||
if isinstance(file, tuple):
|
||||
if len(file) == 2:
|
||||
filename, content = cast(Tuple[Optional[str], FileContent], file) # type: ignore
|
||||
return (filename, content, default_content_type)
|
||||
elif len(file) == 3:
|
||||
filename, content, file_content_type = cast(Tuple[Optional[str], FileContent, Optional[str]], file) # type: ignore
|
||||
out_content_type = file_content_type or default_content_type
|
||||
return (filename, content, out_content_type)
|
||||
elif len(file) == 4:
|
||||
filename, content, file_content_type, headers = cast( # type: ignore
|
||||
Tuple[Optional[str], FileContent, Optional[str], Mapping[str, str]], file
|
||||
)
|
||||
out_content_type = file_content_type or default_content_type
|
||||
return (filename, content, out_content_type, headers)
|
||||
else:
|
||||
raise ValueError(f"Unexpected tuple length: {len(file)}")
|
||||
return (None, file, default_content_type)
|
||||
499
skyvern/client/core/http_client.py
Normal file
499
skyvern/client/core/http_client.py
Normal file
@@ -0,0 +1,499 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import asyncio
|
||||
import email.utils
|
||||
import json
|
||||
import re
|
||||
import time
|
||||
import typing
|
||||
import urllib.parse
|
||||
from contextlib import asynccontextmanager, contextmanager
|
||||
from random import random
|
||||
|
||||
import httpx
|
||||
|
||||
from .file import File, convert_file_dict_to_httpx_tuples
|
||||
from .jsonable_encoder import jsonable_encoder
|
||||
from .query_encoder import encode_query
|
||||
from .remove_none_from_dict import remove_none_from_dict
|
||||
from .request_options import RequestOptions
|
||||
|
||||
INITIAL_RETRY_DELAY_SECONDS = 0.5
|
||||
MAX_RETRY_DELAY_SECONDS = 10
|
||||
MAX_RETRY_DELAY_SECONDS_FROM_HEADER = 30
|
||||
|
||||
|
||||
def _parse_retry_after(response_headers: httpx.Headers) -> typing.Optional[float]:
|
||||
"""
|
||||
This function parses the `Retry-After` header in a HTTP response and returns the number of seconds to wait.
|
||||
|
||||
Inspired by the urllib3 retry implementation.
|
||||
"""
|
||||
retry_after_ms = response_headers.get("retry-after-ms")
|
||||
if retry_after_ms is not None:
|
||||
try:
|
||||
return int(retry_after_ms) / 1000 if retry_after_ms > 0 else 0
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
retry_after = response_headers.get("retry-after")
|
||||
if retry_after is None:
|
||||
return None
|
||||
|
||||
# Attempt to parse the header as an int.
|
||||
if re.match(r"^\s*[0-9]+\s*$", retry_after):
|
||||
seconds = float(retry_after)
|
||||
# Fallback to parsing it as a date.
|
||||
else:
|
||||
retry_date_tuple = email.utils.parsedate_tz(retry_after)
|
||||
if retry_date_tuple is None:
|
||||
return None
|
||||
if retry_date_tuple[9] is None: # Python 2
|
||||
# Assume UTC if no timezone was specified
|
||||
# On Python2.7, parsedate_tz returns None for a timezone offset
|
||||
# instead of 0 if no timezone is given, where mktime_tz treats
|
||||
# a None timezone offset as local time.
|
||||
retry_date_tuple = retry_date_tuple[:9] + (0,) + retry_date_tuple[10:]
|
||||
|
||||
retry_date = email.utils.mktime_tz(retry_date_tuple)
|
||||
seconds = retry_date - time.time()
|
||||
|
||||
if seconds < 0:
|
||||
seconds = 0
|
||||
|
||||
return seconds
|
||||
|
||||
|
||||
def _retry_timeout(response: httpx.Response, retries: int) -> float:
|
||||
"""
|
||||
Determine the amount of time to wait before retrying a request.
|
||||
This function begins by trying to parse a retry-after header from the response, and then proceeds to use exponential backoff
|
||||
with a jitter to determine the number of seconds to wait.
|
||||
"""
|
||||
|
||||
# If the API asks us to wait a certain amount of time (and it's a reasonable amount), just do what it says.
|
||||
retry_after = _parse_retry_after(response.headers)
|
||||
if retry_after is not None and retry_after <= MAX_RETRY_DELAY_SECONDS_FROM_HEADER:
|
||||
return retry_after
|
||||
|
||||
# Apply exponential backoff, capped at MAX_RETRY_DELAY_SECONDS.
|
||||
retry_delay = min(INITIAL_RETRY_DELAY_SECONDS * pow(2.0, retries), MAX_RETRY_DELAY_SECONDS)
|
||||
|
||||
# Add a randomness / jitter to the retry delay to avoid overwhelming the server with retries.
|
||||
timeout = retry_delay * (1 - 0.25 * random())
|
||||
return timeout if timeout >= 0 else 0
|
||||
|
||||
|
||||
def _should_retry(response: httpx.Response) -> bool:
|
||||
retriable_400s = [429, 408, 409]
|
||||
return response.status_code >= 500 or response.status_code in retriable_400s
|
||||
|
||||
|
||||
def remove_omit_from_dict(
|
||||
original: typing.Dict[str, typing.Optional[typing.Any]],
|
||||
omit: typing.Optional[typing.Any],
|
||||
) -> typing.Dict[str, typing.Any]:
|
||||
if omit is None:
|
||||
return original
|
||||
new: typing.Dict[str, typing.Any] = {}
|
||||
for key, value in original.items():
|
||||
if value is not omit:
|
||||
new[key] = value
|
||||
return new
|
||||
|
||||
|
||||
def maybe_filter_request_body(
|
||||
data: typing.Optional[typing.Any],
|
||||
request_options: typing.Optional[RequestOptions],
|
||||
omit: typing.Optional[typing.Any],
|
||||
) -> typing.Optional[typing.Any]:
|
||||
if data is None:
|
||||
return (
|
||||
jsonable_encoder(request_options.get("additional_body_parameters", {})) or {}
|
||||
if request_options is not None
|
||||
else None
|
||||
)
|
||||
elif not isinstance(data, typing.Mapping):
|
||||
data_content = jsonable_encoder(data)
|
||||
else:
|
||||
data_content = {
|
||||
**(jsonable_encoder(remove_omit_from_dict(data, omit))), # type: ignore
|
||||
**(
|
||||
jsonable_encoder(request_options.get("additional_body_parameters", {})) or {}
|
||||
if request_options is not None
|
||||
else {}
|
||||
),
|
||||
}
|
||||
return data_content
|
||||
|
||||
|
||||
# Abstracted out for testing purposes
|
||||
def get_request_body(
|
||||
*,
|
||||
json: typing.Optional[typing.Any],
|
||||
data: typing.Optional[typing.Any],
|
||||
request_options: typing.Optional[RequestOptions],
|
||||
omit: typing.Optional[typing.Any],
|
||||
) -> typing.Tuple[typing.Optional[typing.Any], typing.Optional[typing.Any]]:
|
||||
json_body = None
|
||||
data_body = None
|
||||
if data is not None:
|
||||
data_body = maybe_filter_request_body(data, request_options, omit)
|
||||
else:
|
||||
# If both data and json are None, we send json data in the event extra properties are specified
|
||||
json_body = maybe_filter_request_body(json, request_options, omit)
|
||||
|
||||
# If you have an empty JSON body, you should just send None
|
||||
return (json_body if json_body != {} else None), data_body if data_body != {} else None
|
||||
|
||||
|
||||
class HttpClient:
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
httpx_client: httpx.Client,
|
||||
base_timeout: typing.Callable[[], typing.Optional[float]],
|
||||
base_headers: typing.Callable[[], typing.Dict[str, str]],
|
||||
base_url: typing.Optional[typing.Callable[[], str]] = None,
|
||||
):
|
||||
self.base_url = base_url
|
||||
self.base_timeout = base_timeout
|
||||
self.base_headers = base_headers
|
||||
self.httpx_client = httpx_client
|
||||
|
||||
def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str:
|
||||
base_url = maybe_base_url
|
||||
if self.base_url is not None and base_url is None:
|
||||
base_url = self.base_url()
|
||||
|
||||
if base_url is None:
|
||||
raise ValueError("A base_url is required to make this request, please provide one and try again.")
|
||||
return base_url
|
||||
|
||||
def request(
|
||||
self,
|
||||
path: typing.Optional[str] = None,
|
||||
*,
|
||||
method: str,
|
||||
base_url: typing.Optional[str] = None,
|
||||
params: typing.Optional[typing.Dict[str, typing.Any]] = None,
|
||||
json: typing.Optional[typing.Any] = None,
|
||||
data: typing.Optional[typing.Any] = None,
|
||||
content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None,
|
||||
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
|
||||
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
|
||||
request_options: typing.Optional[RequestOptions] = None,
|
||||
retries: int = 0,
|
||||
omit: typing.Optional[typing.Any] = None,
|
||||
) -> httpx.Response:
|
||||
base_url = self.get_base_url(base_url)
|
||||
timeout = (
|
||||
request_options.get("timeout_in_seconds")
|
||||
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
||||
else self.base_timeout()
|
||||
)
|
||||
|
||||
json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit)
|
||||
|
||||
response = self.httpx_client.request(
|
||||
method=method,
|
||||
url=urllib.parse.urljoin(f"{base_url}/", path),
|
||||
headers=jsonable_encoder(
|
||||
remove_none_from_dict(
|
||||
{
|
||||
**self.base_headers(),
|
||||
**(headers if headers is not None else {}),
|
||||
**(request_options.get("additional_headers", {}) or {} if request_options is not None else {}),
|
||||
}
|
||||
)
|
||||
),
|
||||
params=encode_query(
|
||||
jsonable_encoder(
|
||||
remove_none_from_dict(
|
||||
remove_omit_from_dict(
|
||||
{
|
||||
**(params if params is not None else {}),
|
||||
**(
|
||||
request_options.get("additional_query_parameters", {}) or {}
|
||||
if request_options is not None
|
||||
else {}
|
||||
),
|
||||
},
|
||||
omit,
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
json=json_body,
|
||||
data=data_body,
|
||||
content=content,
|
||||
files=(
|
||||
convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit))
|
||||
if (files is not None and files is not omit)
|
||||
else None
|
||||
),
|
||||
timeout=timeout,
|
||||
)
|
||||
|
||||
max_retries: int = request_options.get("max_retries", 0) if request_options is not None else 0
|
||||
if _should_retry(response=response):
|
||||
if max_retries > retries:
|
||||
time.sleep(_retry_timeout(response=response, retries=retries))
|
||||
return self.request(
|
||||
path=path,
|
||||
method=method,
|
||||
base_url=base_url,
|
||||
params=params,
|
||||
json=json,
|
||||
content=content,
|
||||
files=files,
|
||||
headers=headers,
|
||||
request_options=request_options,
|
||||
retries=retries + 1,
|
||||
omit=omit,
|
||||
)
|
||||
|
||||
return response
|
||||
|
||||
@contextmanager
|
||||
def stream(
|
||||
self,
|
||||
path: typing.Optional[str] = None,
|
||||
*,
|
||||
method: str,
|
||||
base_url: typing.Optional[str] = None,
|
||||
params: typing.Optional[typing.Dict[str, typing.Any]] = None,
|
||||
json: typing.Optional[typing.Any] = None,
|
||||
data: typing.Optional[typing.Any] = None,
|
||||
content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None,
|
||||
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
|
||||
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
|
||||
request_options: typing.Optional[RequestOptions] = None,
|
||||
retries: int = 0,
|
||||
omit: typing.Optional[typing.Any] = None,
|
||||
) -> typing.Iterator[httpx.Response]:
|
||||
base_url = self.get_base_url(base_url)
|
||||
timeout = (
|
||||
request_options.get("timeout_in_seconds")
|
||||
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
||||
else self.base_timeout()
|
||||
)
|
||||
|
||||
json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit)
|
||||
|
||||
with self.httpx_client.stream(
|
||||
method=method,
|
||||
url=urllib.parse.urljoin(f"{base_url}/", path),
|
||||
headers=jsonable_encoder(
|
||||
remove_none_from_dict(
|
||||
{
|
||||
**self.base_headers(),
|
||||
**(headers if headers is not None else {}),
|
||||
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
||||
}
|
||||
)
|
||||
),
|
||||
params=encode_query(
|
||||
jsonable_encoder(
|
||||
remove_none_from_dict(
|
||||
remove_omit_from_dict(
|
||||
{
|
||||
**(params if params is not None else {}),
|
||||
**(
|
||||
request_options.get("additional_query_parameters", {})
|
||||
if request_options is not None
|
||||
else {}
|
||||
),
|
||||
},
|
||||
omit,
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
json=json_body,
|
||||
data=data_body,
|
||||
content=content,
|
||||
files=(
|
||||
convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit))
|
||||
if (files is not None and files is not omit)
|
||||
else None
|
||||
),
|
||||
timeout=timeout,
|
||||
) as stream:
|
||||
yield stream
|
||||
|
||||
|
||||
class AsyncHttpClient:
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
httpx_client: httpx.AsyncClient,
|
||||
base_timeout: typing.Callable[[], typing.Optional[float]],
|
||||
base_headers: typing.Callable[[], typing.Dict[str, str]],
|
||||
base_url: typing.Optional[typing.Callable[[], str]] = None,
|
||||
):
|
||||
self.base_url = base_url
|
||||
self.base_timeout = base_timeout
|
||||
self.base_headers = base_headers
|
||||
self.httpx_client = httpx_client
|
||||
|
||||
def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str:
|
||||
base_url = maybe_base_url
|
||||
if self.base_url is not None and base_url is None:
|
||||
base_url = self.base_url()
|
||||
|
||||
if base_url is None:
|
||||
raise ValueError("A base_url is required to make this request, please provide one and try again.")
|
||||
return base_url
|
||||
|
||||
async def request(
|
||||
self,
|
||||
path: typing.Optional[str] = None,
|
||||
*,
|
||||
method: str,
|
||||
base_url: typing.Optional[str] = None,
|
||||
params: typing.Optional[typing.Dict[str, typing.Any]] = None,
|
||||
json: typing.Optional[typing.Any] = None,
|
||||
data: typing.Optional[typing.Any] = None,
|
||||
content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None,
|
||||
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
|
||||
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
|
||||
request_options: typing.Optional[RequestOptions] = None,
|
||||
retries: int = 0,
|
||||
omit: typing.Optional[typing.Any] = None,
|
||||
) -> httpx.Response:
|
||||
base_url = self.get_base_url(base_url)
|
||||
timeout = (
|
||||
request_options.get("timeout_in_seconds")
|
||||
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
||||
else self.base_timeout()
|
||||
)
|
||||
|
||||
json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit)
|
||||
|
||||
# Add the input to each of these and do None-safety checks
|
||||
response = await self.httpx_client.request(
|
||||
method=method,
|
||||
url=urllib.parse.urljoin(f"{base_url}/", path),
|
||||
headers=jsonable_encoder(
|
||||
remove_none_from_dict(
|
||||
{
|
||||
**self.base_headers(),
|
||||
**(headers if headers is not None else {}),
|
||||
**(request_options.get("additional_headers", {}) or {} if request_options is not None else {}),
|
||||
}
|
||||
)
|
||||
),
|
||||
params=encode_query(
|
||||
jsonable_encoder(
|
||||
remove_none_from_dict(
|
||||
remove_omit_from_dict(
|
||||
{
|
||||
**(params if params is not None else {}),
|
||||
**(
|
||||
request_options.get("additional_query_parameters", {}) or {}
|
||||
if request_options is not None
|
||||
else {}
|
||||
),
|
||||
},
|
||||
omit,
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
json=json_body,
|
||||
data=data_body,
|
||||
content=content,
|
||||
files=(
|
||||
convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit))
|
||||
if files is not None
|
||||
else None
|
||||
),
|
||||
timeout=timeout,
|
||||
)
|
||||
|
||||
max_retries: int = request_options.get("max_retries", 0) if request_options is not None else 0
|
||||
if _should_retry(response=response):
|
||||
if max_retries > retries:
|
||||
await asyncio.sleep(_retry_timeout(response=response, retries=retries))
|
||||
return await self.request(
|
||||
path=path,
|
||||
method=method,
|
||||
base_url=base_url,
|
||||
params=params,
|
||||
json=json,
|
||||
content=content,
|
||||
files=files,
|
||||
headers=headers,
|
||||
request_options=request_options,
|
||||
retries=retries + 1,
|
||||
omit=omit,
|
||||
)
|
||||
return response
|
||||
|
||||
@asynccontextmanager
|
||||
async def stream(
|
||||
self,
|
||||
path: typing.Optional[str] = None,
|
||||
*,
|
||||
method: str,
|
||||
base_url: typing.Optional[str] = None,
|
||||
params: typing.Optional[typing.Dict[str, typing.Any]] = None,
|
||||
json: typing.Optional[typing.Any] = None,
|
||||
data: typing.Optional[typing.Any] = None,
|
||||
content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None,
|
||||
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
|
||||
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
|
||||
request_options: typing.Optional[RequestOptions] = None,
|
||||
retries: int = 0,
|
||||
omit: typing.Optional[typing.Any] = None,
|
||||
) -> typing.AsyncIterator[httpx.Response]:
|
||||
base_url = self.get_base_url(base_url)
|
||||
timeout = (
|
||||
request_options.get("timeout_in_seconds")
|
||||
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
||||
else self.base_timeout()
|
||||
)
|
||||
|
||||
json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit)
|
||||
|
||||
async with self.httpx_client.stream(
|
||||
method=method,
|
||||
url=urllib.parse.urljoin(f"{base_url}/", path),
|
||||
headers=jsonable_encoder(
|
||||
remove_none_from_dict(
|
||||
{
|
||||
**self.base_headers(),
|
||||
**(headers if headers is not None else {}),
|
||||
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
||||
}
|
||||
)
|
||||
),
|
||||
params=encode_query(
|
||||
jsonable_encoder(
|
||||
remove_none_from_dict(
|
||||
remove_omit_from_dict(
|
||||
{
|
||||
**(params if params is not None else {}),
|
||||
**(
|
||||
request_options.get("additional_query_parameters", {})
|
||||
if request_options is not None
|
||||
else {}
|
||||
),
|
||||
},
|
||||
omit=omit,
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
json=json_body,
|
||||
data=data_body,
|
||||
content=content,
|
||||
files=(
|
||||
convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit))
|
||||
if files is not None
|
||||
else None
|
||||
),
|
||||
timeout=timeout,
|
||||
) as stream:
|
||||
yield stream
|
||||
101
skyvern/client/core/jsonable_encoder.py
Normal file
101
skyvern/client/core/jsonable_encoder.py
Normal file
@@ -0,0 +1,101 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
"""
|
||||
jsonable_encoder converts a Python object to a JSON-friendly dict
|
||||
(e.g. datetimes to strings, Pydantic models to dicts).
|
||||
|
||||
Taken from FastAPI, and made a bit simpler
|
||||
https://github.com/tiangolo/fastapi/blob/master/fastapi/encoders.py
|
||||
"""
|
||||
|
||||
import base64
|
||||
import dataclasses
|
||||
import datetime as dt
|
||||
from enum import Enum
|
||||
from pathlib import PurePath
|
||||
from types import GeneratorType
|
||||
from typing import Any, Callable, Dict, List, Optional, Set, Union
|
||||
|
||||
import pydantic
|
||||
|
||||
from .datetime_utils import serialize_datetime
|
||||
from .pydantic_utilities import (
|
||||
IS_PYDANTIC_V2,
|
||||
encode_by_type,
|
||||
to_jsonable_with_fallback,
|
||||
)
|
||||
|
||||
SetIntStr = Set[Union[int, str]]
|
||||
DictIntStrAny = Dict[Union[int, str], Any]
|
||||
|
||||
|
||||
def jsonable_encoder(obj: Any, custom_encoder: Optional[Dict[Any, Callable[[Any], Any]]] = None) -> Any:
|
||||
custom_encoder = custom_encoder or {}
|
||||
if custom_encoder:
|
||||
if type(obj) in custom_encoder:
|
||||
return custom_encoder[type(obj)](obj)
|
||||
else:
|
||||
for encoder_type, encoder_instance in custom_encoder.items():
|
||||
if isinstance(obj, encoder_type):
|
||||
return encoder_instance(obj)
|
||||
if isinstance(obj, pydantic.BaseModel):
|
||||
if IS_PYDANTIC_V2:
|
||||
encoder = getattr(obj.model_config, "json_encoders", {}) # type: ignore # Pydantic v2
|
||||
else:
|
||||
encoder = getattr(obj.__config__, "json_encoders", {}) # type: ignore # Pydantic v1
|
||||
if custom_encoder:
|
||||
encoder.update(custom_encoder)
|
||||
obj_dict = obj.dict(by_alias=True)
|
||||
if "__root__" in obj_dict:
|
||||
obj_dict = obj_dict["__root__"]
|
||||
if "root" in obj_dict:
|
||||
obj_dict = obj_dict["root"]
|
||||
return jsonable_encoder(obj_dict, custom_encoder=encoder)
|
||||
if dataclasses.is_dataclass(obj):
|
||||
obj_dict = dataclasses.asdict(obj) # type: ignore
|
||||
return jsonable_encoder(obj_dict, custom_encoder=custom_encoder)
|
||||
if isinstance(obj, bytes):
|
||||
return base64.b64encode(obj).decode("utf-8")
|
||||
if isinstance(obj, Enum):
|
||||
return obj.value
|
||||
if isinstance(obj, PurePath):
|
||||
return str(obj)
|
||||
if isinstance(obj, (str, int, float, type(None))):
|
||||
return obj
|
||||
if isinstance(obj, dt.datetime):
|
||||
return serialize_datetime(obj)
|
||||
if isinstance(obj, dt.date):
|
||||
return str(obj)
|
||||
if isinstance(obj, dict):
|
||||
encoded_dict = {}
|
||||
allowed_keys = set(obj.keys())
|
||||
for key, value in obj.items():
|
||||
if key in allowed_keys:
|
||||
encoded_key = jsonable_encoder(key, custom_encoder=custom_encoder)
|
||||
encoded_value = jsonable_encoder(value, custom_encoder=custom_encoder)
|
||||
encoded_dict[encoded_key] = encoded_value
|
||||
return encoded_dict
|
||||
if isinstance(obj, (list, set, frozenset, GeneratorType, tuple)):
|
||||
encoded_list = []
|
||||
for item in obj:
|
||||
encoded_list.append(jsonable_encoder(item, custom_encoder=custom_encoder))
|
||||
return encoded_list
|
||||
|
||||
def fallback_serializer(o: Any) -> Any:
|
||||
attempt_encode = encode_by_type(o)
|
||||
if attempt_encode is not None:
|
||||
return attempt_encode
|
||||
|
||||
try:
|
||||
data = dict(o)
|
||||
except Exception as e:
|
||||
errors: List[Exception] = []
|
||||
errors.append(e)
|
||||
try:
|
||||
data = vars(o)
|
||||
except Exception as e:
|
||||
errors.append(e)
|
||||
raise ValueError(errors) from e
|
||||
return jsonable_encoder(data, custom_encoder=custom_encoder)
|
||||
|
||||
return to_jsonable_with_fallback(obj, fallback_serializer)
|
||||
296
skyvern/client/core/pydantic_utilities.py
Normal file
296
skyvern/client/core/pydantic_utilities.py
Normal file
@@ -0,0 +1,296 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
# nopycln: file
|
||||
import datetime as dt
|
||||
import typing
|
||||
from collections import defaultdict
|
||||
|
||||
import typing_extensions
|
||||
|
||||
import pydantic
|
||||
|
||||
from .datetime_utils import serialize_datetime
|
||||
from .serialization import convert_and_respect_annotation_metadata
|
||||
|
||||
IS_PYDANTIC_V2 = pydantic.VERSION.startswith("2.")
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
# isort will try to reformat the comments on these imports, which breaks mypy
|
||||
# isort: off
|
||||
from pydantic.v1.datetime_parse import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2
|
||||
parse_date as parse_date,
|
||||
)
|
||||
from pydantic.v1.datetime_parse import ( # pyright: ignore[reportMissingImports] # Pydantic v2
|
||||
parse_datetime as parse_datetime,
|
||||
)
|
||||
from pydantic.v1.json import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2
|
||||
ENCODERS_BY_TYPE as encoders_by_type,
|
||||
)
|
||||
from pydantic.v1.typing import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2
|
||||
get_args as get_args,
|
||||
)
|
||||
from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2
|
||||
get_origin as get_origin,
|
||||
)
|
||||
from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2
|
||||
is_literal_type as is_literal_type,
|
||||
)
|
||||
from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2
|
||||
is_union as is_union,
|
||||
)
|
||||
from pydantic.v1.fields import ModelField as ModelField # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2
|
||||
else:
|
||||
from pydantic.datetime_parse import parse_date as parse_date # type: ignore # Pydantic v1
|
||||
from pydantic.datetime_parse import parse_datetime as parse_datetime # type: ignore # Pydantic v1
|
||||
from pydantic.fields import ModelField as ModelField # type: ignore # Pydantic v1
|
||||
from pydantic.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore # Pydantic v1
|
||||
from pydantic.typing import get_args as get_args # type: ignore # Pydantic v1
|
||||
from pydantic.typing import get_origin as get_origin # type: ignore # Pydantic v1
|
||||
from pydantic.typing import is_literal_type as is_literal_type # type: ignore # Pydantic v1
|
||||
from pydantic.typing import is_union as is_union # type: ignore # Pydantic v1
|
||||
|
||||
# isort: on
|
||||
|
||||
|
||||
T = typing.TypeVar("T")
|
||||
Model = typing.TypeVar("Model", bound=pydantic.BaseModel)
|
||||
|
||||
|
||||
def parse_obj_as(type_: typing.Type[T], object_: typing.Any) -> T:
|
||||
dealiased_object = convert_and_respect_annotation_metadata(object_=object_, annotation=type_, direction="read")
|
||||
if IS_PYDANTIC_V2:
|
||||
adapter = pydantic.TypeAdapter(type_) # type: ignore # Pydantic v2
|
||||
return adapter.validate_python(dealiased_object)
|
||||
else:
|
||||
return pydantic.parse_obj_as(type_, dealiased_object)
|
||||
|
||||
|
||||
def to_jsonable_with_fallback(
|
||||
obj: typing.Any, fallback_serializer: typing.Callable[[typing.Any], typing.Any]
|
||||
) -> typing.Any:
|
||||
if IS_PYDANTIC_V2:
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
return to_jsonable_python(obj, fallback=fallback_serializer)
|
||||
else:
|
||||
return fallback_serializer(obj)
|
||||
|
||||
|
||||
class UniversalBaseModel(pydantic.BaseModel):
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
||||
# Allow fields begining with `model_` to be used in the model
|
||||
protected_namespaces=(),
|
||||
) # type: ignore # Pydantic v2
|
||||
|
||||
@pydantic.model_serializer(mode="wrap", when_used="json") # type: ignore # Pydantic v2
|
||||
def serialize_model(self, handler: pydantic.SerializerFunctionWrapHandler) -> typing.Any: # type: ignore # Pydantic v2
|
||||
serialized = handler(self)
|
||||
data = {k: serialize_datetime(v) if isinstance(v, dt.datetime) else v for k, v in serialized.items()}
|
||||
return data
|
||||
|
||||
else:
|
||||
|
||||
class Config:
|
||||
smart_union = True
|
||||
json_encoders = {dt.datetime: serialize_datetime}
|
||||
|
||||
@classmethod
|
||||
def model_construct(
|
||||
cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any
|
||||
) -> "Model":
|
||||
dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read")
|
||||
return cls.construct(_fields_set, **dealiased_object)
|
||||
|
||||
@classmethod
|
||||
def construct(
|
||||
cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any
|
||||
) -> "Model":
|
||||
dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read")
|
||||
if IS_PYDANTIC_V2:
|
||||
return super().model_construct(_fields_set, **dealiased_object) # type: ignore # Pydantic v2
|
||||
else:
|
||||
return super().construct(_fields_set, **dealiased_object)
|
||||
|
||||
def json(self, **kwargs: typing.Any) -> str:
|
||||
kwargs_with_defaults: typing.Any = {
|
||||
"by_alias": True,
|
||||
"exclude_unset": True,
|
||||
**kwargs,
|
||||
}
|
||||
if IS_PYDANTIC_V2:
|
||||
return super().model_dump_json(**kwargs_with_defaults) # type: ignore # Pydantic v2
|
||||
else:
|
||||
return super().json(**kwargs_with_defaults)
|
||||
|
||||
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
||||
"""
|
||||
Override the default dict method to `exclude_unset` by default. This function patches
|
||||
`exclude_unset` to work include fields within non-None default values.
|
||||
"""
|
||||
# Note: the logic here is multi-plexed given the levers exposed in Pydantic V1 vs V2
|
||||
# Pydantic V1's .dict can be extremely slow, so we do not want to call it twice.
|
||||
#
|
||||
# We'd ideally do the same for Pydantic V2, but it shells out to a library to serialize models
|
||||
# that we have less control over, and this is less intrusive than custom serializers for now.
|
||||
if IS_PYDANTIC_V2:
|
||||
kwargs_with_defaults_exclude_unset: typing.Any = {
|
||||
**kwargs,
|
||||
"by_alias": True,
|
||||
"exclude_unset": True,
|
||||
"exclude_none": False,
|
||||
}
|
||||
kwargs_with_defaults_exclude_none: typing.Any = {
|
||||
**kwargs,
|
||||
"by_alias": True,
|
||||
"exclude_none": True,
|
||||
"exclude_unset": False,
|
||||
}
|
||||
dict_dump = deep_union_pydantic_dicts(
|
||||
super().model_dump(**kwargs_with_defaults_exclude_unset), # type: ignore # Pydantic v2
|
||||
super().model_dump(**kwargs_with_defaults_exclude_none), # type: ignore # Pydantic v2
|
||||
)
|
||||
|
||||
else:
|
||||
_fields_set = self.__fields_set__.copy()
|
||||
|
||||
fields = _get_model_fields(self.__class__)
|
||||
for name, field in fields.items():
|
||||
if name not in _fields_set:
|
||||
default = _get_field_default(field)
|
||||
|
||||
# If the default values are non-null act like they've been set
|
||||
# This effectively allows exclude_unset to work like exclude_none where
|
||||
# the latter passes through intentionally set none values.
|
||||
if default is not None or ("exclude_unset" in kwargs and not kwargs["exclude_unset"]):
|
||||
_fields_set.add(name)
|
||||
|
||||
if default is not None:
|
||||
self.__fields_set__.add(name)
|
||||
|
||||
kwargs_with_defaults_exclude_unset_include_fields: typing.Any = {
|
||||
"by_alias": True,
|
||||
"exclude_unset": True,
|
||||
"include": _fields_set,
|
||||
**kwargs,
|
||||
}
|
||||
|
||||
dict_dump = super().dict(**kwargs_with_defaults_exclude_unset_include_fields)
|
||||
|
||||
return convert_and_respect_annotation_metadata(object_=dict_dump, annotation=self.__class__, direction="write")
|
||||
|
||||
|
||||
def _union_list_of_pydantic_dicts(
|
||||
source: typing.List[typing.Any], destination: typing.List[typing.Any]
|
||||
) -> typing.List[typing.Any]:
|
||||
converted_list: typing.List[typing.Any] = []
|
||||
for i, item in enumerate(source):
|
||||
destination_value = destination[i] # type: ignore
|
||||
if isinstance(item, dict):
|
||||
converted_list.append(deep_union_pydantic_dicts(item, destination_value))
|
||||
elif isinstance(item, list):
|
||||
converted_list.append(_union_list_of_pydantic_dicts(item, destination_value))
|
||||
else:
|
||||
converted_list.append(item)
|
||||
return converted_list
|
||||
|
||||
|
||||
def deep_union_pydantic_dicts(
|
||||
source: typing.Dict[str, typing.Any], destination: typing.Dict[str, typing.Any]
|
||||
) -> typing.Dict[str, typing.Any]:
|
||||
for key, value in source.items():
|
||||
node = destination.setdefault(key, {})
|
||||
if isinstance(value, dict):
|
||||
deep_union_pydantic_dicts(value, node)
|
||||
# Note: we do not do this same processing for sets given we do not have sets of models
|
||||
# and given the sets are unordered, the processing of the set and matching objects would
|
||||
# be non-trivial.
|
||||
elif isinstance(value, list):
|
||||
destination[key] = _union_list_of_pydantic_dicts(value, node)
|
||||
else:
|
||||
destination[key] = value
|
||||
|
||||
return destination
|
||||
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
|
||||
class V2RootModel(UniversalBaseModel, pydantic.RootModel): # type: ignore # Pydantic v2
|
||||
pass
|
||||
|
||||
UniversalRootModel: typing_extensions.TypeAlias = V2RootModel # type: ignore
|
||||
else:
|
||||
UniversalRootModel: typing_extensions.TypeAlias = UniversalBaseModel # type: ignore
|
||||
|
||||
|
||||
def encode_by_type(o: typing.Any) -> typing.Any:
|
||||
encoders_by_class_tuples: typing.Dict[typing.Callable[[typing.Any], typing.Any], typing.Tuple[typing.Any, ...]] = (
|
||||
defaultdict(tuple)
|
||||
)
|
||||
for type_, encoder in encoders_by_type.items():
|
||||
encoders_by_class_tuples[encoder] += (type_,)
|
||||
|
||||
if type(o) in encoders_by_type:
|
||||
return encoders_by_type[type(o)](o)
|
||||
for encoder, classes_tuple in encoders_by_class_tuples.items():
|
||||
if isinstance(o, classes_tuple):
|
||||
return encoder(o)
|
||||
|
||||
|
||||
def update_forward_refs(model: typing.Type["Model"], **localns: typing.Any) -> None:
|
||||
if IS_PYDANTIC_V2:
|
||||
model.model_rebuild(raise_errors=False) # type: ignore # Pydantic v2
|
||||
else:
|
||||
model.update_forward_refs(**localns)
|
||||
|
||||
|
||||
# Mirrors Pydantic's internal typing
|
||||
AnyCallable = typing.Callable[..., typing.Any]
|
||||
|
||||
|
||||
def universal_root_validator(
|
||||
pre: bool = False,
|
||||
) -> typing.Callable[[AnyCallable], AnyCallable]:
|
||||
def decorator(func: AnyCallable) -> AnyCallable:
|
||||
if IS_PYDANTIC_V2:
|
||||
return pydantic.model_validator(mode="before" if pre else "after")(func) # type: ignore # Pydantic v2
|
||||
else:
|
||||
return pydantic.root_validator(pre=pre)(func) # type: ignore # Pydantic v1
|
||||
|
||||
return decorator
|
||||
|
||||
|
||||
def universal_field_validator(field_name: str, pre: bool = False) -> typing.Callable[[AnyCallable], AnyCallable]:
|
||||
def decorator(func: AnyCallable) -> AnyCallable:
|
||||
if IS_PYDANTIC_V2:
|
||||
return pydantic.field_validator(field_name, mode="before" if pre else "after")(func) # type: ignore # Pydantic v2
|
||||
else:
|
||||
return pydantic.validator(field_name, pre=pre)(func) # type: ignore # Pydantic v1
|
||||
|
||||
return decorator
|
||||
|
||||
|
||||
PydanticField = typing.Union[ModelField, pydantic.fields.FieldInfo]
|
||||
|
||||
|
||||
def _get_model_fields(
|
||||
model: typing.Type["Model"],
|
||||
) -> typing.Mapping[str, PydanticField]:
|
||||
if IS_PYDANTIC_V2:
|
||||
return model.model_fields # type: ignore # Pydantic v2
|
||||
else:
|
||||
return model.__fields__ # type: ignore # Pydantic v1
|
||||
|
||||
|
||||
def _get_field_default(field: PydanticField) -> typing.Any:
|
||||
try:
|
||||
value = field.get_default() # type: ignore # Pydantic < v1.10.15
|
||||
except:
|
||||
value = field.default
|
||||
if IS_PYDANTIC_V2:
|
||||
from pydantic_core import PydanticUndefined
|
||||
|
||||
if value == PydanticUndefined:
|
||||
return None
|
||||
return value
|
||||
return value
|
||||
58
skyvern/client/core/query_encoder.py
Normal file
58
skyvern/client/core/query_encoder.py
Normal file
@@ -0,0 +1,58 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
|
||||
import pydantic
|
||||
|
||||
|
||||
# Flattens dicts to be of the form {"key[subkey][subkey2]": value} where value is not a dict
|
||||
def traverse_query_dict(dict_flat: Dict[str, Any], key_prefix: Optional[str] = None) -> List[Tuple[str, Any]]:
|
||||
result = []
|
||||
for k, v in dict_flat.items():
|
||||
key = f"{key_prefix}[{k}]" if key_prefix is not None else k
|
||||
if isinstance(v, dict):
|
||||
result.extend(traverse_query_dict(v, key))
|
||||
elif isinstance(v, list):
|
||||
for arr_v in v:
|
||||
if isinstance(arr_v, dict):
|
||||
result.extend(traverse_query_dict(arr_v, key))
|
||||
else:
|
||||
result.append((key, arr_v))
|
||||
else:
|
||||
result.append((key, v))
|
||||
return result
|
||||
|
||||
|
||||
def single_query_encoder(query_key: str, query_value: Any) -> List[Tuple[str, Any]]:
|
||||
if isinstance(query_value, pydantic.BaseModel) or isinstance(query_value, dict):
|
||||
if isinstance(query_value, pydantic.BaseModel):
|
||||
obj_dict = query_value.dict(by_alias=True)
|
||||
else:
|
||||
obj_dict = query_value
|
||||
return traverse_query_dict(obj_dict, query_key)
|
||||
elif isinstance(query_value, list):
|
||||
encoded_values: List[Tuple[str, Any]] = []
|
||||
for value in query_value:
|
||||
if isinstance(value, pydantic.BaseModel) or isinstance(value, dict):
|
||||
if isinstance(value, pydantic.BaseModel):
|
||||
obj_dict = value.dict(by_alias=True)
|
||||
elif isinstance(value, dict):
|
||||
obj_dict = value
|
||||
|
||||
encoded_values.extend(single_query_encoder(query_key, obj_dict))
|
||||
else:
|
||||
encoded_values.append((query_key, value))
|
||||
|
||||
return encoded_values
|
||||
|
||||
return [(query_key, query_value)]
|
||||
|
||||
|
||||
def encode_query(query: Optional[Dict[str, Any]]) -> Optional[List[Tuple[str, Any]]]:
|
||||
if query is None:
|
||||
return None
|
||||
|
||||
encoded_query = []
|
||||
for k, v in query.items():
|
||||
encoded_query.extend(single_query_encoder(k, v))
|
||||
return encoded_query
|
||||
11
skyvern/client/core/remove_none_from_dict.py
Normal file
11
skyvern/client/core/remove_none_from_dict.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from typing import Any, Dict, Mapping, Optional
|
||||
|
||||
|
||||
def remove_none_from_dict(original: Mapping[str, Optional[Any]]) -> Dict[str, Any]:
|
||||
new: Dict[str, Any] = {}
|
||||
for key, value in original.items():
|
||||
if value is not None:
|
||||
new[key] = value
|
||||
return new
|
||||
35
skyvern/client/core/request_options.py
Normal file
35
skyvern/client/core/request_options.py
Normal file
@@ -0,0 +1,35 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
try:
|
||||
from typing import NotRequired # type: ignore
|
||||
except ImportError:
|
||||
from typing_extensions import NotRequired
|
||||
|
||||
|
||||
class RequestOptions(typing.TypedDict, total=False):
|
||||
"""
|
||||
Additional options for request-specific configuration when calling APIs via the SDK.
|
||||
This is used primarily as an optional final parameter for service functions.
|
||||
|
||||
Attributes:
|
||||
- timeout_in_seconds: int. The number of seconds to await an API call before timing out.
|
||||
|
||||
- max_retries: int. The max number of retries to attempt if the API call fails.
|
||||
|
||||
- additional_headers: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's header dict
|
||||
|
||||
- additional_query_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's query parameters dict
|
||||
|
||||
- additional_body_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's body parameters dict
|
||||
|
||||
- chunk_size: int. The size, in bytes, to process each chunk of data being streamed back within the response. This equates to leveraging `chunk_size` within `requests` or `httpx`, and is only leveraged for file downloads.
|
||||
"""
|
||||
|
||||
timeout_in_seconds: NotRequired[int]
|
||||
max_retries: NotRequired[int]
|
||||
additional_headers: NotRequired[typing.Dict[str, typing.Any]]
|
||||
additional_query_parameters: NotRequired[typing.Dict[str, typing.Any]]
|
||||
additional_body_parameters: NotRequired[typing.Dict[str, typing.Any]]
|
||||
chunk_size: NotRequired[int]
|
||||
272
skyvern/client/core/serialization.py
Normal file
272
skyvern/client/core/serialization.py
Normal file
@@ -0,0 +1,272 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import collections
|
||||
import inspect
|
||||
import typing
|
||||
|
||||
import typing_extensions
|
||||
|
||||
import pydantic
|
||||
|
||||
|
||||
class FieldMetadata:
|
||||
"""
|
||||
Metadata class used to annotate fields to provide additional information.
|
||||
|
||||
Example:
|
||||
class MyDict(TypedDict):
|
||||
field: typing.Annotated[str, FieldMetadata(alias="field_name")]
|
||||
|
||||
Will serialize: `{"field": "value"}`
|
||||
To: `{"field_name": "value"}`
|
||||
"""
|
||||
|
||||
alias: str
|
||||
|
||||
def __init__(self, *, alias: str) -> None:
|
||||
self.alias = alias
|
||||
|
||||
|
||||
def convert_and_respect_annotation_metadata(
|
||||
*,
|
||||
object_: typing.Any,
|
||||
annotation: typing.Any,
|
||||
inner_type: typing.Optional[typing.Any] = None,
|
||||
direction: typing.Literal["read", "write"],
|
||||
) -> typing.Any:
|
||||
"""
|
||||
Respect the metadata annotations on a field, such as aliasing. This function effectively
|
||||
manipulates the dict-form of an object to respect the metadata annotations. This is primarily used for
|
||||
TypedDicts, which cannot support aliasing out of the box, and can be extended for additional
|
||||
utilities, such as defaults.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
object_ : typing.Any
|
||||
|
||||
annotation : type
|
||||
The type we're looking to apply typing annotations from
|
||||
|
||||
inner_type : typing.Optional[type]
|
||||
|
||||
Returns
|
||||
-------
|
||||
typing.Any
|
||||
"""
|
||||
|
||||
if object_ is None:
|
||||
return None
|
||||
if inner_type is None:
|
||||
inner_type = annotation
|
||||
|
||||
clean_type = _remove_annotations(inner_type)
|
||||
# Pydantic models
|
||||
if (
|
||||
inspect.isclass(clean_type)
|
||||
and issubclass(clean_type, pydantic.BaseModel)
|
||||
and isinstance(object_, typing.Mapping)
|
||||
):
|
||||
return _convert_mapping(object_, clean_type, direction)
|
||||
# TypedDicts
|
||||
if typing_extensions.is_typeddict(clean_type) and isinstance(object_, typing.Mapping):
|
||||
return _convert_mapping(object_, clean_type, direction)
|
||||
|
||||
if (
|
||||
typing_extensions.get_origin(clean_type) == typing.Dict
|
||||
or typing_extensions.get_origin(clean_type) == dict
|
||||
or clean_type == typing.Dict
|
||||
) and isinstance(object_, typing.Dict):
|
||||
key_type = typing_extensions.get_args(clean_type)[0]
|
||||
value_type = typing_extensions.get_args(clean_type)[1]
|
||||
|
||||
return {
|
||||
key: convert_and_respect_annotation_metadata(
|
||||
object_=value,
|
||||
annotation=annotation,
|
||||
inner_type=value_type,
|
||||
direction=direction,
|
||||
)
|
||||
for key, value in object_.items()
|
||||
}
|
||||
|
||||
# If you're iterating on a string, do not bother to coerce it to a sequence.
|
||||
if not isinstance(object_, str):
|
||||
if (
|
||||
typing_extensions.get_origin(clean_type) == typing.Set
|
||||
or typing_extensions.get_origin(clean_type) == set
|
||||
or clean_type == typing.Set
|
||||
) and isinstance(object_, typing.Set):
|
||||
inner_type = typing_extensions.get_args(clean_type)[0]
|
||||
return {
|
||||
convert_and_respect_annotation_metadata(
|
||||
object_=item,
|
||||
annotation=annotation,
|
||||
inner_type=inner_type,
|
||||
direction=direction,
|
||||
)
|
||||
for item in object_
|
||||
}
|
||||
elif (
|
||||
(
|
||||
typing_extensions.get_origin(clean_type) == typing.List
|
||||
or typing_extensions.get_origin(clean_type) == list
|
||||
or clean_type == typing.List
|
||||
)
|
||||
and isinstance(object_, typing.List)
|
||||
) or (
|
||||
(
|
||||
typing_extensions.get_origin(clean_type) == typing.Sequence
|
||||
or typing_extensions.get_origin(clean_type) == collections.abc.Sequence
|
||||
or clean_type == typing.Sequence
|
||||
)
|
||||
and isinstance(object_, typing.Sequence)
|
||||
):
|
||||
inner_type = typing_extensions.get_args(clean_type)[0]
|
||||
return [
|
||||
convert_and_respect_annotation_metadata(
|
||||
object_=item,
|
||||
annotation=annotation,
|
||||
inner_type=inner_type,
|
||||
direction=direction,
|
||||
)
|
||||
for item in object_
|
||||
]
|
||||
|
||||
if typing_extensions.get_origin(clean_type) == typing.Union:
|
||||
# We should be able to ~relatively~ safely try to convert keys against all
|
||||
# member types in the union, the edge case here is if one member aliases a field
|
||||
# of the same name to a different name from another member
|
||||
# Or if another member aliases a field of the same name that another member does not.
|
||||
for member in typing_extensions.get_args(clean_type):
|
||||
object_ = convert_and_respect_annotation_metadata(
|
||||
object_=object_,
|
||||
annotation=annotation,
|
||||
inner_type=member,
|
||||
direction=direction,
|
||||
)
|
||||
return object_
|
||||
|
||||
annotated_type = _get_annotation(annotation)
|
||||
if annotated_type is None:
|
||||
return object_
|
||||
|
||||
# If the object is not a TypedDict, a Union, or other container (list, set, sequence, etc.)
|
||||
# Then we can safely call it on the recursive conversion.
|
||||
return object_
|
||||
|
||||
|
||||
def _convert_mapping(
|
||||
object_: typing.Mapping[str, object],
|
||||
expected_type: typing.Any,
|
||||
direction: typing.Literal["read", "write"],
|
||||
) -> typing.Mapping[str, object]:
|
||||
converted_object: typing.Dict[str, object] = {}
|
||||
annotations = typing_extensions.get_type_hints(expected_type, include_extras=True)
|
||||
aliases_to_field_names = _get_alias_to_field_name(annotations)
|
||||
for key, value in object_.items():
|
||||
if direction == "read" and key in aliases_to_field_names:
|
||||
dealiased_key = aliases_to_field_names.get(key)
|
||||
if dealiased_key is not None:
|
||||
type_ = annotations.get(dealiased_key)
|
||||
else:
|
||||
type_ = annotations.get(key)
|
||||
# Note you can't get the annotation by the field name if you're in read mode, so you must check the aliases map
|
||||
#
|
||||
# So this is effectively saying if we're in write mode, and we don't have a type, or if we're in read mode and we don't have an alias
|
||||
# then we can just pass the value through as is
|
||||
if type_ is None:
|
||||
converted_object[key] = value
|
||||
elif direction == "read" and key not in aliases_to_field_names:
|
||||
converted_object[key] = convert_and_respect_annotation_metadata(
|
||||
object_=value, annotation=type_, direction=direction
|
||||
)
|
||||
else:
|
||||
converted_object[_alias_key(key, type_, direction, aliases_to_field_names)] = (
|
||||
convert_and_respect_annotation_metadata(object_=value, annotation=type_, direction=direction)
|
||||
)
|
||||
return converted_object
|
||||
|
||||
|
||||
def _get_annotation(type_: typing.Any) -> typing.Optional[typing.Any]:
|
||||
maybe_annotated_type = typing_extensions.get_origin(type_)
|
||||
if maybe_annotated_type is None:
|
||||
return None
|
||||
|
||||
if maybe_annotated_type == typing_extensions.NotRequired:
|
||||
type_ = typing_extensions.get_args(type_)[0]
|
||||
maybe_annotated_type = typing_extensions.get_origin(type_)
|
||||
|
||||
if maybe_annotated_type == typing_extensions.Annotated:
|
||||
return type_
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def _remove_annotations(type_: typing.Any) -> typing.Any:
|
||||
maybe_annotated_type = typing_extensions.get_origin(type_)
|
||||
if maybe_annotated_type is None:
|
||||
return type_
|
||||
|
||||
if maybe_annotated_type == typing_extensions.NotRequired:
|
||||
return _remove_annotations(typing_extensions.get_args(type_)[0])
|
||||
|
||||
if maybe_annotated_type == typing_extensions.Annotated:
|
||||
return _remove_annotations(typing_extensions.get_args(type_)[0])
|
||||
|
||||
return type_
|
||||
|
||||
|
||||
def get_alias_to_field_mapping(type_: typing.Any) -> typing.Dict[str, str]:
|
||||
annotations = typing_extensions.get_type_hints(type_, include_extras=True)
|
||||
return _get_alias_to_field_name(annotations)
|
||||
|
||||
|
||||
def get_field_to_alias_mapping(type_: typing.Any) -> typing.Dict[str, str]:
|
||||
annotations = typing_extensions.get_type_hints(type_, include_extras=True)
|
||||
return _get_field_to_alias_name(annotations)
|
||||
|
||||
|
||||
def _get_alias_to_field_name(
|
||||
field_to_hint: typing.Dict[str, typing.Any],
|
||||
) -> typing.Dict[str, str]:
|
||||
aliases = {}
|
||||
for field, hint in field_to_hint.items():
|
||||
maybe_alias = _get_alias_from_type(hint)
|
||||
if maybe_alias is not None:
|
||||
aliases[maybe_alias] = field
|
||||
return aliases
|
||||
|
||||
|
||||
def _get_field_to_alias_name(
|
||||
field_to_hint: typing.Dict[str, typing.Any],
|
||||
) -> typing.Dict[str, str]:
|
||||
aliases = {}
|
||||
for field, hint in field_to_hint.items():
|
||||
maybe_alias = _get_alias_from_type(hint)
|
||||
if maybe_alias is not None:
|
||||
aliases[field] = maybe_alias
|
||||
return aliases
|
||||
|
||||
|
||||
def _get_alias_from_type(type_: typing.Any) -> typing.Optional[str]:
|
||||
maybe_annotated_type = _get_annotation(type_)
|
||||
|
||||
if maybe_annotated_type is not None:
|
||||
# The actual annotations are 1 onward, the first is the annotated type
|
||||
annotations = typing_extensions.get_args(maybe_annotated_type)[1:]
|
||||
|
||||
for annotation in annotations:
|
||||
if isinstance(annotation, FieldMetadata) and annotation.alias is not None:
|
||||
return annotation.alias
|
||||
return None
|
||||
|
||||
|
||||
def _alias_key(
|
||||
key: str,
|
||||
type_: typing.Any,
|
||||
direction: typing.Literal["read", "write"],
|
||||
aliases_to_field_names: typing.Dict[str, str],
|
||||
) -> str:
|
||||
if direction == "read":
|
||||
return aliases_to_field_names.get(key, key)
|
||||
return _get_alias_from_type(type_=type_) or key
|
||||
7
skyvern/client/environment.py
Normal file
7
skyvern/client/environment.py
Normal file
@@ -0,0 +1,7 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import enum
|
||||
|
||||
|
||||
class SkyvernEnvironment(enum.Enum):
|
||||
PRODUCTION = "https://api.skyvern.com"
|
||||
5
skyvern/client/errors/__init__.py
Normal file
5
skyvern/client/errors/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from .unprocessable_entity_error import UnprocessableEntityError
|
||||
|
||||
__all__ = ["UnprocessableEntityError"]
|
||||
9
skyvern/client/errors/unprocessable_entity_error.py
Normal file
9
skyvern/client/errors/unprocessable_entity_error.py
Normal file
@@ -0,0 +1,9 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.api_error import ApiError
|
||||
from ..types.http_validation_error import HttpValidationError
|
||||
|
||||
|
||||
class UnprocessableEntityError(ApiError):
|
||||
def __init__(self, body: HttpValidationError):
|
||||
super().__init__(status_code=422, body=body)
|
||||
2
skyvern/client/server/__init__.py
Normal file
2
skyvern/client/server/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
243
skyvern/client/server/client.py
Normal file
243
skyvern/client/server/client.py
Normal file
@@ -0,0 +1,243 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.client_wrapper import SyncClientWrapper
|
||||
import typing
|
||||
from ..core.request_options import RequestOptions
|
||||
from ..core.pydantic_utilities import parse_obj_as
|
||||
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
||||
from ..types.http_validation_error import HttpValidationError
|
||||
from json.decoder import JSONDecodeError
|
||||
from ..core.api_error import ApiError
|
||||
from ..core.client_wrapper import AsyncClientWrapper
|
||||
|
||||
|
||||
class ServerClient:
|
||||
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
||||
self._client_wrapper = client_wrapper
|
||||
|
||||
def webhook(
|
||||
self,
|
||||
*,
|
||||
skyvern_signature: typing.Optional[str] = None,
|
||||
skyvern_timestamp: typing.Optional[str] = None,
|
||||
request_options: typing.Optional[RequestOptions] = None,
|
||||
) -> typing.Optional[typing.Any]:
|
||||
"""
|
||||
Parameters
|
||||
----------
|
||||
skyvern_signature : typing.Optional[str]
|
||||
|
||||
skyvern_timestamp : typing.Optional[str]
|
||||
|
||||
request_options : typing.Optional[RequestOptions]
|
||||
Request-specific configuration.
|
||||
|
||||
Returns
|
||||
-------
|
||||
typing.Optional[typing.Any]
|
||||
Successful Response
|
||||
|
||||
Examples
|
||||
--------
|
||||
from skyverndocs import Skyvern
|
||||
|
||||
client = Skyvern()
|
||||
client.server.webhook()
|
||||
"""
|
||||
_response = self._client_wrapper.httpx_client.request(
|
||||
"api/v1/webhook",
|
||||
method="POST",
|
||||
headers={
|
||||
"x-skyvern-signature": str(skyvern_signature) if skyvern_signature is not None else None,
|
||||
"x-skyvern-timestamp": str(skyvern_timestamp) if skyvern_timestamp is not None else None,
|
||||
},
|
||||
request_options=request_options,
|
||||
)
|
||||
try:
|
||||
if 200 <= _response.status_code < 300:
|
||||
return typing.cast(
|
||||
typing.Optional[typing.Any],
|
||||
parse_obj_as(
|
||||
type_=typing.Optional[typing.Any], # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
)
|
||||
if _response.status_code == 422:
|
||||
raise UnprocessableEntityError(
|
||||
typing.cast(
|
||||
HttpValidationError,
|
||||
parse_obj_as(
|
||||
type_=HttpValidationError, # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
)
|
||||
)
|
||||
_response_json = _response.json()
|
||||
except JSONDecodeError:
|
||||
raise ApiError(status_code=_response.status_code, body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, body=_response_json)
|
||||
|
||||
def check_status(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Optional[typing.Any]:
|
||||
"""
|
||||
Check if the server is running.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
request_options : typing.Optional[RequestOptions]
|
||||
Request-specific configuration.
|
||||
|
||||
Returns
|
||||
-------
|
||||
typing.Optional[typing.Any]
|
||||
Successful Response
|
||||
|
||||
Examples
|
||||
--------
|
||||
from skyverndocs import Skyvern
|
||||
|
||||
client = Skyvern()
|
||||
client.server.check_status()
|
||||
"""
|
||||
_response = self._client_wrapper.httpx_client.request(
|
||||
"api/v1/heartbeat",
|
||||
method="GET",
|
||||
request_options=request_options,
|
||||
)
|
||||
try:
|
||||
if 200 <= _response.status_code < 300:
|
||||
return typing.cast(
|
||||
typing.Optional[typing.Any],
|
||||
parse_obj_as(
|
||||
type_=typing.Optional[typing.Any], # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
)
|
||||
_response_json = _response.json()
|
||||
except JSONDecodeError:
|
||||
raise ApiError(status_code=_response.status_code, body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, body=_response_json)
|
||||
|
||||
|
||||
class AsyncServerClient:
|
||||
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
||||
self._client_wrapper = client_wrapper
|
||||
|
||||
async def webhook(
|
||||
self,
|
||||
*,
|
||||
skyvern_signature: typing.Optional[str] = None,
|
||||
skyvern_timestamp: typing.Optional[str] = None,
|
||||
request_options: typing.Optional[RequestOptions] = None,
|
||||
) -> typing.Optional[typing.Any]:
|
||||
"""
|
||||
Parameters
|
||||
----------
|
||||
skyvern_signature : typing.Optional[str]
|
||||
|
||||
skyvern_timestamp : typing.Optional[str]
|
||||
|
||||
request_options : typing.Optional[RequestOptions]
|
||||
Request-specific configuration.
|
||||
|
||||
Returns
|
||||
-------
|
||||
typing.Optional[typing.Any]
|
||||
Successful Response
|
||||
|
||||
Examples
|
||||
--------
|
||||
import asyncio
|
||||
|
||||
from skyverndocs import AsyncSkyvern
|
||||
|
||||
client = AsyncSkyvern()
|
||||
|
||||
|
||||
async def main() -> None:
|
||||
await client.server.webhook()
|
||||
|
||||
|
||||
asyncio.run(main())
|
||||
"""
|
||||
_response = await self._client_wrapper.httpx_client.request(
|
||||
"api/v1/webhook",
|
||||
method="POST",
|
||||
headers={
|
||||
"x-skyvern-signature": str(skyvern_signature) if skyvern_signature is not None else None,
|
||||
"x-skyvern-timestamp": str(skyvern_timestamp) if skyvern_timestamp is not None else None,
|
||||
},
|
||||
request_options=request_options,
|
||||
)
|
||||
try:
|
||||
if 200 <= _response.status_code < 300:
|
||||
return typing.cast(
|
||||
typing.Optional[typing.Any],
|
||||
parse_obj_as(
|
||||
type_=typing.Optional[typing.Any], # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
)
|
||||
if _response.status_code == 422:
|
||||
raise UnprocessableEntityError(
|
||||
typing.cast(
|
||||
HttpValidationError,
|
||||
parse_obj_as(
|
||||
type_=HttpValidationError, # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
)
|
||||
)
|
||||
_response_json = _response.json()
|
||||
except JSONDecodeError:
|
||||
raise ApiError(status_code=_response.status_code, body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, body=_response_json)
|
||||
|
||||
async def check_status(
|
||||
self, *, request_options: typing.Optional[RequestOptions] = None
|
||||
) -> typing.Optional[typing.Any]:
|
||||
"""
|
||||
Check if the server is running.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
request_options : typing.Optional[RequestOptions]
|
||||
Request-specific configuration.
|
||||
|
||||
Returns
|
||||
-------
|
||||
typing.Optional[typing.Any]
|
||||
Successful Response
|
||||
|
||||
Examples
|
||||
--------
|
||||
import asyncio
|
||||
|
||||
from skyverndocs import AsyncSkyvern
|
||||
|
||||
client = AsyncSkyvern()
|
||||
|
||||
|
||||
async def main() -> None:
|
||||
await client.server.check_status()
|
||||
|
||||
|
||||
asyncio.run(main())
|
||||
"""
|
||||
_response = await self._client_wrapper.httpx_client.request(
|
||||
"api/v1/heartbeat",
|
||||
method="GET",
|
||||
request_options=request_options,
|
||||
)
|
||||
try:
|
||||
if 200 <= _response.status_code < 300:
|
||||
return typing.cast(
|
||||
typing.Optional[typing.Any],
|
||||
parse_obj_as(
|
||||
type_=typing.Optional[typing.Any], # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
)
|
||||
_response_json = _response.json()
|
||||
except JSONDecodeError:
|
||||
raise ApiError(status_code=_response.status_code, body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, body=_response_json)
|
||||
535
skyvern/client/types/__init__.py
Normal file
535
skyvern/client/types/__init__.py
Normal file
@@ -0,0 +1,535 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from .action import Action
|
||||
from .action_block import ActionBlock
|
||||
from .action_block_data_schema import ActionBlockDataSchema
|
||||
from .action_block_parameters_item import (
|
||||
ActionBlockParametersItem,
|
||||
ActionBlockParametersItem_AwsSecret,
|
||||
ActionBlockParametersItem_BitwardenCreditCardData,
|
||||
ActionBlockParametersItem_BitwardenLoginCredential,
|
||||
ActionBlockParametersItem_BitwardenSensitiveInformation,
|
||||
ActionBlockParametersItem_Context,
|
||||
ActionBlockParametersItem_Output,
|
||||
ActionBlockParametersItem_Workflow,
|
||||
)
|
||||
from .action_result import ActionResult
|
||||
from .action_result_data import ActionResultData
|
||||
from .action_status import ActionStatus
|
||||
from .action_type import ActionType
|
||||
from .agent_step_output import AgentStepOutput
|
||||
from .ai_suggestion_base import AiSuggestionBase
|
||||
from .ai_suggestion_base_output import AiSuggestionBaseOutput
|
||||
from .ai_suggestion_type import AiSuggestionType
|
||||
from .artifact import Artifact
|
||||
from .artifact_type import ArtifactType
|
||||
from .aws_secret_parameter import AwsSecretParameter
|
||||
from .bitwarden_credit_card_data_parameter import BitwardenCreditCardDataParameter
|
||||
from .bitwarden_login_credential_parameter import BitwardenLoginCredentialParameter
|
||||
from .bitwarden_sensitive_information_parameter import BitwardenSensitiveInformationParameter
|
||||
from .block_type import BlockType
|
||||
from .browser_session_response import BrowserSessionResponse
|
||||
from .code_block import CodeBlock
|
||||
from .code_block_parameters_item import (
|
||||
CodeBlockParametersItem,
|
||||
CodeBlockParametersItem_AwsSecret,
|
||||
CodeBlockParametersItem_BitwardenCreditCardData,
|
||||
CodeBlockParametersItem_BitwardenLoginCredential,
|
||||
CodeBlockParametersItem_BitwardenSensitiveInformation,
|
||||
CodeBlockParametersItem_Context,
|
||||
CodeBlockParametersItem_Output,
|
||||
CodeBlockParametersItem_Workflow,
|
||||
)
|
||||
from .context_parameter import ContextParameter
|
||||
from .context_parameter_source import (
|
||||
ContextParameterSource,
|
||||
ContextParameterSource_AwsSecret,
|
||||
ContextParameterSource_BitwardenCreditCardData,
|
||||
ContextParameterSource_BitwardenLoginCredential,
|
||||
ContextParameterSource_BitwardenSensitiveInformation,
|
||||
ContextParameterSource_Context,
|
||||
ContextParameterSource_Output,
|
||||
ContextParameterSource_Workflow,
|
||||
)
|
||||
from .context_parameter_value import ContextParameterValue
|
||||
from .create_task_response import CreateTaskResponse
|
||||
from .download_to_s_3_block import DownloadToS3Block
|
||||
from .entity_type import EntityType
|
||||
from .extraction_block import ExtractionBlock
|
||||
from .extraction_block_data_schema import ExtractionBlockDataSchema
|
||||
from .extraction_block_parameters_item import (
|
||||
ExtractionBlockParametersItem,
|
||||
ExtractionBlockParametersItem_AwsSecret,
|
||||
ExtractionBlockParametersItem_BitwardenCreditCardData,
|
||||
ExtractionBlockParametersItem_BitwardenLoginCredential,
|
||||
ExtractionBlockParametersItem_BitwardenSensitiveInformation,
|
||||
ExtractionBlockParametersItem_Context,
|
||||
ExtractionBlockParametersItem_Output,
|
||||
ExtractionBlockParametersItem_Workflow,
|
||||
)
|
||||
from .file_download_block import FileDownloadBlock
|
||||
from .file_download_block_data_schema import FileDownloadBlockDataSchema
|
||||
from .file_download_block_parameters_item import (
|
||||
FileDownloadBlockParametersItem,
|
||||
FileDownloadBlockParametersItem_AwsSecret,
|
||||
FileDownloadBlockParametersItem_BitwardenCreditCardData,
|
||||
FileDownloadBlockParametersItem_BitwardenLoginCredential,
|
||||
FileDownloadBlockParametersItem_BitwardenSensitiveInformation,
|
||||
FileDownloadBlockParametersItem_Context,
|
||||
FileDownloadBlockParametersItem_Output,
|
||||
FileDownloadBlockParametersItem_Workflow,
|
||||
)
|
||||
from .file_parser_block import FileParserBlock
|
||||
from .file_type import FileType
|
||||
from .for_loop_block import ForLoopBlock
|
||||
from .for_loop_block_loop_blocks_item import (
|
||||
ForLoopBlockLoopBlocksItem,
|
||||
ForLoopBlockLoopBlocksItem_Action,
|
||||
ForLoopBlockLoopBlocksItem_Code,
|
||||
ForLoopBlockLoopBlocksItem_DownloadToS3,
|
||||
ForLoopBlockLoopBlocksItem_Extraction,
|
||||
ForLoopBlockLoopBlocksItem_FileDownload,
|
||||
ForLoopBlockLoopBlocksItem_FileUrlParser,
|
||||
ForLoopBlockLoopBlocksItem_ForLoop,
|
||||
ForLoopBlockLoopBlocksItem_GotoUrl,
|
||||
ForLoopBlockLoopBlocksItem_Login,
|
||||
ForLoopBlockLoopBlocksItem_Navigation,
|
||||
ForLoopBlockLoopBlocksItem_PdfParser,
|
||||
ForLoopBlockLoopBlocksItem_SendEmail,
|
||||
ForLoopBlockLoopBlocksItem_Task,
|
||||
ForLoopBlockLoopBlocksItem_TaskV2,
|
||||
ForLoopBlockLoopBlocksItem_TextPrompt,
|
||||
ForLoopBlockLoopBlocksItem_UploadToS3,
|
||||
ForLoopBlockLoopBlocksItem_Validation,
|
||||
ForLoopBlockLoopBlocksItem_Wait,
|
||||
)
|
||||
from .for_loop_block_loop_over import (
|
||||
ForLoopBlockLoopOver,
|
||||
ForLoopBlockLoopOver_AwsSecret,
|
||||
ForLoopBlockLoopOver_BitwardenCreditCardData,
|
||||
ForLoopBlockLoopOver_BitwardenLoginCredential,
|
||||
ForLoopBlockLoopOver_BitwardenSensitiveInformation,
|
||||
ForLoopBlockLoopOver_Context,
|
||||
ForLoopBlockLoopOver_Output,
|
||||
ForLoopBlockLoopOver_Workflow,
|
||||
)
|
||||
from .get_organization_api_keys_response import GetOrganizationApiKeysResponse
|
||||
from .get_organizations_response import GetOrganizationsResponse
|
||||
from .http_validation_error import HttpValidationError
|
||||
from .login_block import LoginBlock
|
||||
from .login_block_data_schema import LoginBlockDataSchema
|
||||
from .login_block_parameters_item import (
|
||||
LoginBlockParametersItem,
|
||||
LoginBlockParametersItem_AwsSecret,
|
||||
LoginBlockParametersItem_BitwardenCreditCardData,
|
||||
LoginBlockParametersItem_BitwardenLoginCredential,
|
||||
LoginBlockParametersItem_BitwardenSensitiveInformation,
|
||||
LoginBlockParametersItem_Context,
|
||||
LoginBlockParametersItem_Output,
|
||||
LoginBlockParametersItem_Workflow,
|
||||
)
|
||||
from .navigation_block import NavigationBlock
|
||||
from .navigation_block_data_schema import NavigationBlockDataSchema
|
||||
from .navigation_block_parameters_item import (
|
||||
NavigationBlockParametersItem,
|
||||
NavigationBlockParametersItem_AwsSecret,
|
||||
NavigationBlockParametersItem_BitwardenCreditCardData,
|
||||
NavigationBlockParametersItem_BitwardenLoginCredential,
|
||||
NavigationBlockParametersItem_BitwardenSensitiveInformation,
|
||||
NavigationBlockParametersItem_Context,
|
||||
NavigationBlockParametersItem_Output,
|
||||
NavigationBlockParametersItem_Workflow,
|
||||
)
|
||||
from .observer_task import ObserverTask
|
||||
from .observer_task_output import ObserverTaskOutput
|
||||
from .observer_task_status import ObserverTaskStatus
|
||||
from .observer_thought import ObserverThought
|
||||
from .observer_thought_scenario import ObserverThoughtScenario
|
||||
from .observer_thought_type import ObserverThoughtType
|
||||
from .order_by import OrderBy
|
||||
from .organization import Organization
|
||||
from .organization_auth_token import OrganizationAuthToken
|
||||
from .organization_auth_token_type import OrganizationAuthTokenType
|
||||
from .output_parameter import OutputParameter
|
||||
from .pdf_parser_block import PdfParserBlock
|
||||
from .proxy_location import ProxyLocation
|
||||
from .run_workflow_response import RunWorkflowResponse
|
||||
from .select_option import SelectOption
|
||||
from .send_email_block import SendEmailBlock
|
||||
from .sort_direction import SortDirection
|
||||
from .step import Step
|
||||
from .step_status import StepStatus
|
||||
from .task import Task
|
||||
from .task_base import TaskBase
|
||||
from .task_base_extracted_information_schema import TaskBaseExtractedInformationSchema
|
||||
from .task_base_navigation_payload import TaskBaseNavigationPayload
|
||||
from .task_block import TaskBlock
|
||||
from .task_block_data_schema import TaskBlockDataSchema
|
||||
from .task_block_parameters_item import (
|
||||
TaskBlockParametersItem,
|
||||
TaskBlockParametersItem_AwsSecret,
|
||||
TaskBlockParametersItem_BitwardenCreditCardData,
|
||||
TaskBlockParametersItem_BitwardenLoginCredential,
|
||||
TaskBlockParametersItem_BitwardenSensitiveInformation,
|
||||
TaskBlockParametersItem_Context,
|
||||
TaskBlockParametersItem_Output,
|
||||
TaskBlockParametersItem_Workflow,
|
||||
)
|
||||
from .task_extracted_information import TaskExtractedInformation
|
||||
from .task_extracted_information_schema import TaskExtractedInformationSchema
|
||||
from .task_generation import TaskGeneration
|
||||
from .task_navigation_payload import TaskNavigationPayload
|
||||
from .task_response import TaskResponse
|
||||
from .task_response_extracted_information import TaskResponseExtractedInformation
|
||||
from .task_status import TaskStatus
|
||||
from .task_type import TaskType
|
||||
from .task_v_2_block import TaskV2Block
|
||||
from .text_prompt_block import TextPromptBlock
|
||||
from .text_prompt_block_parameters_item import (
|
||||
TextPromptBlockParametersItem,
|
||||
TextPromptBlockParametersItem_AwsSecret,
|
||||
TextPromptBlockParametersItem_BitwardenCreditCardData,
|
||||
TextPromptBlockParametersItem_BitwardenLoginCredential,
|
||||
TextPromptBlockParametersItem_BitwardenSensitiveInformation,
|
||||
TextPromptBlockParametersItem_Context,
|
||||
TextPromptBlockParametersItem_Output,
|
||||
TextPromptBlockParametersItem_Workflow,
|
||||
)
|
||||
from .totp_code import TotpCode
|
||||
from .upload_to_s_3_block import UploadToS3Block
|
||||
from .url_block import UrlBlock
|
||||
from .url_block_data_schema import UrlBlockDataSchema
|
||||
from .url_block_parameters_item import (
|
||||
UrlBlockParametersItem,
|
||||
UrlBlockParametersItem_AwsSecret,
|
||||
UrlBlockParametersItem_BitwardenCreditCardData,
|
||||
UrlBlockParametersItem_BitwardenLoginCredential,
|
||||
UrlBlockParametersItem_BitwardenSensitiveInformation,
|
||||
UrlBlockParametersItem_Context,
|
||||
UrlBlockParametersItem_Output,
|
||||
UrlBlockParametersItem_Workflow,
|
||||
)
|
||||
from .user_defined_error import UserDefinedError
|
||||
from .validation_block import ValidationBlock
|
||||
from .validation_block_data_schema import ValidationBlockDataSchema
|
||||
from .validation_block_parameters_item import (
|
||||
ValidationBlockParametersItem,
|
||||
ValidationBlockParametersItem_AwsSecret,
|
||||
ValidationBlockParametersItem_BitwardenCreditCardData,
|
||||
ValidationBlockParametersItem_BitwardenLoginCredential,
|
||||
ValidationBlockParametersItem_BitwardenSensitiveInformation,
|
||||
ValidationBlockParametersItem_Context,
|
||||
ValidationBlockParametersItem_Output,
|
||||
ValidationBlockParametersItem_Workflow,
|
||||
)
|
||||
from .validation_error import ValidationError
|
||||
from .validation_error_loc_item import ValidationErrorLocItem
|
||||
from .wait_block import WaitBlock
|
||||
from .wait_block_parameters_item import (
|
||||
WaitBlockParametersItem,
|
||||
WaitBlockParametersItem_AwsSecret,
|
||||
WaitBlockParametersItem_BitwardenCreditCardData,
|
||||
WaitBlockParametersItem_BitwardenLoginCredential,
|
||||
WaitBlockParametersItem_BitwardenSensitiveInformation,
|
||||
WaitBlockParametersItem_Context,
|
||||
WaitBlockParametersItem_Output,
|
||||
WaitBlockParametersItem_Workflow,
|
||||
)
|
||||
from .workflow import Workflow
|
||||
from .workflow_definition import WorkflowDefinition
|
||||
from .workflow_definition_blocks_item import (
|
||||
WorkflowDefinitionBlocksItem,
|
||||
WorkflowDefinitionBlocksItem_Action,
|
||||
WorkflowDefinitionBlocksItem_Code,
|
||||
WorkflowDefinitionBlocksItem_DownloadToS3,
|
||||
WorkflowDefinitionBlocksItem_Extraction,
|
||||
WorkflowDefinitionBlocksItem_FileDownload,
|
||||
WorkflowDefinitionBlocksItem_FileUrlParser,
|
||||
WorkflowDefinitionBlocksItem_ForLoop,
|
||||
WorkflowDefinitionBlocksItem_GotoUrl,
|
||||
WorkflowDefinitionBlocksItem_Login,
|
||||
WorkflowDefinitionBlocksItem_Navigation,
|
||||
WorkflowDefinitionBlocksItem_PdfParser,
|
||||
WorkflowDefinitionBlocksItem_SendEmail,
|
||||
WorkflowDefinitionBlocksItem_Task,
|
||||
WorkflowDefinitionBlocksItem_TaskV2,
|
||||
WorkflowDefinitionBlocksItem_TextPrompt,
|
||||
WorkflowDefinitionBlocksItem_UploadToS3,
|
||||
WorkflowDefinitionBlocksItem_Validation,
|
||||
WorkflowDefinitionBlocksItem_Wait,
|
||||
)
|
||||
from .workflow_definition_parameters_item import (
|
||||
WorkflowDefinitionParametersItem,
|
||||
WorkflowDefinitionParametersItem_AwsSecret,
|
||||
WorkflowDefinitionParametersItem_BitwardenCreditCardData,
|
||||
WorkflowDefinitionParametersItem_BitwardenLoginCredential,
|
||||
WorkflowDefinitionParametersItem_BitwardenSensitiveInformation,
|
||||
WorkflowDefinitionParametersItem_Context,
|
||||
WorkflowDefinitionParametersItem_Output,
|
||||
WorkflowDefinitionParametersItem_Workflow,
|
||||
)
|
||||
from .workflow_parameter import WorkflowParameter
|
||||
from .workflow_parameter_default_value import WorkflowParameterDefaultValue
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
from .workflow_run import WorkflowRun
|
||||
from .workflow_run_block import WorkflowRunBlock
|
||||
from .workflow_run_block_data_schema import WorkflowRunBlockDataSchema
|
||||
from .workflow_run_block_navigation_payload import WorkflowRunBlockNavigationPayload
|
||||
from .workflow_run_block_output import WorkflowRunBlockOutput
|
||||
from .workflow_run_status import WorkflowRunStatus
|
||||
from .workflow_run_status_response import WorkflowRunStatusResponse
|
||||
from .workflow_run_timeline import WorkflowRunTimeline
|
||||
from .workflow_run_timeline_type import WorkflowRunTimelineType
|
||||
from .workflow_status import WorkflowStatus
|
||||
|
||||
__all__ = [
|
||||
"Action",
|
||||
"ActionBlock",
|
||||
"ActionBlockDataSchema",
|
||||
"ActionBlockParametersItem",
|
||||
"ActionBlockParametersItem_AwsSecret",
|
||||
"ActionBlockParametersItem_BitwardenCreditCardData",
|
||||
"ActionBlockParametersItem_BitwardenLoginCredential",
|
||||
"ActionBlockParametersItem_BitwardenSensitiveInformation",
|
||||
"ActionBlockParametersItem_Context",
|
||||
"ActionBlockParametersItem_Output",
|
||||
"ActionBlockParametersItem_Workflow",
|
||||
"ActionResult",
|
||||
"ActionResultData",
|
||||
"ActionStatus",
|
||||
"ActionType",
|
||||
"AgentStepOutput",
|
||||
"AiSuggestionBase",
|
||||
"AiSuggestionBaseOutput",
|
||||
"AiSuggestionType",
|
||||
"Artifact",
|
||||
"ArtifactType",
|
||||
"AwsSecretParameter",
|
||||
"BitwardenCreditCardDataParameter",
|
||||
"BitwardenLoginCredentialParameter",
|
||||
"BitwardenSensitiveInformationParameter",
|
||||
"BlockType",
|
||||
"BrowserSessionResponse",
|
||||
"CodeBlock",
|
||||
"CodeBlockParametersItem",
|
||||
"CodeBlockParametersItem_AwsSecret",
|
||||
"CodeBlockParametersItem_BitwardenCreditCardData",
|
||||
"CodeBlockParametersItem_BitwardenLoginCredential",
|
||||
"CodeBlockParametersItem_BitwardenSensitiveInformation",
|
||||
"CodeBlockParametersItem_Context",
|
||||
"CodeBlockParametersItem_Output",
|
||||
"CodeBlockParametersItem_Workflow",
|
||||
"ContextParameter",
|
||||
"ContextParameterSource",
|
||||
"ContextParameterSource_AwsSecret",
|
||||
"ContextParameterSource_BitwardenCreditCardData",
|
||||
"ContextParameterSource_BitwardenLoginCredential",
|
||||
"ContextParameterSource_BitwardenSensitiveInformation",
|
||||
"ContextParameterSource_Context",
|
||||
"ContextParameterSource_Output",
|
||||
"ContextParameterSource_Workflow",
|
||||
"ContextParameterValue",
|
||||
"CreateTaskResponse",
|
||||
"DownloadToS3Block",
|
||||
"EntityType",
|
||||
"ExtractionBlock",
|
||||
"ExtractionBlockDataSchema",
|
||||
"ExtractionBlockParametersItem",
|
||||
"ExtractionBlockParametersItem_AwsSecret",
|
||||
"ExtractionBlockParametersItem_BitwardenCreditCardData",
|
||||
"ExtractionBlockParametersItem_BitwardenLoginCredential",
|
||||
"ExtractionBlockParametersItem_BitwardenSensitiveInformation",
|
||||
"ExtractionBlockParametersItem_Context",
|
||||
"ExtractionBlockParametersItem_Output",
|
||||
"ExtractionBlockParametersItem_Workflow",
|
||||
"FileDownloadBlock",
|
||||
"FileDownloadBlockDataSchema",
|
||||
"FileDownloadBlockParametersItem",
|
||||
"FileDownloadBlockParametersItem_AwsSecret",
|
||||
"FileDownloadBlockParametersItem_BitwardenCreditCardData",
|
||||
"FileDownloadBlockParametersItem_BitwardenLoginCredential",
|
||||
"FileDownloadBlockParametersItem_BitwardenSensitiveInformation",
|
||||
"FileDownloadBlockParametersItem_Context",
|
||||
"FileDownloadBlockParametersItem_Output",
|
||||
"FileDownloadBlockParametersItem_Workflow",
|
||||
"FileParserBlock",
|
||||
"FileType",
|
||||
"ForLoopBlock",
|
||||
"ForLoopBlockLoopBlocksItem",
|
||||
"ForLoopBlockLoopBlocksItem_Action",
|
||||
"ForLoopBlockLoopBlocksItem_Code",
|
||||
"ForLoopBlockLoopBlocksItem_DownloadToS3",
|
||||
"ForLoopBlockLoopBlocksItem_Extraction",
|
||||
"ForLoopBlockLoopBlocksItem_FileDownload",
|
||||
"ForLoopBlockLoopBlocksItem_FileUrlParser",
|
||||
"ForLoopBlockLoopBlocksItem_ForLoop",
|
||||
"ForLoopBlockLoopBlocksItem_GotoUrl",
|
||||
"ForLoopBlockLoopBlocksItem_Login",
|
||||
"ForLoopBlockLoopBlocksItem_Navigation",
|
||||
"ForLoopBlockLoopBlocksItem_PdfParser",
|
||||
"ForLoopBlockLoopBlocksItem_SendEmail",
|
||||
"ForLoopBlockLoopBlocksItem_Task",
|
||||
"ForLoopBlockLoopBlocksItem_TaskV2",
|
||||
"ForLoopBlockLoopBlocksItem_TextPrompt",
|
||||
"ForLoopBlockLoopBlocksItem_UploadToS3",
|
||||
"ForLoopBlockLoopBlocksItem_Validation",
|
||||
"ForLoopBlockLoopBlocksItem_Wait",
|
||||
"ForLoopBlockLoopOver",
|
||||
"ForLoopBlockLoopOver_AwsSecret",
|
||||
"ForLoopBlockLoopOver_BitwardenCreditCardData",
|
||||
"ForLoopBlockLoopOver_BitwardenLoginCredential",
|
||||
"ForLoopBlockLoopOver_BitwardenSensitiveInformation",
|
||||
"ForLoopBlockLoopOver_Context",
|
||||
"ForLoopBlockLoopOver_Output",
|
||||
"ForLoopBlockLoopOver_Workflow",
|
||||
"GetOrganizationApiKeysResponse",
|
||||
"GetOrganizationsResponse",
|
||||
"HttpValidationError",
|
||||
"LoginBlock",
|
||||
"LoginBlockDataSchema",
|
||||
"LoginBlockParametersItem",
|
||||
"LoginBlockParametersItem_AwsSecret",
|
||||
"LoginBlockParametersItem_BitwardenCreditCardData",
|
||||
"LoginBlockParametersItem_BitwardenLoginCredential",
|
||||
"LoginBlockParametersItem_BitwardenSensitiveInformation",
|
||||
"LoginBlockParametersItem_Context",
|
||||
"LoginBlockParametersItem_Output",
|
||||
"LoginBlockParametersItem_Workflow",
|
||||
"NavigationBlock",
|
||||
"NavigationBlockDataSchema",
|
||||
"NavigationBlockParametersItem",
|
||||
"NavigationBlockParametersItem_AwsSecret",
|
||||
"NavigationBlockParametersItem_BitwardenCreditCardData",
|
||||
"NavigationBlockParametersItem_BitwardenLoginCredential",
|
||||
"NavigationBlockParametersItem_BitwardenSensitiveInformation",
|
||||
"NavigationBlockParametersItem_Context",
|
||||
"NavigationBlockParametersItem_Output",
|
||||
"NavigationBlockParametersItem_Workflow",
|
||||
"ObserverTask",
|
||||
"ObserverTaskOutput",
|
||||
"ObserverTaskStatus",
|
||||
"ObserverThought",
|
||||
"ObserverThoughtScenario",
|
||||
"ObserverThoughtType",
|
||||
"OrderBy",
|
||||
"Organization",
|
||||
"OrganizationAuthToken",
|
||||
"OrganizationAuthTokenType",
|
||||
"OutputParameter",
|
||||
"PdfParserBlock",
|
||||
"ProxyLocation",
|
||||
"RunWorkflowResponse",
|
||||
"SelectOption",
|
||||
"SendEmailBlock",
|
||||
"SortDirection",
|
||||
"Step",
|
||||
"StepStatus",
|
||||
"Task",
|
||||
"TaskBase",
|
||||
"TaskBaseExtractedInformationSchema",
|
||||
"TaskBaseNavigationPayload",
|
||||
"TaskBlock",
|
||||
"TaskBlockDataSchema",
|
||||
"TaskBlockParametersItem",
|
||||
"TaskBlockParametersItem_AwsSecret",
|
||||
"TaskBlockParametersItem_BitwardenCreditCardData",
|
||||
"TaskBlockParametersItem_BitwardenLoginCredential",
|
||||
"TaskBlockParametersItem_BitwardenSensitiveInformation",
|
||||
"TaskBlockParametersItem_Context",
|
||||
"TaskBlockParametersItem_Output",
|
||||
"TaskBlockParametersItem_Workflow",
|
||||
"TaskExtractedInformation",
|
||||
"TaskExtractedInformationSchema",
|
||||
"TaskGeneration",
|
||||
"TaskNavigationPayload",
|
||||
"TaskResponse",
|
||||
"TaskResponseExtractedInformation",
|
||||
"TaskStatus",
|
||||
"TaskType",
|
||||
"TaskV2Block",
|
||||
"TextPromptBlock",
|
||||
"TextPromptBlockParametersItem",
|
||||
"TextPromptBlockParametersItem_AwsSecret",
|
||||
"TextPromptBlockParametersItem_BitwardenCreditCardData",
|
||||
"TextPromptBlockParametersItem_BitwardenLoginCredential",
|
||||
"TextPromptBlockParametersItem_BitwardenSensitiveInformation",
|
||||
"TextPromptBlockParametersItem_Context",
|
||||
"TextPromptBlockParametersItem_Output",
|
||||
"TextPromptBlockParametersItem_Workflow",
|
||||
"TotpCode",
|
||||
"UploadToS3Block",
|
||||
"UrlBlock",
|
||||
"UrlBlockDataSchema",
|
||||
"UrlBlockParametersItem",
|
||||
"UrlBlockParametersItem_AwsSecret",
|
||||
"UrlBlockParametersItem_BitwardenCreditCardData",
|
||||
"UrlBlockParametersItem_BitwardenLoginCredential",
|
||||
"UrlBlockParametersItem_BitwardenSensitiveInformation",
|
||||
"UrlBlockParametersItem_Context",
|
||||
"UrlBlockParametersItem_Output",
|
||||
"UrlBlockParametersItem_Workflow",
|
||||
"UserDefinedError",
|
||||
"ValidationBlock",
|
||||
"ValidationBlockDataSchema",
|
||||
"ValidationBlockParametersItem",
|
||||
"ValidationBlockParametersItem_AwsSecret",
|
||||
"ValidationBlockParametersItem_BitwardenCreditCardData",
|
||||
"ValidationBlockParametersItem_BitwardenLoginCredential",
|
||||
"ValidationBlockParametersItem_BitwardenSensitiveInformation",
|
||||
"ValidationBlockParametersItem_Context",
|
||||
"ValidationBlockParametersItem_Output",
|
||||
"ValidationBlockParametersItem_Workflow",
|
||||
"ValidationError",
|
||||
"ValidationErrorLocItem",
|
||||
"WaitBlock",
|
||||
"WaitBlockParametersItem",
|
||||
"WaitBlockParametersItem_AwsSecret",
|
||||
"WaitBlockParametersItem_BitwardenCreditCardData",
|
||||
"WaitBlockParametersItem_BitwardenLoginCredential",
|
||||
"WaitBlockParametersItem_BitwardenSensitiveInformation",
|
||||
"WaitBlockParametersItem_Context",
|
||||
"WaitBlockParametersItem_Output",
|
||||
"WaitBlockParametersItem_Workflow",
|
||||
"Workflow",
|
||||
"WorkflowDefinition",
|
||||
"WorkflowDefinitionBlocksItem",
|
||||
"WorkflowDefinitionBlocksItem_Action",
|
||||
"WorkflowDefinitionBlocksItem_Code",
|
||||
"WorkflowDefinitionBlocksItem_DownloadToS3",
|
||||
"WorkflowDefinitionBlocksItem_Extraction",
|
||||
"WorkflowDefinitionBlocksItem_FileDownload",
|
||||
"WorkflowDefinitionBlocksItem_FileUrlParser",
|
||||
"WorkflowDefinitionBlocksItem_ForLoop",
|
||||
"WorkflowDefinitionBlocksItem_GotoUrl",
|
||||
"WorkflowDefinitionBlocksItem_Login",
|
||||
"WorkflowDefinitionBlocksItem_Navigation",
|
||||
"WorkflowDefinitionBlocksItem_PdfParser",
|
||||
"WorkflowDefinitionBlocksItem_SendEmail",
|
||||
"WorkflowDefinitionBlocksItem_Task",
|
||||
"WorkflowDefinitionBlocksItem_TaskV2",
|
||||
"WorkflowDefinitionBlocksItem_TextPrompt",
|
||||
"WorkflowDefinitionBlocksItem_UploadToS3",
|
||||
"WorkflowDefinitionBlocksItem_Validation",
|
||||
"WorkflowDefinitionBlocksItem_Wait",
|
||||
"WorkflowDefinitionParametersItem",
|
||||
"WorkflowDefinitionParametersItem_AwsSecret",
|
||||
"WorkflowDefinitionParametersItem_BitwardenCreditCardData",
|
||||
"WorkflowDefinitionParametersItem_BitwardenLoginCredential",
|
||||
"WorkflowDefinitionParametersItem_BitwardenSensitiveInformation",
|
||||
"WorkflowDefinitionParametersItem_Context",
|
||||
"WorkflowDefinitionParametersItem_Output",
|
||||
"WorkflowDefinitionParametersItem_Workflow",
|
||||
"WorkflowParameter",
|
||||
"WorkflowParameterDefaultValue",
|
||||
"WorkflowParameterType",
|
||||
"WorkflowRun",
|
||||
"WorkflowRunBlock",
|
||||
"WorkflowRunBlockDataSchema",
|
||||
"WorkflowRunBlockNavigationPayload",
|
||||
"WorkflowRunBlockOutput",
|
||||
"WorkflowRunStatus",
|
||||
"WorkflowRunStatusResponse",
|
||||
"WorkflowRunTimeline",
|
||||
"WorkflowRunTimelineType",
|
||||
"WorkflowStatus",
|
||||
]
|
||||
52
skyvern/client/types/action.py
Normal file
52
skyvern/client/types/action.py
Normal file
@@ -0,0 +1,52 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .action_type import ActionType
|
||||
import typing
|
||||
from .action_status import ActionStatus
|
||||
from .user_defined_error import UserDefinedError
|
||||
from .select_option import SelectOption
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
|
||||
|
||||
class Action(UniversalBaseModel):
|
||||
action_type: ActionType
|
||||
status: typing.Optional[ActionStatus] = None
|
||||
action_id: typing.Optional[str] = None
|
||||
source_action_id: typing.Optional[str] = None
|
||||
organization_id: typing.Optional[str] = None
|
||||
workflow_run_id: typing.Optional[str] = None
|
||||
task_id: typing.Optional[str] = None
|
||||
step_id: typing.Optional[str] = None
|
||||
step_order: typing.Optional[int] = None
|
||||
action_order: typing.Optional[int] = None
|
||||
confidence_float: typing.Optional[float] = None
|
||||
description: typing.Optional[str] = None
|
||||
reasoning: typing.Optional[str] = None
|
||||
intention: typing.Optional[str] = None
|
||||
response: typing.Optional[str] = None
|
||||
element_id: typing.Optional[str] = None
|
||||
skyvern_element_hash: typing.Optional[str] = None
|
||||
skyvern_element_data: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
|
||||
errors: typing.Optional[typing.List[UserDefinedError]] = None
|
||||
data_extraction_goal: typing.Optional[str] = None
|
||||
file_name: typing.Optional[str] = None
|
||||
file_url: typing.Optional[str] = None
|
||||
download: typing.Optional[bool] = None
|
||||
is_upload_file_tag: typing.Optional[bool] = None
|
||||
text: typing.Optional[str] = None
|
||||
option: typing.Optional[SelectOption] = None
|
||||
is_checked: typing.Optional[bool] = None
|
||||
created_at: typing.Optional[dt.datetime] = None
|
||||
modified_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
47
skyvern/client/types/action_block.py
Normal file
47
skyvern/client/types/action_block.py
Normal file
@@ -0,0 +1,47 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .context_parameter import ContextParameter
|
||||
from .output_parameter import OutputParameter
|
||||
import typing
|
||||
from .action_block_data_schema import ActionBlockDataSchema
|
||||
from .action_block_parameters_item import ActionBlockParametersItem
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
|
||||
|
||||
class ActionBlock(UniversalBaseModel):
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
task_type: typing.Optional[str] = None
|
||||
url: typing.Optional[str] = None
|
||||
title: typing.Optional[str] = None
|
||||
complete_criterion: typing.Optional[str] = None
|
||||
terminate_criterion: typing.Optional[str] = None
|
||||
navigation_goal: typing.Optional[str] = None
|
||||
data_extraction_goal: typing.Optional[str] = None
|
||||
data_schema: typing.Optional[ActionBlockDataSchema] = None
|
||||
error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None
|
||||
max_retries: typing.Optional[int] = None
|
||||
max_steps_per_run: typing.Optional[int] = None
|
||||
parameters: typing.Optional[typing.List[ActionBlockParametersItem]] = None
|
||||
complete_on_download: typing.Optional[bool] = None
|
||||
download_suffix: typing.Optional[str] = None
|
||||
totp_verification_url: typing.Optional[str] = None
|
||||
totp_identifier: typing.Optional[str] = None
|
||||
cache_actions: typing.Optional[bool] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
update_forward_refs(ContextParameter, ActionBlock=ActionBlock)
|
||||
7
skyvern/client/types/action_block_data_schema.py
Normal file
7
skyvern/client/types/action_block_data_schema.py
Normal file
@@ -0,0 +1,7 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
ActionBlockDataSchema = typing.Union[
|
||||
typing.Dict[str, typing.Optional[typing.Any]], typing.List[typing.Optional[typing.Any]]
|
||||
]
|
||||
185
skyvern/client/types/action_block_parameters_item.py
Normal file
185
skyvern/client/types/action_block_parameters_item.py
Normal file
@@ -0,0 +1,185 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from .context_parameter_value import ContextParameterValue
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
from .workflow_parameter_default_value import WorkflowParameterDefaultValue
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
|
||||
|
||||
class ActionBlockParametersItem_AwsSecret(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["aws_secret"] = "aws_secret"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
aws_secret_parameter_id: str
|
||||
workflow_id: str
|
||||
aws_key: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ActionBlockParametersItem_BitwardenCreditCardData(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_credit_card_data"] = "bitwarden_credit_card_data"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_credit_card_data_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
bitwarden_collection_id: str
|
||||
bitwarden_item_id: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ActionBlockParametersItem_BitwardenLoginCredential(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_login_credential"] = "bitwarden_login_credential"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_login_credential_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
url_parameter_key: str
|
||||
bitwarden_collection_id: typing.Optional[str] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ActionBlockParametersItem_BitwardenSensitiveInformation(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_sensitive_information"] = "bitwarden_sensitive_information"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_sensitive_information_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
bitwarden_collection_id: str
|
||||
bitwarden_identity_key: str
|
||||
bitwarden_identity_fields: typing.List[str]
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ActionBlockParametersItem_Context(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["context"] = "context"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
source: "ContextParameterSource"
|
||||
value: typing.Optional[ContextParameterValue] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402
|
||||
|
||||
|
||||
class ActionBlockParametersItem_Output(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["output"] = "output"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
output_parameter_id: str
|
||||
workflow_id: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ActionBlockParametersItem_Workflow(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["workflow"] = "workflow"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
workflow_parameter_id: str
|
||||
workflow_parameter_type: WorkflowParameterType
|
||||
workflow_id: str
|
||||
default_value: typing.Optional[WorkflowParameterDefaultValue] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
ActionBlockParametersItem = typing.Union[
|
||||
ActionBlockParametersItem_AwsSecret,
|
||||
ActionBlockParametersItem_BitwardenCreditCardData,
|
||||
ActionBlockParametersItem_BitwardenLoginCredential,
|
||||
ActionBlockParametersItem_BitwardenSensitiveInformation,
|
||||
ActionBlockParametersItem_Context,
|
||||
ActionBlockParametersItem_Output,
|
||||
ActionBlockParametersItem_Workflow,
|
||||
]
|
||||
update_forward_refs(ContextParameter, ActionBlockParametersItem_Context=ActionBlockParametersItem_Context)
|
||||
update_forward_refs(ActionBlockParametersItem_Context)
|
||||
30
skyvern/client/types/action_result.py
Normal file
30
skyvern/client/types/action_result.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from .action_result_data import ActionResultData
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
|
||||
|
||||
class ActionResult(UniversalBaseModel):
|
||||
success: bool
|
||||
stop_execution_on_failure: typing.Optional[bool] = None
|
||||
exception_type: typing.Optional[str] = None
|
||||
exception_message: typing.Optional[str] = None
|
||||
data: typing.Optional[ActionResultData] = None
|
||||
step_retry_number: typing.Optional[int] = None
|
||||
step_order: typing.Optional[int] = None
|
||||
download_triggered: typing.Optional[bool] = None
|
||||
interacted_with_sibling: typing.Optional[bool] = None
|
||||
interacted_with_parent: typing.Optional[bool] = None
|
||||
skip_remaining_actions: typing.Optional[bool] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
7
skyvern/client/types/action_result_data.py
Normal file
7
skyvern/client/types/action_result_data.py
Normal file
@@ -0,0 +1,7 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
ActionResultData = typing.Union[
|
||||
typing.Dict[str, typing.Optional[typing.Any]], typing.List[typing.Optional[typing.Any]], str
|
||||
]
|
||||
5
skyvern/client/types/action_status.py
Normal file
5
skyvern/client/types/action_status.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
ActionStatus = typing.Union[typing.Literal["pending", "skipped", "failed", "completed"], typing.Any]
|
||||
22
skyvern/client/types/action_type.py
Normal file
22
skyvern/client/types/action_type.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
ActionType = typing.Union[
|
||||
typing.Literal[
|
||||
"click",
|
||||
"input_text",
|
||||
"upload_file",
|
||||
"download_file",
|
||||
"select_option",
|
||||
"checkbox",
|
||||
"wait",
|
||||
"null_action",
|
||||
"solve_captcha",
|
||||
"terminate",
|
||||
"complete",
|
||||
"reload_page",
|
||||
"extract",
|
||||
],
|
||||
typing.Any,
|
||||
]
|
||||
27
skyvern/client/types/agent_step_output.py
Normal file
27
skyvern/client/types/agent_step_output.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from .action_result import ActionResult
|
||||
from .user_defined_error import UserDefinedError
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
|
||||
|
||||
class AgentStepOutput(UniversalBaseModel):
|
||||
"""
|
||||
Output of the agent step, this is recorded in the database.
|
||||
"""
|
||||
|
||||
action_results: typing.Optional[typing.List[ActionResult]] = None
|
||||
actions_and_results: typing.Optional[typing.List[typing.List[typing.Optional[typing.Any]]]] = None
|
||||
errors: typing.Optional[typing.List[UserDefinedError]] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
20
skyvern/client/types/ai_suggestion_base.py
Normal file
20
skyvern/client/types/ai_suggestion_base.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from .ai_suggestion_base_output import AiSuggestionBaseOutput
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
|
||||
|
||||
class AiSuggestionBase(UniversalBaseModel):
|
||||
output: typing.Optional[AiSuggestionBaseOutput] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
5
skyvern/client/types/ai_suggestion_base_output.py
Normal file
5
skyvern/client/types/ai_suggestion_base_output.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
AiSuggestionBaseOutput = typing.Union[typing.Dict[str, typing.Optional[typing.Any]], str]
|
||||
5
skyvern/client/types/ai_suggestion_type.py
Normal file
5
skyvern/client/types/ai_suggestion_type.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
AiSuggestionType = typing.Literal["data_schema"]
|
||||
41
skyvern/client/types/artifact.py
Normal file
41
skyvern/client/types/artifact.py
Normal file
@@ -0,0 +1,41 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import pydantic
|
||||
from .artifact_type import ArtifactType
|
||||
import typing
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
|
||||
class Artifact(UniversalBaseModel):
|
||||
created_at: str = pydantic.Field()
|
||||
"""
|
||||
The creation datetime of the task.
|
||||
"""
|
||||
|
||||
modified_at: str = pydantic.Field()
|
||||
"""
|
||||
The modification datetime of the task.
|
||||
"""
|
||||
|
||||
artifact_id: str
|
||||
artifact_type: ArtifactType
|
||||
uri: str
|
||||
task_id: typing.Optional[str] = None
|
||||
step_id: typing.Optional[str] = None
|
||||
workflow_run_id: typing.Optional[str] = None
|
||||
workflow_run_block_id: typing.Optional[str] = None
|
||||
observer_cruise_id: typing.Optional[str] = None
|
||||
observer_thought_id: typing.Optional[str] = None
|
||||
ai_suggestion_id: typing.Optional[str] = None
|
||||
signed_url: typing.Optional[str] = None
|
||||
organization_id: typing.Optional[str] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
34
skyvern/client/types/artifact_type.py
Normal file
34
skyvern/client/types/artifact_type.py
Normal file
@@ -0,0 +1,34 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
ArtifactType = typing.Union[
|
||||
typing.Literal[
|
||||
"recording",
|
||||
"browser_console_log",
|
||||
"skyvern_log",
|
||||
"skyvern_log_raw",
|
||||
"screenshot",
|
||||
"screenshot_llm",
|
||||
"screenshot_action",
|
||||
"screenshot_final",
|
||||
"llm_prompt",
|
||||
"llm_request",
|
||||
"llm_response",
|
||||
"llm_response_parsed",
|
||||
"llm_response_rendered",
|
||||
"visible_elements_id_css_map",
|
||||
"visible_elements_id_frame_map",
|
||||
"visible_elements_tree",
|
||||
"visible_elements_tree_trimmed",
|
||||
"visible_elements_tree_in_prompt",
|
||||
"hashed_href_map",
|
||||
"visible_elements_id_xpath_map",
|
||||
"html",
|
||||
"html_scrape",
|
||||
"html_action",
|
||||
"trace",
|
||||
"har",
|
||||
],
|
||||
typing.Any,
|
||||
]
|
||||
27
skyvern/client/types/aws_secret_parameter.py
Normal file
27
skyvern/client/types/aws_secret_parameter.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
|
||||
|
||||
class AwsSecretParameter(UniversalBaseModel):
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
aws_secret_parameter_id: str
|
||||
workflow_id: str
|
||||
aws_key: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
31
skyvern/client/types/bitwarden_credit_card_data_parameter.py
Normal file
31
skyvern/client/types/bitwarden_credit_card_data_parameter.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
|
||||
|
||||
class BitwardenCreditCardDataParameter(UniversalBaseModel):
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_credit_card_data_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
bitwarden_collection_id: str
|
||||
bitwarden_item_id: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
31
skyvern/client/types/bitwarden_login_credential_parameter.py
Normal file
31
skyvern/client/types/bitwarden_login_credential_parameter.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
|
||||
|
||||
class BitwardenLoginCredentialParameter(UniversalBaseModel):
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_login_credential_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
url_parameter_key: str
|
||||
bitwarden_collection_id: typing.Optional[str] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
@@ -0,0 +1,32 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
|
||||
|
||||
class BitwardenSensitiveInformationParameter(UniversalBaseModel):
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_sensitive_information_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
bitwarden_collection_id: str
|
||||
bitwarden_identity_key: str
|
||||
bitwarden_identity_fields: typing.List[str]
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
27
skyvern/client/types/block_type.py
Normal file
27
skyvern/client/types/block_type.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
BlockType = typing.Union[
|
||||
typing.Literal[
|
||||
"task",
|
||||
"task_v2",
|
||||
"for_loop",
|
||||
"code",
|
||||
"text_prompt",
|
||||
"download_to_s3",
|
||||
"upload_to_s3",
|
||||
"send_email",
|
||||
"file_url_parser",
|
||||
"validation",
|
||||
"action",
|
||||
"navigation",
|
||||
"extraction",
|
||||
"login",
|
||||
"wait",
|
||||
"file_download",
|
||||
"goto_url",
|
||||
"pdf_parser",
|
||||
],
|
||||
typing.Any,
|
||||
]
|
||||
26
skyvern/client/types/browser_session_response.py
Normal file
26
skyvern/client/types/browser_session_response.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
|
||||
|
||||
class BrowserSessionResponse(UniversalBaseModel):
|
||||
session_id: str
|
||||
organization_id: str
|
||||
runnable_type: typing.Optional[str] = None
|
||||
runnable_id: typing.Optional[str] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
31
skyvern/client/types/code_block.py
Normal file
31
skyvern/client/types/code_block.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .context_parameter import ContextParameter
|
||||
from .output_parameter import OutputParameter
|
||||
import typing
|
||||
from .code_block_parameters_item import CodeBlockParametersItem
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
|
||||
|
||||
class CodeBlock(UniversalBaseModel):
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
code: str
|
||||
parameters: typing.Optional[typing.List[CodeBlockParametersItem]] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
update_forward_refs(ContextParameter, CodeBlock=CodeBlock)
|
||||
185
skyvern/client/types/code_block_parameters_item.py
Normal file
185
skyvern/client/types/code_block_parameters_item.py
Normal file
@@ -0,0 +1,185 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from .context_parameter_value import ContextParameterValue
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
from .workflow_parameter_default_value import WorkflowParameterDefaultValue
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
|
||||
|
||||
class CodeBlockParametersItem_AwsSecret(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["aws_secret"] = "aws_secret"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
aws_secret_parameter_id: str
|
||||
workflow_id: str
|
||||
aws_key: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class CodeBlockParametersItem_BitwardenCreditCardData(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_credit_card_data"] = "bitwarden_credit_card_data"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_credit_card_data_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
bitwarden_collection_id: str
|
||||
bitwarden_item_id: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class CodeBlockParametersItem_BitwardenLoginCredential(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_login_credential"] = "bitwarden_login_credential"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_login_credential_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
url_parameter_key: str
|
||||
bitwarden_collection_id: typing.Optional[str] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class CodeBlockParametersItem_BitwardenSensitiveInformation(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_sensitive_information"] = "bitwarden_sensitive_information"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_sensitive_information_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
bitwarden_collection_id: str
|
||||
bitwarden_identity_key: str
|
||||
bitwarden_identity_fields: typing.List[str]
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class CodeBlockParametersItem_Context(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["context"] = "context"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
source: "ContextParameterSource"
|
||||
value: typing.Optional[ContextParameterValue] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402
|
||||
|
||||
|
||||
class CodeBlockParametersItem_Output(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["output"] = "output"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
output_parameter_id: str
|
||||
workflow_id: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class CodeBlockParametersItem_Workflow(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["workflow"] = "workflow"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
workflow_parameter_id: str
|
||||
workflow_parameter_type: WorkflowParameterType
|
||||
workflow_id: str
|
||||
default_value: typing.Optional[WorkflowParameterDefaultValue] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
CodeBlockParametersItem = typing.Union[
|
||||
CodeBlockParametersItem_AwsSecret,
|
||||
CodeBlockParametersItem_BitwardenCreditCardData,
|
||||
CodeBlockParametersItem_BitwardenLoginCredential,
|
||||
CodeBlockParametersItem_BitwardenSensitiveInformation,
|
||||
CodeBlockParametersItem_Context,
|
||||
CodeBlockParametersItem_Output,
|
||||
CodeBlockParametersItem_Workflow,
|
||||
]
|
||||
update_forward_refs(ContextParameter, CodeBlockParametersItem_Context=CodeBlockParametersItem_Context)
|
||||
update_forward_refs(CodeBlockParametersItem_Context)
|
||||
30
skyvern/client/types/context_parameter.py
Normal file
30
skyvern/client/types/context_parameter.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from .context_parameter_value import ContextParameterValue
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
|
||||
|
||||
class ContextParameter(UniversalBaseModel):
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
source: "ContextParameterSource"
|
||||
value: typing.Optional[ContextParameterValue] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402
|
||||
|
||||
update_forward_refs(ContextParameter)
|
||||
184
skyvern/client/types/context_parameter_source.py
Normal file
184
skyvern/client/types/context_parameter_source.py
Normal file
@@ -0,0 +1,184 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
from .workflow_parameter_default_value import WorkflowParameterDefaultValue
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from .context_parameter_value import ContextParameterValue
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
|
||||
|
||||
class ContextParameterSource_Workflow(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["workflow"] = "workflow"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
workflow_parameter_id: str
|
||||
workflow_parameter_type: WorkflowParameterType
|
||||
workflow_id: str
|
||||
default_value: typing.Optional[WorkflowParameterDefaultValue] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ContextParameterSource_Context(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["context"] = "context"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
source: "ContextParameterSource"
|
||||
value: typing.Optional[ContextParameterValue] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402
|
||||
|
||||
|
||||
class ContextParameterSource_AwsSecret(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["aws_secret"] = "aws_secret"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
aws_secret_parameter_id: str
|
||||
workflow_id: str
|
||||
aws_key: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ContextParameterSource_BitwardenLoginCredential(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_login_credential"] = "bitwarden_login_credential"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_login_credential_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
url_parameter_key: str
|
||||
bitwarden_collection_id: typing.Optional[str] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ContextParameterSource_BitwardenSensitiveInformation(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_sensitive_information"] = "bitwarden_sensitive_information"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_sensitive_information_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
bitwarden_collection_id: str
|
||||
bitwarden_identity_key: str
|
||||
bitwarden_identity_fields: typing.List[str]
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ContextParameterSource_BitwardenCreditCardData(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_credit_card_data"] = "bitwarden_credit_card_data"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_credit_card_data_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
bitwarden_collection_id: str
|
||||
bitwarden_item_id: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ContextParameterSource_Output(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["output"] = "output"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
output_parameter_id: str
|
||||
workflow_id: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
ContextParameterSource = typing.Union[
|
||||
ContextParameterSource_Workflow,
|
||||
ContextParameterSource_Context,
|
||||
ContextParameterSource_AwsSecret,
|
||||
ContextParameterSource_BitwardenLoginCredential,
|
||||
ContextParameterSource_BitwardenSensitiveInformation,
|
||||
ContextParameterSource_BitwardenCreditCardData,
|
||||
ContextParameterSource_Output,
|
||||
]
|
||||
update_forward_refs(ContextParameter, ContextParameterSource_Context=ContextParameterSource_Context)
|
||||
update_forward_refs(ContextParameterSource_Context)
|
||||
7
skyvern/client/types/context_parameter_value.py
Normal file
7
skyvern/client/types/context_parameter_value.py
Normal file
@@ -0,0 +1,7 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
ContextParameterValue = typing.Union[
|
||||
str, int, float, bool, typing.Dict[str, typing.Optional[typing.Any]], typing.List[typing.Optional[typing.Any]]
|
||||
]
|
||||
19
skyvern/client/types/create_task_response.py
Normal file
19
skyvern/client/types/create_task_response.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
import pydantic
|
||||
|
||||
|
||||
class CreateTaskResponse(UniversalBaseModel):
|
||||
task_id: str
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
23
skyvern/client/types/download_to_s_3_block.py
Normal file
23
skyvern/client/types/download_to_s_3_block.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .output_parameter import OutputParameter
|
||||
import typing
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
|
||||
|
||||
class DownloadToS3Block(UniversalBaseModel):
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
url: str
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
7
skyvern/client/types/entity_type.py
Normal file
7
skyvern/client/types/entity_type.py
Normal file
@@ -0,0 +1,7 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
EntityType = typing.Union[
|
||||
typing.Literal["step", "task", "workflow_run", "workflow_run_block", "observer_thought"], typing.Any
|
||||
]
|
||||
47
skyvern/client/types/extraction_block.py
Normal file
47
skyvern/client/types/extraction_block.py
Normal file
@@ -0,0 +1,47 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .context_parameter import ContextParameter
|
||||
from .output_parameter import OutputParameter
|
||||
import typing
|
||||
from .extraction_block_data_schema import ExtractionBlockDataSchema
|
||||
from .extraction_block_parameters_item import ExtractionBlockParametersItem
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
|
||||
|
||||
class ExtractionBlock(UniversalBaseModel):
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
task_type: typing.Optional[str] = None
|
||||
url: typing.Optional[str] = None
|
||||
title: typing.Optional[str] = None
|
||||
complete_criterion: typing.Optional[str] = None
|
||||
terminate_criterion: typing.Optional[str] = None
|
||||
navigation_goal: typing.Optional[str] = None
|
||||
data_extraction_goal: str
|
||||
data_schema: typing.Optional[ExtractionBlockDataSchema] = None
|
||||
error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None
|
||||
max_retries: typing.Optional[int] = None
|
||||
max_steps_per_run: typing.Optional[int] = None
|
||||
parameters: typing.Optional[typing.List[ExtractionBlockParametersItem]] = None
|
||||
complete_on_download: typing.Optional[bool] = None
|
||||
download_suffix: typing.Optional[str] = None
|
||||
totp_verification_url: typing.Optional[str] = None
|
||||
totp_identifier: typing.Optional[str] = None
|
||||
cache_actions: typing.Optional[bool] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
update_forward_refs(ContextParameter, ExtractionBlock=ExtractionBlock)
|
||||
7
skyvern/client/types/extraction_block_data_schema.py
Normal file
7
skyvern/client/types/extraction_block_data_schema.py
Normal file
@@ -0,0 +1,7 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
ExtractionBlockDataSchema = typing.Union[
|
||||
typing.Dict[str, typing.Optional[typing.Any]], typing.List[typing.Optional[typing.Any]]
|
||||
]
|
||||
185
skyvern/client/types/extraction_block_parameters_item.py
Normal file
185
skyvern/client/types/extraction_block_parameters_item.py
Normal file
@@ -0,0 +1,185 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from .context_parameter_value import ContextParameterValue
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
from .workflow_parameter_default_value import WorkflowParameterDefaultValue
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
|
||||
|
||||
class ExtractionBlockParametersItem_AwsSecret(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["aws_secret"] = "aws_secret"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
aws_secret_parameter_id: str
|
||||
workflow_id: str
|
||||
aws_key: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ExtractionBlockParametersItem_BitwardenCreditCardData(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_credit_card_data"] = "bitwarden_credit_card_data"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_credit_card_data_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
bitwarden_collection_id: str
|
||||
bitwarden_item_id: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ExtractionBlockParametersItem_BitwardenLoginCredential(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_login_credential"] = "bitwarden_login_credential"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_login_credential_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
url_parameter_key: str
|
||||
bitwarden_collection_id: typing.Optional[str] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ExtractionBlockParametersItem_BitwardenSensitiveInformation(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_sensitive_information"] = "bitwarden_sensitive_information"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_sensitive_information_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
bitwarden_collection_id: str
|
||||
bitwarden_identity_key: str
|
||||
bitwarden_identity_fields: typing.List[str]
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ExtractionBlockParametersItem_Context(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["context"] = "context"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
source: "ContextParameterSource"
|
||||
value: typing.Optional[ContextParameterValue] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402
|
||||
|
||||
|
||||
class ExtractionBlockParametersItem_Output(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["output"] = "output"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
output_parameter_id: str
|
||||
workflow_id: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ExtractionBlockParametersItem_Workflow(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["workflow"] = "workflow"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
workflow_parameter_id: str
|
||||
workflow_parameter_type: WorkflowParameterType
|
||||
workflow_id: str
|
||||
default_value: typing.Optional[WorkflowParameterDefaultValue] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
ExtractionBlockParametersItem = typing.Union[
|
||||
ExtractionBlockParametersItem_AwsSecret,
|
||||
ExtractionBlockParametersItem_BitwardenCreditCardData,
|
||||
ExtractionBlockParametersItem_BitwardenLoginCredential,
|
||||
ExtractionBlockParametersItem_BitwardenSensitiveInformation,
|
||||
ExtractionBlockParametersItem_Context,
|
||||
ExtractionBlockParametersItem_Output,
|
||||
ExtractionBlockParametersItem_Workflow,
|
||||
]
|
||||
update_forward_refs(ContextParameter, ExtractionBlockParametersItem_Context=ExtractionBlockParametersItem_Context)
|
||||
update_forward_refs(ExtractionBlockParametersItem_Context)
|
||||
47
skyvern/client/types/file_download_block.py
Normal file
47
skyvern/client/types/file_download_block.py
Normal file
@@ -0,0 +1,47 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .context_parameter import ContextParameter
|
||||
from .output_parameter import OutputParameter
|
||||
import typing
|
||||
from .file_download_block_data_schema import FileDownloadBlockDataSchema
|
||||
from .file_download_block_parameters_item import FileDownloadBlockParametersItem
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
|
||||
|
||||
class FileDownloadBlock(UniversalBaseModel):
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
task_type: typing.Optional[str] = None
|
||||
url: typing.Optional[str] = None
|
||||
title: typing.Optional[str] = None
|
||||
complete_criterion: typing.Optional[str] = None
|
||||
terminate_criterion: typing.Optional[str] = None
|
||||
navigation_goal: typing.Optional[str] = None
|
||||
data_extraction_goal: typing.Optional[str] = None
|
||||
data_schema: typing.Optional[FileDownloadBlockDataSchema] = None
|
||||
error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None
|
||||
max_retries: typing.Optional[int] = None
|
||||
max_steps_per_run: typing.Optional[int] = None
|
||||
parameters: typing.Optional[typing.List[FileDownloadBlockParametersItem]] = None
|
||||
complete_on_download: typing.Optional[bool] = None
|
||||
download_suffix: typing.Optional[str] = None
|
||||
totp_verification_url: typing.Optional[str] = None
|
||||
totp_identifier: typing.Optional[str] = None
|
||||
cache_actions: typing.Optional[bool] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
update_forward_refs(ContextParameter, FileDownloadBlock=FileDownloadBlock)
|
||||
7
skyvern/client/types/file_download_block_data_schema.py
Normal file
7
skyvern/client/types/file_download_block_data_schema.py
Normal file
@@ -0,0 +1,7 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
FileDownloadBlockDataSchema = typing.Union[
|
||||
typing.Dict[str, typing.Optional[typing.Any]], typing.List[typing.Optional[typing.Any]]
|
||||
]
|
||||
185
skyvern/client/types/file_download_block_parameters_item.py
Normal file
185
skyvern/client/types/file_download_block_parameters_item.py
Normal file
@@ -0,0 +1,185 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from .context_parameter_value import ContextParameterValue
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
from .workflow_parameter_default_value import WorkflowParameterDefaultValue
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
|
||||
|
||||
class FileDownloadBlockParametersItem_AwsSecret(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["aws_secret"] = "aws_secret"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
aws_secret_parameter_id: str
|
||||
workflow_id: str
|
||||
aws_key: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class FileDownloadBlockParametersItem_BitwardenCreditCardData(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_credit_card_data"] = "bitwarden_credit_card_data"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_credit_card_data_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
bitwarden_collection_id: str
|
||||
bitwarden_item_id: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class FileDownloadBlockParametersItem_BitwardenLoginCredential(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_login_credential"] = "bitwarden_login_credential"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_login_credential_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
url_parameter_key: str
|
||||
bitwarden_collection_id: typing.Optional[str] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class FileDownloadBlockParametersItem_BitwardenSensitiveInformation(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_sensitive_information"] = "bitwarden_sensitive_information"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_sensitive_information_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
bitwarden_collection_id: str
|
||||
bitwarden_identity_key: str
|
||||
bitwarden_identity_fields: typing.List[str]
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class FileDownloadBlockParametersItem_Context(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["context"] = "context"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
source: "ContextParameterSource"
|
||||
value: typing.Optional[ContextParameterValue] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402
|
||||
|
||||
|
||||
class FileDownloadBlockParametersItem_Output(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["output"] = "output"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
output_parameter_id: str
|
||||
workflow_id: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class FileDownloadBlockParametersItem_Workflow(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["workflow"] = "workflow"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
workflow_parameter_id: str
|
||||
workflow_parameter_type: WorkflowParameterType
|
||||
workflow_id: str
|
||||
default_value: typing.Optional[WorkflowParameterDefaultValue] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
FileDownloadBlockParametersItem = typing.Union[
|
||||
FileDownloadBlockParametersItem_AwsSecret,
|
||||
FileDownloadBlockParametersItem_BitwardenCreditCardData,
|
||||
FileDownloadBlockParametersItem_BitwardenLoginCredential,
|
||||
FileDownloadBlockParametersItem_BitwardenSensitiveInformation,
|
||||
FileDownloadBlockParametersItem_Context,
|
||||
FileDownloadBlockParametersItem_Output,
|
||||
FileDownloadBlockParametersItem_Workflow,
|
||||
]
|
||||
update_forward_refs(ContextParameter, FileDownloadBlockParametersItem_Context=FileDownloadBlockParametersItem_Context)
|
||||
update_forward_refs(FileDownloadBlockParametersItem_Context)
|
||||
25
skyvern/client/types/file_parser_block.py
Normal file
25
skyvern/client/types/file_parser_block.py
Normal file
@@ -0,0 +1,25 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .output_parameter import OutputParameter
|
||||
import typing
|
||||
from .file_type import FileType
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
|
||||
|
||||
class FileParserBlock(UniversalBaseModel):
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
file_url: str
|
||||
file_type: FileType = "csv"
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
5
skyvern/client/types/file_type.py
Normal file
5
skyvern/client/types/file_type.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
FileType = typing.Literal["csv"]
|
||||
36
skyvern/client/types/for_loop_block.py
Normal file
36
skyvern/client/types/for_loop_block.py
Normal file
@@ -0,0 +1,36 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .context_parameter import ContextParameter
|
||||
from .output_parameter import OutputParameter
|
||||
import typing
|
||||
from .for_loop_block_loop_over import ForLoopBlockLoopOver
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
|
||||
|
||||
class ForLoopBlock(UniversalBaseModel):
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
loop_blocks: typing.List["ForLoopBlockLoopBlocksItem"]
|
||||
loop_over: typing.Optional[ForLoopBlockLoopOver] = None
|
||||
loop_variable_reference: typing.Optional[str] = None
|
||||
complete_if_empty: typing.Optional[bool] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .for_loop_block_loop_blocks_item import ForLoopBlockLoopBlocksItem # noqa: E402
|
||||
|
||||
update_forward_refs(ContextParameter, ForLoopBlock=ForLoopBlock)
|
||||
update_forward_refs(ForLoopBlock)
|
||||
527
skyvern/client/types/for_loop_block_loop_blocks_item.py
Normal file
527
skyvern/client/types/for_loop_block_loop_blocks_item.py
Normal file
@@ -0,0 +1,527 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .context_parameter import ContextParameter
|
||||
import typing
|
||||
from .output_parameter import OutputParameter
|
||||
from .action_block_data_schema import ActionBlockDataSchema
|
||||
from .action_block_parameters_item import ActionBlockParametersItem
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from .code_block_parameters_item import CodeBlockParametersItem
|
||||
from .extraction_block_data_schema import ExtractionBlockDataSchema
|
||||
from .extraction_block_parameters_item import ExtractionBlockParametersItem
|
||||
from .file_download_block_data_schema import FileDownloadBlockDataSchema
|
||||
from .file_download_block_parameters_item import FileDownloadBlockParametersItem
|
||||
from .file_type import FileType
|
||||
from .for_loop_block_loop_over import ForLoopBlockLoopOver
|
||||
from .url_block_data_schema import UrlBlockDataSchema
|
||||
from .url_block_parameters_item import UrlBlockParametersItem
|
||||
from .login_block_data_schema import LoginBlockDataSchema
|
||||
from .login_block_parameters_item import LoginBlockParametersItem
|
||||
from .navigation_block_data_schema import NavigationBlockDataSchema
|
||||
from .navigation_block_parameters_item import NavigationBlockParametersItem
|
||||
from .aws_secret_parameter import AwsSecretParameter
|
||||
from .task_block_data_schema import TaskBlockDataSchema
|
||||
from .task_block_parameters_item import TaskBlockParametersItem
|
||||
from .text_prompt_block_parameters_item import TextPromptBlockParametersItem
|
||||
from .validation_block_data_schema import ValidationBlockDataSchema
|
||||
from .validation_block_parameters_item import ValidationBlockParametersItem
|
||||
from .wait_block_parameters_item import WaitBlockParametersItem
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
|
||||
|
||||
class ForLoopBlockLoopBlocksItem_Action(UniversalBaseModel):
|
||||
block_type: typing.Literal["action"] = "action"
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
task_type: typing.Optional[str] = None
|
||||
url: typing.Optional[str] = None
|
||||
title: typing.Optional[str] = None
|
||||
complete_criterion: typing.Optional[str] = None
|
||||
terminate_criterion: typing.Optional[str] = None
|
||||
navigation_goal: typing.Optional[str] = None
|
||||
data_extraction_goal: typing.Optional[str] = None
|
||||
data_schema: typing.Optional[ActionBlockDataSchema] = None
|
||||
error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None
|
||||
max_retries: typing.Optional[int] = None
|
||||
max_steps_per_run: typing.Optional[int] = None
|
||||
parameters: typing.Optional[typing.List[ActionBlockParametersItem]] = None
|
||||
complete_on_download: typing.Optional[bool] = None
|
||||
download_suffix: typing.Optional[str] = None
|
||||
totp_verification_url: typing.Optional[str] = None
|
||||
totp_identifier: typing.Optional[str] = None
|
||||
cache_actions: typing.Optional[bool] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockLoopBlocksItem_Code(UniversalBaseModel):
|
||||
block_type: typing.Literal["code"] = "code"
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
code: str
|
||||
parameters: typing.Optional[typing.List[CodeBlockParametersItem]] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockLoopBlocksItem_DownloadToS3(UniversalBaseModel):
|
||||
block_type: typing.Literal["download_to_s3"] = "download_to_s3"
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
url: str
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockLoopBlocksItem_Extraction(UniversalBaseModel):
|
||||
block_type: typing.Literal["extraction"] = "extraction"
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
task_type: typing.Optional[str] = None
|
||||
url: typing.Optional[str] = None
|
||||
title: typing.Optional[str] = None
|
||||
complete_criterion: typing.Optional[str] = None
|
||||
terminate_criterion: typing.Optional[str] = None
|
||||
navigation_goal: typing.Optional[str] = None
|
||||
data_extraction_goal: str
|
||||
data_schema: typing.Optional[ExtractionBlockDataSchema] = None
|
||||
error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None
|
||||
max_retries: typing.Optional[int] = None
|
||||
max_steps_per_run: typing.Optional[int] = None
|
||||
parameters: typing.Optional[typing.List[ExtractionBlockParametersItem]] = None
|
||||
complete_on_download: typing.Optional[bool] = None
|
||||
download_suffix: typing.Optional[str] = None
|
||||
totp_verification_url: typing.Optional[str] = None
|
||||
totp_identifier: typing.Optional[str] = None
|
||||
cache_actions: typing.Optional[bool] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockLoopBlocksItem_FileDownload(UniversalBaseModel):
|
||||
block_type: typing.Literal["file_download"] = "file_download"
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
task_type: typing.Optional[str] = None
|
||||
url: typing.Optional[str] = None
|
||||
title: typing.Optional[str] = None
|
||||
complete_criterion: typing.Optional[str] = None
|
||||
terminate_criterion: typing.Optional[str] = None
|
||||
navigation_goal: typing.Optional[str] = None
|
||||
data_extraction_goal: typing.Optional[str] = None
|
||||
data_schema: typing.Optional[FileDownloadBlockDataSchema] = None
|
||||
error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None
|
||||
max_retries: typing.Optional[int] = None
|
||||
max_steps_per_run: typing.Optional[int] = None
|
||||
parameters: typing.Optional[typing.List[FileDownloadBlockParametersItem]] = None
|
||||
complete_on_download: typing.Optional[bool] = None
|
||||
download_suffix: typing.Optional[str] = None
|
||||
totp_verification_url: typing.Optional[str] = None
|
||||
totp_identifier: typing.Optional[str] = None
|
||||
cache_actions: typing.Optional[bool] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockLoopBlocksItem_FileUrlParser(UniversalBaseModel):
|
||||
block_type: typing.Literal["file_url_parser"] = "file_url_parser"
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
file_url: str
|
||||
file_type: FileType = "csv"
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockLoopBlocksItem_ForLoop(UniversalBaseModel):
|
||||
block_type: typing.Literal["for_loop"] = "for_loop"
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
loop_blocks: typing.List["ForLoopBlockLoopBlocksItem"]
|
||||
loop_over: typing.Optional[ForLoopBlockLoopOver] = None
|
||||
loop_variable_reference: typing.Optional[str] = None
|
||||
complete_if_empty: typing.Optional[bool] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .for_loop_block import ForLoopBlock # noqa: E402
|
||||
|
||||
|
||||
class ForLoopBlockLoopBlocksItem_GotoUrl(UniversalBaseModel):
|
||||
block_type: typing.Literal["goto_url"] = "goto_url"
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
task_type: typing.Optional[str] = None
|
||||
url: str
|
||||
title: typing.Optional[str] = None
|
||||
complete_criterion: typing.Optional[str] = None
|
||||
terminate_criterion: typing.Optional[str] = None
|
||||
navigation_goal: typing.Optional[str] = None
|
||||
data_extraction_goal: typing.Optional[str] = None
|
||||
data_schema: typing.Optional[UrlBlockDataSchema] = None
|
||||
error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None
|
||||
max_retries: typing.Optional[int] = None
|
||||
max_steps_per_run: typing.Optional[int] = None
|
||||
parameters: typing.Optional[typing.List[UrlBlockParametersItem]] = None
|
||||
complete_on_download: typing.Optional[bool] = None
|
||||
download_suffix: typing.Optional[str] = None
|
||||
totp_verification_url: typing.Optional[str] = None
|
||||
totp_identifier: typing.Optional[str] = None
|
||||
cache_actions: typing.Optional[bool] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockLoopBlocksItem_Login(UniversalBaseModel):
|
||||
block_type: typing.Literal["login"] = "login"
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
task_type: typing.Optional[str] = None
|
||||
url: typing.Optional[str] = None
|
||||
title: typing.Optional[str] = None
|
||||
complete_criterion: typing.Optional[str] = None
|
||||
terminate_criterion: typing.Optional[str] = None
|
||||
navigation_goal: typing.Optional[str] = None
|
||||
data_extraction_goal: typing.Optional[str] = None
|
||||
data_schema: typing.Optional[LoginBlockDataSchema] = None
|
||||
error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None
|
||||
max_retries: typing.Optional[int] = None
|
||||
max_steps_per_run: typing.Optional[int] = None
|
||||
parameters: typing.Optional[typing.List[LoginBlockParametersItem]] = None
|
||||
complete_on_download: typing.Optional[bool] = None
|
||||
download_suffix: typing.Optional[str] = None
|
||||
totp_verification_url: typing.Optional[str] = None
|
||||
totp_identifier: typing.Optional[str] = None
|
||||
cache_actions: typing.Optional[bool] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockLoopBlocksItem_Navigation(UniversalBaseModel):
|
||||
block_type: typing.Literal["navigation"] = "navigation"
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
task_type: typing.Optional[str] = None
|
||||
url: typing.Optional[str] = None
|
||||
title: typing.Optional[str] = None
|
||||
complete_criterion: typing.Optional[str] = None
|
||||
terminate_criterion: typing.Optional[str] = None
|
||||
navigation_goal: str
|
||||
data_extraction_goal: typing.Optional[str] = None
|
||||
data_schema: typing.Optional[NavigationBlockDataSchema] = None
|
||||
error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None
|
||||
max_retries: typing.Optional[int] = None
|
||||
max_steps_per_run: typing.Optional[int] = None
|
||||
parameters: typing.Optional[typing.List[NavigationBlockParametersItem]] = None
|
||||
complete_on_download: typing.Optional[bool] = None
|
||||
download_suffix: typing.Optional[str] = None
|
||||
totp_verification_url: typing.Optional[str] = None
|
||||
totp_identifier: typing.Optional[str] = None
|
||||
cache_actions: typing.Optional[bool] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockLoopBlocksItem_PdfParser(UniversalBaseModel):
|
||||
block_type: typing.Literal["pdf_parser"] = "pdf_parser"
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
file_url: str
|
||||
json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockLoopBlocksItem_SendEmail(UniversalBaseModel):
|
||||
block_type: typing.Literal["send_email"] = "send_email"
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
smtp_host: AwsSecretParameter
|
||||
smtp_port: AwsSecretParameter
|
||||
smtp_username: AwsSecretParameter
|
||||
smtp_password: AwsSecretParameter
|
||||
sender: str
|
||||
recipients: typing.List[str]
|
||||
subject: str
|
||||
body: str
|
||||
file_attachments: typing.Optional[typing.List[str]] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockLoopBlocksItem_Task(UniversalBaseModel):
|
||||
block_type: typing.Literal["task"] = "task"
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
task_type: typing.Optional[str] = None
|
||||
url: typing.Optional[str] = None
|
||||
title: typing.Optional[str] = None
|
||||
complete_criterion: typing.Optional[str] = None
|
||||
terminate_criterion: typing.Optional[str] = None
|
||||
navigation_goal: typing.Optional[str] = None
|
||||
data_extraction_goal: typing.Optional[str] = None
|
||||
data_schema: typing.Optional[TaskBlockDataSchema] = None
|
||||
error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None
|
||||
max_retries: typing.Optional[int] = None
|
||||
max_steps_per_run: typing.Optional[int] = None
|
||||
parameters: typing.Optional[typing.List[TaskBlockParametersItem]] = None
|
||||
complete_on_download: typing.Optional[bool] = None
|
||||
download_suffix: typing.Optional[str] = None
|
||||
totp_verification_url: typing.Optional[str] = None
|
||||
totp_identifier: typing.Optional[str] = None
|
||||
cache_actions: typing.Optional[bool] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockLoopBlocksItem_TaskV2(UniversalBaseModel):
|
||||
block_type: typing.Literal["task_v2"] = "task_v2"
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
prompt: str
|
||||
url: typing.Optional[str] = None
|
||||
totp_verification_url: typing.Optional[str] = None
|
||||
totp_identifier: typing.Optional[str] = None
|
||||
max_iterations: typing.Optional[int] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockLoopBlocksItem_TextPrompt(UniversalBaseModel):
|
||||
block_type: typing.Literal["text_prompt"] = "text_prompt"
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
llm_key: typing.Optional[str] = None
|
||||
prompt: str
|
||||
parameters: typing.Optional[typing.List[TextPromptBlockParametersItem]] = None
|
||||
json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockLoopBlocksItem_UploadToS3(UniversalBaseModel):
|
||||
block_type: typing.Literal["upload_to_s3"] = "upload_to_s3"
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
path: typing.Optional[str] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockLoopBlocksItem_Validation(UniversalBaseModel):
|
||||
block_type: typing.Literal["validation"] = "validation"
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
task_type: typing.Optional[str] = None
|
||||
url: typing.Optional[str] = None
|
||||
title: typing.Optional[str] = None
|
||||
complete_criterion: typing.Optional[str] = None
|
||||
terminate_criterion: typing.Optional[str] = None
|
||||
navigation_goal: typing.Optional[str] = None
|
||||
data_extraction_goal: typing.Optional[str] = None
|
||||
data_schema: typing.Optional[ValidationBlockDataSchema] = None
|
||||
error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None
|
||||
max_retries: typing.Optional[int] = None
|
||||
max_steps_per_run: typing.Optional[int] = None
|
||||
parameters: typing.Optional[typing.List[ValidationBlockParametersItem]] = None
|
||||
complete_on_download: typing.Optional[bool] = None
|
||||
download_suffix: typing.Optional[str] = None
|
||||
totp_verification_url: typing.Optional[str] = None
|
||||
totp_identifier: typing.Optional[str] = None
|
||||
cache_actions: typing.Optional[bool] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockLoopBlocksItem_Wait(UniversalBaseModel):
|
||||
block_type: typing.Literal["wait"] = "wait"
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
wait_sec: int
|
||||
parameters: typing.Optional[typing.List[WaitBlockParametersItem]] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
ForLoopBlockLoopBlocksItem = typing.Union[
|
||||
ForLoopBlockLoopBlocksItem_Action,
|
||||
ForLoopBlockLoopBlocksItem_Code,
|
||||
ForLoopBlockLoopBlocksItem_DownloadToS3,
|
||||
ForLoopBlockLoopBlocksItem_Extraction,
|
||||
ForLoopBlockLoopBlocksItem_FileDownload,
|
||||
ForLoopBlockLoopBlocksItem_FileUrlParser,
|
||||
ForLoopBlockLoopBlocksItem_ForLoop,
|
||||
ForLoopBlockLoopBlocksItem_GotoUrl,
|
||||
ForLoopBlockLoopBlocksItem_Login,
|
||||
ForLoopBlockLoopBlocksItem_Navigation,
|
||||
ForLoopBlockLoopBlocksItem_PdfParser,
|
||||
ForLoopBlockLoopBlocksItem_SendEmail,
|
||||
ForLoopBlockLoopBlocksItem_Task,
|
||||
ForLoopBlockLoopBlocksItem_TaskV2,
|
||||
ForLoopBlockLoopBlocksItem_TextPrompt,
|
||||
ForLoopBlockLoopBlocksItem_UploadToS3,
|
||||
ForLoopBlockLoopBlocksItem_Validation,
|
||||
ForLoopBlockLoopBlocksItem_Wait,
|
||||
]
|
||||
update_forward_refs(ContextParameter, ForLoopBlockLoopBlocksItem_Action=ForLoopBlockLoopBlocksItem_Action)
|
||||
update_forward_refs(ContextParameter, ForLoopBlockLoopBlocksItem_Code=ForLoopBlockLoopBlocksItem_Code)
|
||||
update_forward_refs(ContextParameter, ForLoopBlockLoopBlocksItem_Extraction=ForLoopBlockLoopBlocksItem_Extraction)
|
||||
update_forward_refs(ContextParameter, ForLoopBlockLoopBlocksItem_FileDownload=ForLoopBlockLoopBlocksItem_FileDownload)
|
||||
update_forward_refs(ContextParameter, ForLoopBlockLoopBlocksItem_ForLoop=ForLoopBlockLoopBlocksItem_ForLoop)
|
||||
update_forward_refs(ForLoopBlock, ForLoopBlockLoopBlocksItem_ForLoop=ForLoopBlockLoopBlocksItem_ForLoop)
|
||||
update_forward_refs(ForLoopBlockLoopBlocksItem_ForLoop)
|
||||
update_forward_refs(ContextParameter, ForLoopBlockLoopBlocksItem_GotoUrl=ForLoopBlockLoopBlocksItem_GotoUrl)
|
||||
update_forward_refs(ContextParameter, ForLoopBlockLoopBlocksItem_Login=ForLoopBlockLoopBlocksItem_Login)
|
||||
update_forward_refs(ContextParameter, ForLoopBlockLoopBlocksItem_Navigation=ForLoopBlockLoopBlocksItem_Navigation)
|
||||
update_forward_refs(ContextParameter, ForLoopBlockLoopBlocksItem_Task=ForLoopBlockLoopBlocksItem_Task)
|
||||
update_forward_refs(ContextParameter, ForLoopBlockLoopBlocksItem_TextPrompt=ForLoopBlockLoopBlocksItem_TextPrompt)
|
||||
update_forward_refs(ContextParameter, ForLoopBlockLoopBlocksItem_Validation=ForLoopBlockLoopBlocksItem_Validation)
|
||||
update_forward_refs(ContextParameter, ForLoopBlockLoopBlocksItem_Wait=ForLoopBlockLoopBlocksItem_Wait)
|
||||
185
skyvern/client/types/for_loop_block_loop_over.py
Normal file
185
skyvern/client/types/for_loop_block_loop_over.py
Normal file
@@ -0,0 +1,185 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from .context_parameter_value import ContextParameterValue
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
from .workflow_parameter_default_value import WorkflowParameterDefaultValue
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
|
||||
|
||||
class ForLoopBlockLoopOver_AwsSecret(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["aws_secret"] = "aws_secret"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
aws_secret_parameter_id: str
|
||||
workflow_id: str
|
||||
aws_key: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockLoopOver_BitwardenCreditCardData(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_credit_card_data"] = "bitwarden_credit_card_data"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_credit_card_data_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
bitwarden_collection_id: str
|
||||
bitwarden_item_id: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockLoopOver_BitwardenLoginCredential(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_login_credential"] = "bitwarden_login_credential"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_login_credential_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
url_parameter_key: str
|
||||
bitwarden_collection_id: typing.Optional[str] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockLoopOver_BitwardenSensitiveInformation(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_sensitive_information"] = "bitwarden_sensitive_information"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_sensitive_information_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
bitwarden_collection_id: str
|
||||
bitwarden_identity_key: str
|
||||
bitwarden_identity_fields: typing.List[str]
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockLoopOver_Context(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["context"] = "context"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
source: "ContextParameterSource"
|
||||
value: typing.Optional[ContextParameterValue] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402
|
||||
|
||||
|
||||
class ForLoopBlockLoopOver_Output(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["output"] = "output"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
output_parameter_id: str
|
||||
workflow_id: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockLoopOver_Workflow(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["workflow"] = "workflow"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
workflow_parameter_id: str
|
||||
workflow_parameter_type: WorkflowParameterType
|
||||
workflow_id: str
|
||||
default_value: typing.Optional[WorkflowParameterDefaultValue] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
ForLoopBlockLoopOver = typing.Union[
|
||||
ForLoopBlockLoopOver_AwsSecret,
|
||||
ForLoopBlockLoopOver_BitwardenCreditCardData,
|
||||
ForLoopBlockLoopOver_BitwardenLoginCredential,
|
||||
ForLoopBlockLoopOver_BitwardenSensitiveInformation,
|
||||
ForLoopBlockLoopOver_Context,
|
||||
ForLoopBlockLoopOver_Output,
|
||||
ForLoopBlockLoopOver_Workflow,
|
||||
]
|
||||
update_forward_refs(ContextParameter, ForLoopBlockLoopOver_Context=ForLoopBlockLoopOver_Context)
|
||||
update_forward_refs(ForLoopBlockLoopOver_Context)
|
||||
20
skyvern/client/types/get_organization_api_keys_response.py
Normal file
20
skyvern/client/types/get_organization_api_keys_response.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from .organization_auth_token import OrganizationAuthToken
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
|
||||
|
||||
class GetOrganizationApiKeysResponse(UniversalBaseModel):
|
||||
api_keys: typing.List[OrganizationAuthToken]
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
20
skyvern/client/types/get_organizations_response.py
Normal file
20
skyvern/client/types/get_organizations_response.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from .organization import Organization
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
|
||||
|
||||
class GetOrganizationsResponse(UniversalBaseModel):
|
||||
organizations: typing.List[Organization]
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
20
skyvern/client/types/http_validation_error.py
Normal file
20
skyvern/client/types/http_validation_error.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from .validation_error import ValidationError
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
|
||||
|
||||
class HttpValidationError(UniversalBaseModel):
|
||||
detail: typing.Optional[typing.List[ValidationError]] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
47
skyvern/client/types/login_block.py
Normal file
47
skyvern/client/types/login_block.py
Normal file
@@ -0,0 +1,47 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .context_parameter import ContextParameter
|
||||
from .output_parameter import OutputParameter
|
||||
import typing
|
||||
from .login_block_data_schema import LoginBlockDataSchema
|
||||
from .login_block_parameters_item import LoginBlockParametersItem
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
|
||||
|
||||
class LoginBlock(UniversalBaseModel):
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
task_type: typing.Optional[str] = None
|
||||
url: typing.Optional[str] = None
|
||||
title: typing.Optional[str] = None
|
||||
complete_criterion: typing.Optional[str] = None
|
||||
terminate_criterion: typing.Optional[str] = None
|
||||
navigation_goal: typing.Optional[str] = None
|
||||
data_extraction_goal: typing.Optional[str] = None
|
||||
data_schema: typing.Optional[LoginBlockDataSchema] = None
|
||||
error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None
|
||||
max_retries: typing.Optional[int] = None
|
||||
max_steps_per_run: typing.Optional[int] = None
|
||||
parameters: typing.Optional[typing.List[LoginBlockParametersItem]] = None
|
||||
complete_on_download: typing.Optional[bool] = None
|
||||
download_suffix: typing.Optional[str] = None
|
||||
totp_verification_url: typing.Optional[str] = None
|
||||
totp_identifier: typing.Optional[str] = None
|
||||
cache_actions: typing.Optional[bool] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
update_forward_refs(ContextParameter, LoginBlock=LoginBlock)
|
||||
7
skyvern/client/types/login_block_data_schema.py
Normal file
7
skyvern/client/types/login_block_data_schema.py
Normal file
@@ -0,0 +1,7 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
LoginBlockDataSchema = typing.Union[
|
||||
typing.Dict[str, typing.Optional[typing.Any]], typing.List[typing.Optional[typing.Any]]
|
||||
]
|
||||
185
skyvern/client/types/login_block_parameters_item.py
Normal file
185
skyvern/client/types/login_block_parameters_item.py
Normal file
@@ -0,0 +1,185 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from .context_parameter_value import ContextParameterValue
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
from .workflow_parameter_default_value import WorkflowParameterDefaultValue
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
|
||||
|
||||
class LoginBlockParametersItem_AwsSecret(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["aws_secret"] = "aws_secret"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
aws_secret_parameter_id: str
|
||||
workflow_id: str
|
||||
aws_key: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class LoginBlockParametersItem_BitwardenCreditCardData(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_credit_card_data"] = "bitwarden_credit_card_data"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_credit_card_data_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
bitwarden_collection_id: str
|
||||
bitwarden_item_id: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class LoginBlockParametersItem_BitwardenLoginCredential(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_login_credential"] = "bitwarden_login_credential"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_login_credential_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
url_parameter_key: str
|
||||
bitwarden_collection_id: typing.Optional[str] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class LoginBlockParametersItem_BitwardenSensitiveInformation(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_sensitive_information"] = "bitwarden_sensitive_information"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_sensitive_information_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
bitwarden_collection_id: str
|
||||
bitwarden_identity_key: str
|
||||
bitwarden_identity_fields: typing.List[str]
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class LoginBlockParametersItem_Context(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["context"] = "context"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
source: "ContextParameterSource"
|
||||
value: typing.Optional[ContextParameterValue] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402
|
||||
|
||||
|
||||
class LoginBlockParametersItem_Output(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["output"] = "output"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
output_parameter_id: str
|
||||
workflow_id: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class LoginBlockParametersItem_Workflow(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["workflow"] = "workflow"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
workflow_parameter_id: str
|
||||
workflow_parameter_type: WorkflowParameterType
|
||||
workflow_id: str
|
||||
default_value: typing.Optional[WorkflowParameterDefaultValue] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
LoginBlockParametersItem = typing.Union[
|
||||
LoginBlockParametersItem_AwsSecret,
|
||||
LoginBlockParametersItem_BitwardenCreditCardData,
|
||||
LoginBlockParametersItem_BitwardenLoginCredential,
|
||||
LoginBlockParametersItem_BitwardenSensitiveInformation,
|
||||
LoginBlockParametersItem_Context,
|
||||
LoginBlockParametersItem_Output,
|
||||
LoginBlockParametersItem_Workflow,
|
||||
]
|
||||
update_forward_refs(ContextParameter, LoginBlockParametersItem_Context=LoginBlockParametersItem_Context)
|
||||
update_forward_refs(LoginBlockParametersItem_Context)
|
||||
47
skyvern/client/types/navigation_block.py
Normal file
47
skyvern/client/types/navigation_block.py
Normal file
@@ -0,0 +1,47 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .context_parameter import ContextParameter
|
||||
from .output_parameter import OutputParameter
|
||||
import typing
|
||||
from .navigation_block_data_schema import NavigationBlockDataSchema
|
||||
from .navigation_block_parameters_item import NavigationBlockParametersItem
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
|
||||
|
||||
class NavigationBlock(UniversalBaseModel):
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
task_type: typing.Optional[str] = None
|
||||
url: typing.Optional[str] = None
|
||||
title: typing.Optional[str] = None
|
||||
complete_criterion: typing.Optional[str] = None
|
||||
terminate_criterion: typing.Optional[str] = None
|
||||
navigation_goal: str
|
||||
data_extraction_goal: typing.Optional[str] = None
|
||||
data_schema: typing.Optional[NavigationBlockDataSchema] = None
|
||||
error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None
|
||||
max_retries: typing.Optional[int] = None
|
||||
max_steps_per_run: typing.Optional[int] = None
|
||||
parameters: typing.Optional[typing.List[NavigationBlockParametersItem]] = None
|
||||
complete_on_download: typing.Optional[bool] = None
|
||||
download_suffix: typing.Optional[str] = None
|
||||
totp_verification_url: typing.Optional[str] = None
|
||||
totp_identifier: typing.Optional[str] = None
|
||||
cache_actions: typing.Optional[bool] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
update_forward_refs(ContextParameter, NavigationBlock=NavigationBlock)
|
||||
7
skyvern/client/types/navigation_block_data_schema.py
Normal file
7
skyvern/client/types/navigation_block_data_schema.py
Normal file
@@ -0,0 +1,7 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
NavigationBlockDataSchema = typing.Union[
|
||||
typing.Dict[str, typing.Optional[typing.Any]], typing.List[typing.Optional[typing.Any]]
|
||||
]
|
||||
185
skyvern/client/types/navigation_block_parameters_item.py
Normal file
185
skyvern/client/types/navigation_block_parameters_item.py
Normal file
@@ -0,0 +1,185 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from .context_parameter_value import ContextParameterValue
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
from .workflow_parameter_default_value import WorkflowParameterDefaultValue
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
|
||||
|
||||
class NavigationBlockParametersItem_AwsSecret(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["aws_secret"] = "aws_secret"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
aws_secret_parameter_id: str
|
||||
workflow_id: str
|
||||
aws_key: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class NavigationBlockParametersItem_BitwardenCreditCardData(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_credit_card_data"] = "bitwarden_credit_card_data"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_credit_card_data_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
bitwarden_collection_id: str
|
||||
bitwarden_item_id: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class NavigationBlockParametersItem_BitwardenLoginCredential(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_login_credential"] = "bitwarden_login_credential"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_login_credential_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
url_parameter_key: str
|
||||
bitwarden_collection_id: typing.Optional[str] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class NavigationBlockParametersItem_BitwardenSensitiveInformation(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_sensitive_information"] = "bitwarden_sensitive_information"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_sensitive_information_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
bitwarden_collection_id: str
|
||||
bitwarden_identity_key: str
|
||||
bitwarden_identity_fields: typing.List[str]
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class NavigationBlockParametersItem_Context(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["context"] = "context"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
source: "ContextParameterSource"
|
||||
value: typing.Optional[ContextParameterValue] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402
|
||||
|
||||
|
||||
class NavigationBlockParametersItem_Output(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["output"] = "output"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
output_parameter_id: str
|
||||
workflow_id: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class NavigationBlockParametersItem_Workflow(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["workflow"] = "workflow"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
workflow_parameter_id: str
|
||||
workflow_parameter_type: WorkflowParameterType
|
||||
workflow_id: str
|
||||
default_value: typing.Optional[WorkflowParameterDefaultValue] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
NavigationBlockParametersItem = typing.Union[
|
||||
NavigationBlockParametersItem_AwsSecret,
|
||||
NavigationBlockParametersItem_BitwardenCreditCardData,
|
||||
NavigationBlockParametersItem_BitwardenLoginCredential,
|
||||
NavigationBlockParametersItem_BitwardenSensitiveInformation,
|
||||
NavigationBlockParametersItem_Context,
|
||||
NavigationBlockParametersItem_Output,
|
||||
NavigationBlockParametersItem_Workflow,
|
||||
]
|
||||
update_forward_refs(ContextParameter, NavigationBlockParametersItem_Context=NavigationBlockParametersItem_Context)
|
||||
update_forward_refs(NavigationBlockParametersItem_Context)
|
||||
38
skyvern/client/types/observer_task.py
Normal file
38
skyvern/client/types/observer_task.py
Normal file
@@ -0,0 +1,38 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .observer_task_status import ObserverTaskStatus
|
||||
import typing
|
||||
from .observer_task_output import ObserverTaskOutput
|
||||
from .proxy_location import ProxyLocation
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
|
||||
|
||||
class ObserverTask(UniversalBaseModel):
|
||||
task_id: str
|
||||
status: ObserverTaskStatus
|
||||
organization_id: typing.Optional[str] = None
|
||||
workflow_run_id: typing.Optional[str] = None
|
||||
workflow_id: typing.Optional[str] = None
|
||||
workflow_permanent_id: typing.Optional[str] = None
|
||||
prompt: typing.Optional[str] = None
|
||||
url: typing.Optional[str] = None
|
||||
summary: typing.Optional[str] = None
|
||||
output: typing.Optional[ObserverTaskOutput] = None
|
||||
totp_verification_url: typing.Optional[str] = None
|
||||
totp_identifier: typing.Optional[str] = None
|
||||
proxy_location: typing.Optional[ProxyLocation] = None
|
||||
webhook_callback_url: typing.Optional[str] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
7
skyvern/client/types/observer_task_output.py
Normal file
7
skyvern/client/types/observer_task_output.py
Normal file
@@ -0,0 +1,7 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
ObserverTaskOutput = typing.Union[
|
||||
typing.Dict[str, typing.Optional[typing.Any]], typing.List[typing.Optional[typing.Any]], str
|
||||
]
|
||||
8
skyvern/client/types/observer_task_status.py
Normal file
8
skyvern/client/types/observer_task_status.py
Normal file
@@ -0,0 +1,8 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
ObserverTaskStatus = typing.Union[
|
||||
typing.Literal["created", "queued", "running", "failed", "terminated", "canceled", "timed_out", "completed"],
|
||||
typing.Any,
|
||||
]
|
||||
40
skyvern/client/types/observer_thought.py
Normal file
40
skyvern/client/types/observer_thought.py
Normal file
@@ -0,0 +1,40 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from .observer_thought_type import ObserverThoughtType
|
||||
from .observer_thought_scenario import ObserverThoughtScenario
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
|
||||
|
||||
class ObserverThought(UniversalBaseModel):
|
||||
thought_id: str
|
||||
task_id: str
|
||||
organization_id: typing.Optional[str] = None
|
||||
workflow_run_id: typing.Optional[str] = None
|
||||
workflow_run_block_id: typing.Optional[str] = None
|
||||
workflow_id: typing.Optional[str] = None
|
||||
workflow_permanent_id: typing.Optional[str] = None
|
||||
user_input: typing.Optional[str] = None
|
||||
observation: typing.Optional[str] = None
|
||||
thought: typing.Optional[str] = None
|
||||
answer: typing.Optional[str] = None
|
||||
thought_type: typing.Optional[ObserverThoughtType] = None
|
||||
thought_scenario: typing.Optional[ObserverThoughtScenario] = None
|
||||
output: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
|
||||
input_token_count: typing.Optional[int] = None
|
||||
output_token_count: typing.Optional[int] = None
|
||||
thought_cost: typing.Optional[float] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
16
skyvern/client/types/observer_thought_scenario.py
Normal file
16
skyvern/client/types/observer_thought_scenario.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
ObserverThoughtScenario = typing.Union[
|
||||
typing.Literal[
|
||||
"generate_plan",
|
||||
"user_goal_check",
|
||||
"summarization",
|
||||
"generate_metadata",
|
||||
"extract_loop_values",
|
||||
"generate_task_in_loop",
|
||||
"generate_general_task",
|
||||
],
|
||||
typing.Any,
|
||||
]
|
||||
5
skyvern/client/types/observer_thought_type.py
Normal file
5
skyvern/client/types/observer_thought_type.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
ObserverThoughtType = typing.Union[typing.Literal["plan", "metadata", "user_goal_check", "internal_plan"], typing.Any]
|
||||
5
skyvern/client/types/order_by.py
Normal file
5
skyvern/client/types/order_by.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
OrderBy = typing.Union[typing.Literal["created_at", "modified_at"], typing.Any]
|
||||
29
skyvern/client/types/organization.py
Normal file
29
skyvern/client/types/organization.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
|
||||
|
||||
class Organization(UniversalBaseModel):
|
||||
organization_id: str
|
||||
organization_name: str
|
||||
webhook_callback_url: typing.Optional[str] = None
|
||||
max_steps_per_run: typing.Optional[int] = None
|
||||
max_retries_per_step: typing.Optional[int] = None
|
||||
domain: typing.Optional[str] = None
|
||||
bw_organization_id: typing.Optional[str] = None
|
||||
bw_collection_ids: typing.Optional[typing.List[str]] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
27
skyvern/client/types/organization_auth_token.py
Normal file
27
skyvern/client/types/organization_auth_token.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .organization_auth_token_type import OrganizationAuthTokenType
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
import pydantic
|
||||
|
||||
|
||||
class OrganizationAuthToken(UniversalBaseModel):
|
||||
id: str
|
||||
organization_id: str
|
||||
token_type: OrganizationAuthTokenType = "api"
|
||||
token: str
|
||||
valid: bool
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
5
skyvern/client/types/organization_auth_token_type.py
Normal file
5
skyvern/client/types/organization_auth_token_type.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
OrganizationAuthTokenType = typing.Literal["api"]
|
||||
26
skyvern/client/types/output_parameter.py
Normal file
26
skyvern/client/types/output_parameter.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
|
||||
|
||||
class OutputParameter(UniversalBaseModel):
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
output_parameter_id: str
|
||||
workflow_id: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
24
skyvern/client/types/pdf_parser_block.py
Normal file
24
skyvern/client/types/pdf_parser_block.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .output_parameter import OutputParameter
|
||||
import typing
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
|
||||
|
||||
class PdfParserBlock(UniversalBaseModel):
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
file_url: str
|
||||
json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
22
skyvern/client/types/proxy_location.py
Normal file
22
skyvern/client/types/proxy_location.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
ProxyLocation = typing.Union[
|
||||
typing.Literal[
|
||||
"US-CA",
|
||||
"US-NY",
|
||||
"US-TX",
|
||||
"US-FL",
|
||||
"US-WA",
|
||||
"RESIDENTIAL",
|
||||
"RESIDENTIAL_ES",
|
||||
"RESIDENTIAL_IE",
|
||||
"RESIDENTIAL_GB",
|
||||
"RESIDENTIAL_IN",
|
||||
"RESIDENTIAL_JP",
|
||||
"RESIDENTIAL_FR",
|
||||
"NONE",
|
||||
],
|
||||
typing.Any,
|
||||
]
|
||||
20
skyvern/client/types/run_workflow_response.py
Normal file
20
skyvern/client/types/run_workflow_response.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
import pydantic
|
||||
|
||||
|
||||
class RunWorkflowResponse(UniversalBaseModel):
|
||||
workflow_id: str
|
||||
workflow_run_id: str
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
21
skyvern/client/types/select_option.py
Normal file
21
skyvern/client/types/select_option.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
|
||||
|
||||
class SelectOption(UniversalBaseModel):
|
||||
label: typing.Optional[str] = None
|
||||
value: typing.Optional[str] = None
|
||||
index: typing.Optional[int] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
32
skyvern/client/types/send_email_block.py
Normal file
32
skyvern/client/types/send_email_block.py
Normal file
@@ -0,0 +1,32 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .output_parameter import OutputParameter
|
||||
import typing
|
||||
from .aws_secret_parameter import AwsSecretParameter
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
|
||||
|
||||
class SendEmailBlock(UniversalBaseModel):
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
smtp_host: AwsSecretParameter
|
||||
smtp_port: AwsSecretParameter
|
||||
smtp_username: AwsSecretParameter
|
||||
smtp_password: AwsSecretParameter
|
||||
sender: str
|
||||
recipients: typing.List[str]
|
||||
subject: str
|
||||
body: str
|
||||
file_attachments: typing.Optional[typing.List[str]] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
5
skyvern/client/types/sort_direction.py
Normal file
5
skyvern/client/types/sort_direction.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
SortDirection = typing.Union[typing.Literal["asc", "desc"], typing.Any]
|
||||
34
skyvern/client/types/step.py
Normal file
34
skyvern/client/types/step.py
Normal file
@@ -0,0 +1,34 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import datetime as dt
|
||||
from .step_status import StepStatus
|
||||
import typing
|
||||
from .agent_step_output import AgentStepOutput
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
|
||||
|
||||
class Step(UniversalBaseModel):
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
task_id: str
|
||||
step_id: str
|
||||
status: StepStatus
|
||||
output: typing.Optional[AgentStepOutput] = None
|
||||
order: int
|
||||
is_last: bool
|
||||
retry_index: typing.Optional[int] = None
|
||||
organization_id: typing.Optional[str] = None
|
||||
input_token_count: typing.Optional[int] = None
|
||||
output_token_count: typing.Optional[int] = None
|
||||
step_cost: typing.Optional[float] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
5
skyvern/client/types/step_status.py
Normal file
5
skyvern/client/types/step_status.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
StepStatus = typing.Union[typing.Literal["created", "running", "failed", "completed", "canceled"], typing.Any]
|
||||
128
skyvern/client/types/task.py
Normal file
128
skyvern/client/types/task.py
Normal file
@@ -0,0 +1,128 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import pydantic
|
||||
from .task_navigation_payload import TaskNavigationPayload
|
||||
from .proxy_location import ProxyLocation
|
||||
from .task_extracted_information_schema import TaskExtractedInformationSchema
|
||||
from .task_type import TaskType
|
||||
import datetime as dt
|
||||
from .task_status import TaskStatus
|
||||
from .task_extracted_information import TaskExtractedInformation
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
|
||||
class Task(UniversalBaseModel):
|
||||
title: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
The title of the task.
|
||||
"""
|
||||
|
||||
url: str = pydantic.Field()
|
||||
"""
|
||||
Starting URL for the task.
|
||||
"""
|
||||
|
||||
webhook_callback_url: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
The URL to call when the task is completed.
|
||||
"""
|
||||
|
||||
totp_verification_url: typing.Optional[str] = None
|
||||
totp_identifier: typing.Optional[str] = None
|
||||
navigation_goal: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
The user's goal for the task.
|
||||
"""
|
||||
|
||||
data_extraction_goal: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
The user's goal for data extraction.
|
||||
"""
|
||||
|
||||
navigation_payload: typing.Optional[TaskNavigationPayload] = pydantic.Field(default=None)
|
||||
"""
|
||||
The user's details needed to achieve the task.
|
||||
"""
|
||||
|
||||
error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = pydantic.Field(default=None)
|
||||
"""
|
||||
The mapping of error codes and their descriptions.
|
||||
"""
|
||||
|
||||
proxy_location: typing.Optional[ProxyLocation] = pydantic.Field(default=None)
|
||||
"""
|
||||
The location of the proxy to use for the task.
|
||||
"""
|
||||
|
||||
extracted_information_schema: typing.Optional[TaskExtractedInformationSchema] = pydantic.Field(default=None)
|
||||
"""
|
||||
The requested schema of the extracted information.
|
||||
"""
|
||||
|
||||
complete_criterion: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
Criterion to complete
|
||||
"""
|
||||
|
||||
terminate_criterion: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
Criterion to terminate
|
||||
"""
|
||||
|
||||
task_type: typing.Optional[TaskType] = pydantic.Field(default=None)
|
||||
"""
|
||||
The type of the task
|
||||
"""
|
||||
|
||||
application: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
The application for which the task is running
|
||||
"""
|
||||
|
||||
created_at: dt.datetime = pydantic.Field()
|
||||
"""
|
||||
The creation datetime of the task.
|
||||
"""
|
||||
|
||||
modified_at: dt.datetime = pydantic.Field()
|
||||
"""
|
||||
The modification datetime of the task.
|
||||
"""
|
||||
|
||||
task_id: str = pydantic.Field()
|
||||
"""
|
||||
The ID of the task.
|
||||
"""
|
||||
|
||||
status: TaskStatus = pydantic.Field()
|
||||
"""
|
||||
The status of the task.
|
||||
"""
|
||||
|
||||
extracted_information: typing.Optional[TaskExtractedInformation] = pydantic.Field(default=None)
|
||||
"""
|
||||
The extracted information from the task.
|
||||
"""
|
||||
|
||||
failure_reason: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
The reason for the task failure.
|
||||
"""
|
||||
|
||||
organization_id: typing.Optional[str] = None
|
||||
workflow_run_id: typing.Optional[str] = None
|
||||
order: typing.Optional[int] = None
|
||||
retry: typing.Optional[int] = None
|
||||
max_steps_per_run: typing.Optional[int] = None
|
||||
errors: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
88
skyvern/client/types/task_base.py
Normal file
88
skyvern/client/types/task_base.py
Normal file
@@ -0,0 +1,88 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import pydantic
|
||||
from .task_base_navigation_payload import TaskBaseNavigationPayload
|
||||
from .proxy_location import ProxyLocation
|
||||
from .task_base_extracted_information_schema import TaskBaseExtractedInformationSchema
|
||||
from .task_type import TaskType
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
|
||||
class TaskBase(UniversalBaseModel):
|
||||
title: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
The title of the task.
|
||||
"""
|
||||
|
||||
url: str = pydantic.Field()
|
||||
"""
|
||||
Starting URL for the task.
|
||||
"""
|
||||
|
||||
webhook_callback_url: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
The URL to call when the task is completed.
|
||||
"""
|
||||
|
||||
totp_verification_url: typing.Optional[str] = None
|
||||
totp_identifier: typing.Optional[str] = None
|
||||
navigation_goal: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
The user's goal for the task.
|
||||
"""
|
||||
|
||||
data_extraction_goal: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
The user's goal for data extraction.
|
||||
"""
|
||||
|
||||
navigation_payload: typing.Optional[TaskBaseNavigationPayload] = pydantic.Field(default=None)
|
||||
"""
|
||||
The user's details needed to achieve the task.
|
||||
"""
|
||||
|
||||
error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = pydantic.Field(default=None)
|
||||
"""
|
||||
The mapping of error codes and their descriptions.
|
||||
"""
|
||||
|
||||
proxy_location: typing.Optional[ProxyLocation] = pydantic.Field(default=None)
|
||||
"""
|
||||
The location of the proxy to use for the task.
|
||||
"""
|
||||
|
||||
extracted_information_schema: typing.Optional[TaskBaseExtractedInformationSchema] = pydantic.Field(default=None)
|
||||
"""
|
||||
The requested schema of the extracted information.
|
||||
"""
|
||||
|
||||
complete_criterion: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
Criterion to complete
|
||||
"""
|
||||
|
||||
terminate_criterion: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
Criterion to terminate
|
||||
"""
|
||||
|
||||
task_type: typing.Optional[TaskType] = pydantic.Field(default=None)
|
||||
"""
|
||||
The type of the task
|
||||
"""
|
||||
|
||||
application: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
The application for which the task is running
|
||||
"""
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user