SDK: download files improments (#4198)

This commit is contained in:
Stanislav Novosad
2025-12-04 13:44:47 -07:00
committed by GitHub
parent 4665f8907d
commit 4b9c89e22b
114 changed files with 1084 additions and 143 deletions

View File

@@ -1310,12 +1310,12 @@
}
}
},
"400": {
"description": "Folder not found"
},
"404": {
"description": "Workflow not found"
},
"400": {
"description": "Folder not found"
},
"422": {
"description": "Validation Error",
"content": {
@@ -1620,12 +1620,12 @@
}
}
},
"400": {
"description": "Timeline not available for this run type"
},
"404": {
"description": "Run not found"
},
"400": {
"description": "Timeline not available for this run type"
},
"422": {
"description": "Validation Error",
"content": {
@@ -2266,12 +2266,12 @@
}
}
},
"403": {
"description": "Unauthorized - Invalid or missing authentication"
},
"404": {
"description": "Browser session not found"
},
"403": {
"description": "Unauthorized - Invalid or missing authentication"
},
"422": {
"description": "Validation Error",
"content": {
@@ -2836,6 +2836,83 @@
]
}
},
"/v1/run/tasks/download_files": {
"post": {
"tags": [
"Agent"
],
"summary": "File Download Task",
"description": "Download a file from a website by navigating and clicking download buttons",
"operationId": "download_files_v1_run_tasks_download_files_post",
"parameters": [
{
"name": "x-api-key",
"in": "header",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Skyvern API key for authentication. API key can be found at https://app.skyvern.com/settings.",
"title": "X-Api-Key"
},
"description": "Skyvern API key for authentication. API key can be found at https://app.skyvern.com/settings."
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DownloadFilesRequest"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/WorkflowRunResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
"x-fern-sdk-method-name": "download_files",
"x-fern-examples": [
{
"code-samples": [
{
"sdk": "python",
"code": "from skyvern import Skyvern\n\nskyvern = Skyvern(api_key=\"YOUR_API_KEY\")\nawait skyvern.download_files(\n url=\"https://example.com/downloads\",\n navigation_goal=\"Navigate to the downloads page and click the 'Download PDF' button\",\n download_suffix=\"report.pdf\"\n)\n"
},
{
"sdk": "typescript",
"code": "import { SkyvernClient } from \"@skyvern/client\";\n\nconst skyvern = new SkyvernClient({ apiKey: \"YOUR_API_KEY\" });\nawait skyvern.downloadFiles({\n url: \"https://example.com/downloads\",\n navigation_goal: \"Navigate to the downloads page and click the 'Download PDF' button\",\n download_suffix: \"report.pdf\"\n});\n"
}
]
}
]
}
},
"/v1/scripts": {
"post": {
"tags": [
@@ -3837,6 +3914,11 @@
"title": "Disable Cache",
"default": false
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"task_type": {
"type": "string",
"title": "Task Type",
@@ -4122,6 +4204,11 @@
],
"title": "Model"
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"url": {
"anyOf": [
{
@@ -5612,7 +5699,7 @@
"type": "number",
"title": "Timeout",
"description": "Timeout in milliseconds",
"default": 10000
"default": 5000
}
},
"type": "object",
@@ -5697,6 +5784,11 @@
"title": "Disable Cache",
"default": false
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"code": {
"type": "string",
"title": "Code"
@@ -5810,6 +5902,11 @@
],
"title": "Model"
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"code": {
"type": "string",
"title": "Code"
@@ -5886,6 +5983,11 @@
"title": "Disable Cache",
"default": false
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"branch_conditions": {
"items": {
"$ref": "#/components/schemas/BranchCondition"
@@ -5944,6 +6046,11 @@
],
"title": "Model"
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"branch_conditions": {
"items": {
"$ref": "#/components/schemas/BranchConditionYAML"
@@ -6146,8 +6253,8 @@
"anyOf": [
{
"type": "integer",
"maximum": 1440,
"minimum": 5
"maximum": 1440.0,
"minimum": 5.0
},
{
"type": "null"
@@ -6544,6 +6651,185 @@
"title": "DeployScriptRequest",
"description": "Request model for deploying a script with updated files."
},
"DownloadFilesRequest": {
"properties": {
"url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Url",
"description": "Website URL"
},
"webhook_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Webhook Url",
"description": "Webhook URL to send status updates"
},
"proxy_location": {
"anyOf": [
{
"$ref": "#/components/schemas/ProxyLocation"
},
{
"type": "null"
}
],
"description": "Proxy location to use"
},
"totp_identifier": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Totp Identifier",
"description": "Identifier for TOTP (Time-based One-Time Password) if required"
},
"totp_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Totp Url",
"description": "TOTP URL to fetch one-time passwords"
},
"browser_session_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Browser Session Id",
"description": "ID of the browser session to use, which is prefixed by `pbs_` e.g. `pbs_123456`",
"examples": [
"pbs_123456"
]
},
"browser_profile_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Browser Profile Id",
"description": "ID of a browser profile to reuse for this run"
},
"browser_address": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Browser Address",
"description": "The CDP address for the task.",
"examples": [
"http://127.0.0.1:9222",
"ws://127.0.0.1:9222/devtools/browser/1234567890"
]
},
"extra_http_headers": {
"anyOf": [
{
"additionalProperties": {
"type": "string"
},
"type": "object"
},
{
"type": "null"
}
],
"title": "Extra Http Headers",
"description": "Additional HTTP headers to include in requests"
},
"max_screenshot_scrolling_times": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Max Screenshot Scrolling Times",
"description": "Maximum number of times to scroll for screenshots"
},
"navigation_goal": {
"type": "string",
"title": "Navigation Goal",
"description": "Instructions for navigating to and downloading the file"
},
"download_suffix": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Download Suffix",
"description": "Suffix or complete filename for the downloaded file"
},
"download_timeout": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Download Timeout",
"description": "Timeout in seconds for the download operation"
},
"max_steps_per_run": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Max Steps Per Run",
"description": "Maximum number of steps to execute"
}
},
"type": "object",
"required": [
"navigation_goal"
],
"title": "DownloadFilesRequest"
},
"DownloadToS3Block": {
"properties": {
"label": {
@@ -6594,6 +6880,11 @@
"title": "Disable Cache",
"default": false
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"url": {
"type": "string",
"title": "Url"
@@ -6649,6 +6940,11 @@
],
"title": "Model"
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"url": {
"type": "string",
"title": "Url"
@@ -6793,6 +7089,11 @@
"title": "Disable Cache",
"default": false
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"task_type": {
"type": "string",
"title": "Task Type",
@@ -7072,6 +7373,11 @@
],
"title": "Model"
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"data_extraction_goal": {
"type": "string",
"title": "Data Extraction Goal"
@@ -7208,6 +7514,11 @@
"title": "Disable Cache",
"default": false
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"task_type": {
"type": "string",
"title": "Task Type",
@@ -7493,6 +7804,11 @@
],
"title": "Model"
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"navigation_goal": {
"type": "string",
"title": "Navigation Goal"
@@ -7802,6 +8118,11 @@
"title": "Disable Cache",
"default": false
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"file_url": {
"type": "string",
"title": "File Url"
@@ -7873,6 +8194,11 @@
],
"title": "Model"
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"file_url": {
"type": "string",
"title": "File Url"
@@ -7968,6 +8294,11 @@
"title": "Disable Cache",
"default": false
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"storage_type": {
"$ref": "#/components/schemas/FileStorageType",
"default": "s3"
@@ -8110,6 +8441,11 @@
],
"title": "Model"
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"storage_type": {
"$ref": "#/components/schemas/FileStorageType",
"default": "s3"
@@ -8389,6 +8725,11 @@
"title": "Disable Cache",
"default": false
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"loop_blocks": {
"items": {
"oneOf": [
@@ -8618,6 +8959,11 @@
],
"title": "Model"
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"loop_blocks": {
"items": {
"anyOf": [
@@ -8845,6 +9191,11 @@
"title": "Disable Cache",
"default": false
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"method": {
"type": "string",
"title": "Method",
@@ -9005,6 +9356,11 @@
],
"title": "Model"
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"method": {
"type": "string",
"title": "Method",
@@ -9128,6 +9484,11 @@
"title": "Disable Cache",
"default": false
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"task_type": {
"type": "string",
"title": "Task Type",
@@ -9457,6 +9818,11 @@
],
"title": "Model"
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"instructions": {
"type": "string",
"title": "Instructions",
@@ -9674,7 +10040,7 @@
"type": "number",
"title": "Timeout",
"description": "Timeout in milliseconds",
"default": 10000
"default": 5000
}
},
"type": "object",
@@ -9781,6 +10147,11 @@
"title": "Disable Cache",
"default": false
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"task_type": {
"type": "string",
"title": "Task Type",
@@ -10066,6 +10437,11 @@
],
"title": "Model"
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"url": {
"anyOf": [
{
@@ -10204,10 +10580,6 @@
},
"LoginRequest": {
"properties": {
"credential_type": {
"$ref": "#/components/schemas/skyvern__schemas__run_blocks__CredentialType",
"description": "Where to get the credential from"
},
"url": {
"anyOf": [
{
@@ -10218,19 +10590,7 @@
}
],
"title": "Url",
"description": "Website url"
},
"prompt": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Prompt",
"description": "Login instructions. Skyvern has default prompt/instruction for login if this field is not provided."
"description": "Website URL"
},
"webhook_url": {
"anyOf": [
@@ -10242,7 +10602,7 @@
}
],
"title": "Webhook Url",
"description": "Webhook URL to send login status updates"
"description": "Webhook URL to send status updates"
},
"proxy_location": {
"anyOf": [
@@ -10349,6 +10709,22 @@
"title": "Max Screenshot Scrolling Times",
"description": "Maximum number of times to scroll for screenshots"
},
"credential_type": {
"$ref": "#/components/schemas/skyvern__schemas__run_blocks__CredentialType",
"description": "Where to get the credential from"
},
"prompt": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Prompt",
"description": "Login instructions. Skyvern has default prompt/instruction for login if this field is not provided."
},
"credential_id": {
"anyOf": [
{
@@ -10517,6 +10893,11 @@
"title": "Disable Cache",
"default": false
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"task_type": {
"type": "string",
"title": "Task Type",
@@ -10796,6 +11177,11 @@
],
"title": "Model"
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"navigation_goal": {
"type": "string",
"title": "Navigation Goal"
@@ -11350,6 +11736,11 @@
"title": "Disable Cache",
"default": false
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"file_url": {
"type": "string",
"title": "File Url"
@@ -11418,6 +11809,11 @@
],
"title": "Model"
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"file_url": {
"type": "string",
"title": "File Url"
@@ -11878,7 +12274,7 @@
"type": "number",
"title": "Timeout",
"description": "Timeout in milliseconds",
"default": 10000
"default": 5000
}
},
"type": "object",
@@ -11935,6 +12331,11 @@
"title": "Disable Cache",
"default": false
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"smtp_host": {
"$ref": "#/components/schemas/AWSSecretParameter"
},
@@ -12032,6 +12433,11 @@
],
"title": "Model"
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"smtp_host_secret_parameter_key": {
"type": "string",
"title": "Smtp Host Secret Parameter Key"
@@ -12401,6 +12807,11 @@
"title": "Disable Cache",
"default": false
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"task_type": {
"type": "string",
"title": "Task Type",
@@ -12686,6 +13097,11 @@
],
"title": "Model"
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"url": {
"anyOf": [
{
@@ -13469,6 +13885,11 @@
"title": "Disable Cache",
"default": false
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"prompt": {
"type": "string",
"title": "Prompt"
@@ -13567,6 +13988,11 @@
],
"title": "Model"
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"prompt": {
"type": "string",
"title": "Prompt"
@@ -13677,6 +14103,11 @@
"title": "Disable Cache",
"default": false
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"llm_key": {
"anyOf": [
{
@@ -13813,6 +14244,11 @@
],
"title": "Model"
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"llm_key": {
"anyOf": [
{
@@ -14188,7 +14624,7 @@
"type": "number",
"title": "Timeout",
"description": "Timeout in milliseconds",
"default": 10000
"default": 5000
}
},
"type": "object",
@@ -14245,6 +14681,11 @@
"title": "Disable Cache",
"default": false
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"path": {
"anyOf": [
{
@@ -14306,6 +14747,11 @@
],
"title": "Model"
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"path": {
"anyOf": [
{
@@ -14374,6 +14820,11 @@
"title": "Disable Cache",
"default": false
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"task_type": {
"type": "string",
"title": "Task Type",
@@ -14653,6 +15104,11 @@
],
"title": "Model"
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"url": {
"type": "string",
"title": "Url"
@@ -14677,8 +15133,8 @@
},
"confidence_float": {
"type": "number",
"maximum": 1,
"minimum": 0,
"maximum": 1.0,
"minimum": 0.0,
"title": "Confidence Float"
}
},
@@ -14740,6 +15196,11 @@
"title": "Disable Cache",
"default": false
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"task_type": {
"type": "string",
"title": "Task Type",
@@ -15025,6 +15486,11 @@
],
"title": "Model"
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"complete_criterion": {
"anyOf": [
{
@@ -15170,6 +15636,11 @@
"title": "Disable Cache",
"default": false
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"wait_sec": {
"type": "integer",
"title": "Wait Sec"
@@ -15283,6 +15754,11 @@
],
"title": "Model"
},
"next_loop_on_failure": {
"type": "boolean",
"title": "Next Loop On Failure",
"default": false
},
"wait_sec": {
"type": "integer",
"title": "Wait Sec",