From 4e7dd87f99be0eb7ca672b0d0b97616a2abf21f3 Mon Sep 17 00:00:00 2001 From: Shuchang Zheng Date: Thu, 27 Mar 2025 22:54:35 -0700 Subject: [PATCH] update autogenerated client sdk (#2010) --- fern/fern.config.json | 2 +- fern/openapi/skyvern_openapi.json | 572 +- skyvern/client/__init__.py | 160 +- skyvern/client/agent/__init__.py | 20 +- skyvern/client/agent/client.py | 5683 +++-------------- skyvern/client/agent/types/__init__.py | 15 +- .../types/agent_get_runs_response_item.py | 7 + ...ask_v2request_x_max_iterations_override.py | 5 + ...run_task_v2request_x_max_steps_override.py | 5 + ...ask_run_request_data_extraction_schema.py} | 2 +- ..._v2request_extracted_information_schema.py | 7 + skyvern/client/client.py | 38 +- skyvern/client/core/client_wrapper.py | 41 +- skyvern/client/core/http_client.py | 12 +- skyvern/client/core/pydantic_utilities.py | 4 +- skyvern/client/environment.py | 2 + skyvern/client/server/client.py | 542 +- skyvern/client/session/__init__.py | 2 + skyvern/client/session/client.py | 499 ++ skyvern/client/types/__init__.py | 152 +- skyvern/client/types/action.py | 1 + skyvern/client/types/action_block.py | 6 +- .../types/action_block_parameters_item.py | 34 +- skyvern/client/types/action_result.py | 4 +- .../client/types/ai_suggestion_base_output.py | 5 - .../bitwarden_login_credential_parameter.py | 3 +- skyvern/client/types/block_type.py | 1 + skyvern/client/types/code_block.py | 5 - .../types/code_block_parameters_item.py | 34 +- skyvern/client/types/context_parameter.py | 8 +- .../client/types/create_credential_request.py | 23 + skyvern/client/types/credential.py | 7 + skyvern/client/types/credential_parameter.py | 27 + skyvern/client/types/credential_response.py | 24 + skyvern/client/types/credential_type.py | 5 + ....py => credit_card_credential_response.py} | 8 +- skyvern/client/types/data.py | 5 + ...to_s_3_block.py => download_to_s3block.py} | 0 skyvern/client/types/entity_type.py | 4 +- skyvern/client/types/extraction_block.py | 6 +- .../types/extraction_block_parameters_item.py | 34 +- skyvern/client/types/file_download_block.py | 6 +- .../file_download_block_parameters_item.py | 34 +- skyvern/client/types/file_info.py | 36 + ...uggestion_type.py => file_storage_type.py} | 2 +- skyvern/client/types/file_upload_block.py | 31 + skyvern/client/types/for_loop_block.py | 1 - .../types/for_loop_block_loop_blocks_item.py | 48 +- .../client/types/for_loop_block_loop_over.py | 34 +- skyvern/client/types/login_block.py | 6 +- .../types/login_block_parameters_item.py | 34 +- skyvern/client/types/navigation_block.py | 6 +- .../types/navigation_block_parameters_item.py | 34 +- .../types/non_empty_credit_card_credential.py | 24 + .../types/non_empty_password_credential.py | 21 + skyvern/client/types/observer_thought_type.py | 5 - skyvern/client/types/output.py | 5 + .../types/password_credential_response.py | 19 + skyvern/client/types/proxy_location.py | 5 + skyvern/client/types/run_engine.py | 5 + ...{context_parameter_source.py => source.py} | 64 +- skyvern/client/types/step.py | 2 + skyvern/client/types/task_block.py | 6 +- .../types/task_block_parameters_item.py | 34 +- skyvern/client/types/task_response.py | 2 + skyvern/client/types/task_run_response.py | 41 + ...sk_run_response_data_extraction_schema.py} | 2 +- skyvern/client/types/task_run_status.py | 8 + .../types/{observer_task.py => task_v2.py} | 13 +- .../{task_v_2_block.py => task_v2block.py} | 1 + ...=> task_v2extracted_information_schema.py} | 2 +- ...server_task_status.py => task_v2status.py} | 2 +- skyvern/client/types/text_prompt_block.py | 5 - .../text_prompt_block_parameters_item.py | 34 +- .../types/{observer_thought.py => thought.py} | 12 +- ...hought_scenario.py => thought_scenario.py} | 2 +- skyvern/client/types/thought_type.py | 5 + ...d_to_s_3_block.py => upload_to_s3block.py} | 0 skyvern/client/types/url_block.py | 6 +- .../client/types/url_block_parameters_item.py | 34 +- skyvern/client/types/validation_block.py | 6 +- .../types/validation_block_parameters_item.py | 34 +- .../{context_parameter_value.py => value.py} | 2 +- skyvern/client/types/wait_block.py | 5 - .../types/wait_block_parameters_item.py | 34 +- skyvern/client/types/workflow.py | 6 - skyvern/client/types/workflow_definition.py | 6 - .../types/workflow_definition_blocks_item.py | 50 +- .../workflow_definition_parameters_item.py | 34 +- .../client/types/workflow_parameter_type.py | 2 +- skyvern/client/types/workflow_run.py | 1 + skyvern/client/types/workflow_run_block.py | 4 +- ...s_response.py => workflow_run_response.py} | 7 +- skyvern/client/types/workflow_run_timeline.py | 4 +- 94 files changed, 3691 insertions(+), 5149 deletions(-) create mode 100644 skyvern/client/agent/types/agent_get_runs_response_item.py create mode 100644 skyvern/client/agent/types/agent_run_task_v2request_x_max_iterations_override.py create mode 100644 skyvern/client/agent/types/agent_run_task_v2request_x_max_steps_override.py rename skyvern/client/{types/observer_task_output.py => agent/types/task_run_request_data_extraction_schema.py} (77%) create mode 100644 skyvern/client/agent/types/task_v2request_extracted_information_schema.py create mode 100644 skyvern/client/session/__init__.py create mode 100644 skyvern/client/session/client.py delete mode 100644 skyvern/client/types/ai_suggestion_base_output.py create mode 100644 skyvern/client/types/create_credential_request.py create mode 100644 skyvern/client/types/credential.py create mode 100644 skyvern/client/types/credential_parameter.py create mode 100644 skyvern/client/types/credential_response.py create mode 100644 skyvern/client/types/credential_type.py rename skyvern/client/types/{ai_suggestion_base.py => credit_card_credential_response.py} (75%) create mode 100644 skyvern/client/types/data.py rename skyvern/client/types/{download_to_s_3_block.py => download_to_s3block.py} (100%) create mode 100644 skyvern/client/types/file_info.py rename skyvern/client/types/{ai_suggestion_type.py => file_storage_type.py} (62%) create mode 100644 skyvern/client/types/file_upload_block.py create mode 100644 skyvern/client/types/non_empty_credit_card_credential.py create mode 100644 skyvern/client/types/non_empty_password_credential.py delete mode 100644 skyvern/client/types/observer_thought_type.py create mode 100644 skyvern/client/types/output.py create mode 100644 skyvern/client/types/password_credential_response.py create mode 100644 skyvern/client/types/run_engine.py rename skyvern/client/types/{context_parameter_source.py => source.py} (78%) create mode 100644 skyvern/client/types/task_run_response.py rename skyvern/client/types/{workflow_run_block_output.py => task_run_response_data_extraction_schema.py} (77%) create mode 100644 skyvern/client/types/task_run_status.py rename skyvern/client/types/{observer_task.py => task_v2.py} (72%) rename skyvern/client/types/{task_v_2_block.py => task_v2block.py} (95%) rename skyvern/client/types/{action_result_data.py => task_v2extracted_information_schema.py} (78%) rename skyvern/client/types/{observer_task_status.py => task_v2status.py} (85%) rename skyvern/client/types/{observer_thought.py => thought.py} (78%) rename skyvern/client/types/{observer_thought_scenario.py => thought_scenario.py} (89%) create mode 100644 skyvern/client/types/thought_type.py rename skyvern/client/types/{upload_to_s_3_block.py => upload_to_s3block.py} (100%) rename skyvern/client/types/{context_parameter_value.py => value.py} (83%) rename skyvern/client/types/{workflow_run_status_response.py => workflow_run_response.py} (86%) diff --git a/fern/fern.config.json b/fern/fern.config.json index faf0eeb1..6ddbd005 100644 --- a/fern/fern.config.json +++ b/fern/fern.config.json @@ -1,4 +1,4 @@ { - "organization": "skyverndocs", + "organization": "skyvern", "version": "0.56.29" } diff --git a/fern/openapi/skyvern_openapi.json b/fern/openapi/skyvern_openapi.json index 5864d2f8..055a27be 100644 --- a/fern/openapi/skyvern_openapi.json +++ b/fern/openapi/skyvern_openapi.json @@ -6,6 +6,83 @@ "version": "1.0.0" }, "paths": { + "/v1/tasks": { + "post": { + "tags": [ + "agent" + ], + "summary": "Run Task", + "operationId": "run_task_v1_tasks_post", + "parameters": [ + { + "name": "x-api-key", + "in": "header", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "X-Api-Key" + } + }, + { + "name": "authorization", + "in": "header", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Authorization" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TaskRunRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TaskRunResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "x-fern-sdk-group-name": "agent", + "x-fern-sdk-method-name": "run_task" + } + }, "/api/v1/webhook": { "post": { "tags": [ @@ -2650,6 +2727,13 @@ "title": "FileParserBlockYAML", "type": "object" }, + "FileStorageType": { + "enum": [ + "s3" + ], + "title": "FileStorageType", + "type": "string" + }, "FileType": { "enum": [ "csv" @@ -2657,6 +2741,89 @@ "title": "FileType", "type": "string" }, + "FileUploadBlockYAML": { + "properties": { + "block_type": { + "const": "file_upload", + "default": "file_upload", + "title": "Block Type", + "type": "string" + }, + "label": { + "title": "Label", + "type": "string" + }, + "continue_on_failure": { + "default": false, + "title": "Continue On Failure", + "type": "boolean" + }, + "storage_type": { + "$ref": "#/$defs/FileStorageType", + "default": "s3" + }, + "s3_bucket": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "S3 Bucket" + }, + "aws_access_key_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Access Key Id" + }, + "aws_secret_access_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Secret Access Key" + }, + "region_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Region Name" + }, + "path": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Path" + } + }, + "required": [ + "label" + ], + "title": "FileUploadBlockYAML", + "type": "object" + }, "ForLoopBlockYAML": { "properties": { "block_type": { @@ -2695,6 +2862,9 @@ { "$ref": "#/$defs/UploadToS3BlockYAML" }, + { + "$ref": "#/$defs/FileUploadBlockYAML" + }, { "$ref": "#/$defs/SendEmailBlockYAML" }, @@ -3795,6 +3965,7 @@ "download_to_s3": "#/$defs/DownloadToS3BlockYAML", "extraction": "#/$defs/ExtractionBlockYAML", "file_download": "#/$defs/FileDownloadBlockYAML", + "file_upload": "#/$defs/FileUploadBlockYAML", "file_url_parser": "#/$defs/FileParserBlockYAML", "for_loop": "#/$defs/ForLoopBlockYAML", "goto_url": "#/$defs/UrlBlockYAML", @@ -3830,6 +4001,9 @@ { "$ref": "#/$defs/UploadToS3BlockYAML" }, + { + "$ref": "#/$defs/FileUploadBlockYAML" + }, { "$ref": "#/$defs/SendEmailBlockYAML" }, @@ -5023,6 +5197,13 @@ "title": "FileParserBlockYAML", "type": "object" }, + "FileStorageType": { + "enum": [ + "s3" + ], + "title": "FileStorageType", + "type": "string" + }, "FileType": { "enum": [ "csv" @@ -5030,6 +5211,89 @@ "title": "FileType", "type": "string" }, + "FileUploadBlockYAML": { + "properties": { + "block_type": { + "const": "file_upload", + "default": "file_upload", + "title": "Block Type", + "type": "string" + }, + "label": { + "title": "Label", + "type": "string" + }, + "continue_on_failure": { + "default": false, + "title": "Continue On Failure", + "type": "boolean" + }, + "storage_type": { + "$ref": "#/$defs/FileStorageType", + "default": "s3" + }, + "s3_bucket": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "S3 Bucket" + }, + "aws_access_key_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Access Key Id" + }, + "aws_secret_access_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Secret Access Key" + }, + "region_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Region Name" + }, + "path": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Path" + } + }, + "required": [ + "label" + ], + "title": "FileUploadBlockYAML", + "type": "object" + }, "ForLoopBlockYAML": { "properties": { "block_type": { @@ -5068,6 +5332,9 @@ { "$ref": "#/$defs/UploadToS3BlockYAML" }, + { + "$ref": "#/$defs/FileUploadBlockYAML" + }, { "$ref": "#/$defs/SendEmailBlockYAML" }, @@ -6168,6 +6435,7 @@ "download_to_s3": "#/$defs/DownloadToS3BlockYAML", "extraction": "#/$defs/ExtractionBlockYAML", "file_download": "#/$defs/FileDownloadBlockYAML", + "file_upload": "#/$defs/FileUploadBlockYAML", "file_url_parser": "#/$defs/FileParserBlockYAML", "for_loop": "#/$defs/ForLoopBlockYAML", "goto_url": "#/$defs/UrlBlockYAML", @@ -6203,6 +6471,9 @@ { "$ref": "#/$defs/UploadToS3BlockYAML" }, + { + "$ref": "#/$defs/FileUploadBlockYAML" + }, { "$ref": "#/$defs/SendEmailBlockYAML" }, @@ -7006,7 +7277,7 @@ "/api/v1/browser_sessions/{browser_session_id}": { "get": { "tags": [ - "browser" + "session" ], "summary": "Get Browser Session", "operationId": "get_browser_session_api_v1_browser_sessions__browser_session_id__get", @@ -7075,14 +7346,14 @@ } } }, - "x-fern-sdk-group-name": "browser", + "x-fern-sdk-group-name": "session", "x-fern-sdk-method-name": "get_browser_session" } }, "/api/v1/browser_sessions": { "get": { "tags": [ - "browser" + "session" ], "summary": "Get Browser Sessions", "description": "Get all active browser sessions for the organization", @@ -7147,12 +7418,12 @@ } } }, - "x-fern-sdk-group-name": "browser", + "x-fern-sdk-group-name": "session", "x-fern-sdk-method-name": "get_browser_sessions" }, "post": { "tags": [ - "browser" + "session" ], "summary": "Create Browser Session", "operationId": "create_browser_session_api_v1_browser_sessions_post", @@ -7212,14 +7483,14 @@ } } }, - "x-fern-sdk-group-name": "browser", + "x-fern-sdk-group-name": "session", "x-fern-sdk-method-name": "create_browser_session" } }, "/api/v1/browser_sessions/{session_id}/close": { "post": { "tags": [ - "browser" + "session" ], "summary": "Close Browser Session", "operationId": "close_browser_session_api_v1_browser_sessions__session_id__close_post", @@ -7288,7 +7559,7 @@ } } }, - "x-fern-sdk-group-name": "browser", + "x-fern-sdk-group-name": "session", "x-fern-sdk-method-name": "close_browser_session" } }, @@ -7487,8 +7758,11 @@ }, "/api/v1/totp": { "post": { - "summary": "Save Totp Code", - "operationId": "save_totp_code_api_v1_totp_post", + "tags": [ + "agent" + ], + "summary": "Send Totp Code", + "operationId": "send_totp_code_api_v1_totp_post", "parameters": [ { "name": "x-api-key", @@ -7554,7 +7828,9 @@ } } } - } + }, + "x-fern-sdk-group-name": "agent", + "x-fern-sdk-method-name": "send_totp_code" } } }, @@ -8874,6 +9150,7 @@ "text_prompt", "download_to_s3", "upload_to_s3", + "file_upload", "send_email", "file_url_parser", "validation", @@ -9887,6 +10164,13 @@ ], "title": "FileParserBlock" }, + "FileStorageType": { + "type": "string", + "enum": [ + "s3" + ], + "title": "FileStorageType" + }, "FileType": { "type": "string", "enum": [ @@ -9894,6 +10178,93 @@ ], "title": "FileType" }, + "FileUploadBlock": { + "properties": { + "label": { + "type": "string", + "title": "Label" + }, + "block_type": { + "type": "string", + "const": "file_upload", + "title": "Block Type", + "default": "file_upload" + }, + "output_parameter": { + "$ref": "#/components/schemas/OutputParameter" + }, + "continue_on_failure": { + "type": "boolean", + "title": "Continue On Failure", + "default": false + }, + "storage_type": { + "$ref": "#/components/schemas/FileStorageType", + "default": "s3" + }, + "s3_bucket": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "S3 Bucket" + }, + "aws_access_key_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Access Key Id" + }, + "aws_secret_access_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Secret Access Key" + }, + "region_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Region Name" + }, + "path": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Path" + } + }, + "type": "object", + "required": [ + "label", + "output_parameter" + ], + "title": "FileUploadBlock" + }, "ForLoopBlock": { "properties": { "label": { @@ -9970,6 +10341,9 @@ }, { "$ref": "#/components/schemas/TaskV2Block" + }, + { + "$ref": "#/components/schemas/FileUploadBlock" } ], "discriminator": { @@ -9980,6 +10354,7 @@ "download_to_s3": "#/components/schemas/DownloadToS3Block", "extraction": "#/components/schemas/ExtractionBlock", "file_download": "#/components/schemas/FileDownloadBlock", + "file_upload": "#/components/schemas/FileUploadBlock", "file_url_parser": "#/components/schemas/FileParserBlock", "for_loop": "#/components/schemas/ForLoopBlock", "goto_url": "#/components/schemas/UrlBlock", @@ -12835,6 +13210,149 @@ ], "title": "TaskResponse" }, + "TaskRunRequest": { + "properties": { + "goal": { + "type": "string", + "title": "Goal" + }, + "url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Url" + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Title" + }, + "engine": { + "$ref": "#/components/schemas/RunEngine", + "default": "skyvern-1.0" + }, + "proxy_location": { + "anyOf": [ + { + "$ref": "#/components/schemas/ProxyLocation" + }, + { + "type": "null" + } + ] + }, + "data_extraction_schema": { + "anyOf": [ + { + "type": "object" + }, + { + "items": { + + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Data Extraction Schema" + }, + "error_code_mapping": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Error Code Mapping" + }, + "max_steps": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Max Steps" + }, + "webhook_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Webhook Url" + }, + "totp_identifier": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Totp Identifier" + }, + "totp_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Totp Url" + }, + "browser_session_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Browser Session Id" + }, + "publish_workflow": { + "type": "boolean", + "title": "Publish Workflow", + "default": false + } + }, + "type": "object", + "required": [ + "goal" + ], + "title": "TaskRunRequest" + }, "TaskRunResponse": { "properties": { "run_id": { @@ -12958,6 +13476,26 @@ ], "title": "Error Code Mapping" }, + "data_extraction_schema": { + "anyOf": [ + { + "type": "object" + }, + { + "items": { + + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Data Extraction Schema" + }, "title": { "anyOf": [ { @@ -14648,6 +15186,9 @@ }, { "$ref": "#/components/schemas/TaskV2Block" + }, + { + "$ref": "#/components/schemas/FileUploadBlock" } ], "discriminator": { @@ -14658,6 +15199,7 @@ "download_to_s3": "#/components/schemas/DownloadToS3Block", "extraction": "#/components/schemas/ExtractionBlock", "file_download": "#/components/schemas/FileDownloadBlock", + "file_upload": "#/components/schemas/FileUploadBlock", "file_url_parser": "#/components/schemas/FileParserBlock", "for_loop": "#/components/schemas/ForLoopBlock", "goto_url": "#/components/schemas/UrlBlock", @@ -15611,6 +16153,14 @@ { "url": "https://api.skyvern.com", "x-fern-server-name": "Production" + }, + { + "url": "https://api-staging.skyvern.com", + "x-fern-server-name": "Staging" + }, + { + "url": "http://localhost:8000", + "x-fern-server-name": "Development" } ] } \ No newline at end of file diff --git a/skyvern/client/__init__.py b/skyvern/client/__init__.py index dfd585e5..37f99028 100644 --- a/skyvern/client/__init__.py +++ b/skyvern/client/__init__.py @@ -10,16 +10,13 @@ from .types import ( ActionBlockParametersItem_BitwardenLoginCredential, ActionBlockParametersItem_BitwardenSensitiveInformation, ActionBlockParametersItem_Context, + ActionBlockParametersItem_Credential, ActionBlockParametersItem_Output, ActionBlockParametersItem_Workflow, ActionResult, - ActionResultData, ActionStatus, ActionType, AgentStepOutput, - AiSuggestionBase, - AiSuggestionBaseOutput, - AiSuggestionType, Artifact, ArtifactType, AwsSecretParameter, @@ -35,19 +32,18 @@ from .types import ( CodeBlockParametersItem_BitwardenLoginCredential, CodeBlockParametersItem_BitwardenSensitiveInformation, CodeBlockParametersItem_Context, + CodeBlockParametersItem_Credential, CodeBlockParametersItem_Output, CodeBlockParametersItem_Workflow, ContextParameter, - ContextParameterSource, - ContextParameterSource_AwsSecret, - ContextParameterSource_BitwardenCreditCardData, - ContextParameterSource_BitwardenLoginCredential, - ContextParameterSource_BitwardenSensitiveInformation, - ContextParameterSource_Context, - ContextParameterSource_Output, - ContextParameterSource_Workflow, - ContextParameterValue, + CreateCredentialRequest, CreateTaskResponse, + Credential, + CredentialParameter, + CredentialResponse, + CredentialType, + CreditCardCredentialResponse, + Data, DownloadToS3Block, EntityType, ExtractionBlock, @@ -58,6 +54,7 @@ from .types import ( ExtractionBlockParametersItem_BitwardenLoginCredential, ExtractionBlockParametersItem_BitwardenSensitiveInformation, ExtractionBlockParametersItem_Context, + ExtractionBlockParametersItem_Credential, ExtractionBlockParametersItem_Output, ExtractionBlockParametersItem_Workflow, FileDownloadBlock, @@ -68,10 +65,14 @@ from .types import ( FileDownloadBlockParametersItem_BitwardenLoginCredential, FileDownloadBlockParametersItem_BitwardenSensitiveInformation, FileDownloadBlockParametersItem_Context, + FileDownloadBlockParametersItem_Credential, FileDownloadBlockParametersItem_Output, FileDownloadBlockParametersItem_Workflow, + FileInfo, FileParserBlock, + FileStorageType, FileType, + FileUploadBlock, ForLoopBlock, ForLoopBlockLoopBlocksItem, ForLoopBlockLoopBlocksItem_Action, @@ -79,6 +80,7 @@ from .types import ( ForLoopBlockLoopBlocksItem_DownloadToS3, ForLoopBlockLoopBlocksItem_Extraction, ForLoopBlockLoopBlocksItem_FileDownload, + ForLoopBlockLoopBlocksItem_FileUpload, ForLoopBlockLoopBlocksItem_FileUrlParser, ForLoopBlockLoopBlocksItem_ForLoop, ForLoopBlockLoopBlocksItem_GotoUrl, @@ -98,6 +100,7 @@ from .types import ( ForLoopBlockLoopOver_BitwardenLoginCredential, ForLoopBlockLoopOver_BitwardenSensitiveInformation, ForLoopBlockLoopOver_Context, + ForLoopBlockLoopOver_Credential, ForLoopBlockLoopOver_Output, ForLoopBlockLoopOver_Workflow, GetOrganizationApiKeysResponse, @@ -111,6 +114,7 @@ from .types import ( LoginBlockParametersItem_BitwardenLoginCredential, LoginBlockParametersItem_BitwardenSensitiveInformation, LoginBlockParametersItem_Context, + LoginBlockParametersItem_Credential, LoginBlockParametersItem_Output, LoginBlockParametersItem_Workflow, NavigationBlock, @@ -121,25 +125,34 @@ from .types import ( NavigationBlockParametersItem_BitwardenLoginCredential, NavigationBlockParametersItem_BitwardenSensitiveInformation, NavigationBlockParametersItem_Context, + NavigationBlockParametersItem_Credential, NavigationBlockParametersItem_Output, NavigationBlockParametersItem_Workflow, - ObserverTask, - ObserverTaskOutput, - ObserverTaskStatus, - ObserverThought, - ObserverThoughtScenario, - ObserverThoughtType, + NonEmptyCreditCardCredential, + NonEmptyPasswordCredential, OrderBy, Organization, OrganizationAuthToken, OrganizationAuthTokenType, + Output, OutputParameter, + PasswordCredentialResponse, PdfParserBlock, ProxyLocation, + RunEngine, RunWorkflowResponse, SelectOption, SendEmailBlock, SortDirection, + Source, + Source_AwsSecret, + Source_BitwardenCreditCardData, + Source_BitwardenLoginCredential, + Source_BitwardenSensitiveInformation, + Source_Context, + Source_Credential, + Source_Output, + Source_Workflow, Step, StepStatus, Task, @@ -154,6 +167,7 @@ from .types import ( TaskBlockParametersItem_BitwardenLoginCredential, TaskBlockParametersItem_BitwardenSensitiveInformation, TaskBlockParametersItem_Context, + TaskBlockParametersItem_Credential, TaskBlockParametersItem_Output, TaskBlockParametersItem_Workflow, TaskExtractedInformation, @@ -162,9 +176,15 @@ from .types import ( TaskNavigationPayload, TaskResponse, TaskResponseExtractedInformation, + TaskRunResponse, + TaskRunResponseDataExtractionSchema, + TaskRunStatus, TaskStatus, TaskType, + TaskV2, TaskV2Block, + TaskV2ExtractedInformationSchema, + TaskV2Status, TextPromptBlock, TextPromptBlockParametersItem, TextPromptBlockParametersItem_AwsSecret, @@ -172,8 +192,12 @@ from .types import ( TextPromptBlockParametersItem_BitwardenLoginCredential, TextPromptBlockParametersItem_BitwardenSensitiveInformation, TextPromptBlockParametersItem_Context, + TextPromptBlockParametersItem_Credential, TextPromptBlockParametersItem_Output, TextPromptBlockParametersItem_Workflow, + Thought, + ThoughtScenario, + ThoughtType, TotpCode, UploadToS3Block, UrlBlock, @@ -184,6 +208,7 @@ from .types import ( UrlBlockParametersItem_BitwardenLoginCredential, UrlBlockParametersItem_BitwardenSensitiveInformation, UrlBlockParametersItem_Context, + UrlBlockParametersItem_Credential, UrlBlockParametersItem_Output, UrlBlockParametersItem_Workflow, UserDefinedError, @@ -195,10 +220,12 @@ from .types import ( ValidationBlockParametersItem_BitwardenLoginCredential, ValidationBlockParametersItem_BitwardenSensitiveInformation, ValidationBlockParametersItem_Context, + ValidationBlockParametersItem_Credential, ValidationBlockParametersItem_Output, ValidationBlockParametersItem_Workflow, ValidationError, ValidationErrorLocItem, + Value, WaitBlock, WaitBlockParametersItem, WaitBlockParametersItem_AwsSecret, @@ -206,6 +233,7 @@ from .types import ( WaitBlockParametersItem_BitwardenLoginCredential, WaitBlockParametersItem_BitwardenSensitiveInformation, WaitBlockParametersItem_Context, + WaitBlockParametersItem_Credential, WaitBlockParametersItem_Output, WaitBlockParametersItem_Workflow, Workflow, @@ -216,6 +244,7 @@ from .types import ( WorkflowDefinitionBlocksItem_DownloadToS3, WorkflowDefinitionBlocksItem_Extraction, WorkflowDefinitionBlocksItem_FileDownload, + WorkflowDefinitionBlocksItem_FileUpload, WorkflowDefinitionBlocksItem_FileUrlParser, WorkflowDefinitionBlocksItem_ForLoop, WorkflowDefinitionBlocksItem_GotoUrl, @@ -235,6 +264,7 @@ from .types import ( WorkflowDefinitionParametersItem_BitwardenLoginCredential, WorkflowDefinitionParametersItem_BitwardenSensitiveInformation, WorkflowDefinitionParametersItem_Context, + WorkflowDefinitionParametersItem_Credential, WorkflowDefinitionParametersItem_Output, WorkflowDefinitionParametersItem_Workflow, WorkflowParameter, @@ -244,16 +274,23 @@ from .types import ( WorkflowRunBlock, WorkflowRunBlockDataSchema, WorkflowRunBlockNavigationPayload, - WorkflowRunBlockOutput, - WorkflowRunStatus, WorkflowRunResponse, + WorkflowRunStatus, WorkflowRunTimeline, WorkflowRunTimelineType, WorkflowStatus, ) from .errors import UnprocessableEntityError -from . import agent, server -from .agent import TaskRequestExtractedInformationSchema, TaskRequestNavigationPayload +from . import agent, server, session +from .agent import ( + AgentGetRunsResponseItem, + AgentRunTaskV2RequestXMaxIterationsOverride, + AgentRunTaskV2RequestXMaxStepsOverride, + TaskRequestExtractedInformationSchema, + TaskRequestNavigationPayload, + TaskRunRequestDataExtractionSchema, + TaskV2RequestExtractedInformationSchema, +) from .client import AsyncSkyvern, Skyvern from .environment import SkyvernEnvironment from .version import __version__ @@ -268,16 +305,16 @@ __all__ = [ "ActionBlockParametersItem_BitwardenLoginCredential", "ActionBlockParametersItem_BitwardenSensitiveInformation", "ActionBlockParametersItem_Context", + "ActionBlockParametersItem_Credential", "ActionBlockParametersItem_Output", "ActionBlockParametersItem_Workflow", "ActionResult", - "ActionResultData", "ActionStatus", "ActionType", + "AgentGetRunsResponseItem", + "AgentRunTaskV2RequestXMaxIterationsOverride", + "AgentRunTaskV2RequestXMaxStepsOverride", "AgentStepOutput", - "AiSuggestionBase", - "AiSuggestionBaseOutput", - "AiSuggestionType", "Artifact", "ArtifactType", "AsyncSkyvern", @@ -294,19 +331,18 @@ __all__ = [ "CodeBlockParametersItem_BitwardenLoginCredential", "CodeBlockParametersItem_BitwardenSensitiveInformation", "CodeBlockParametersItem_Context", + "CodeBlockParametersItem_Credential", "CodeBlockParametersItem_Output", "CodeBlockParametersItem_Workflow", "ContextParameter", - "ContextParameterSource", - "ContextParameterSource_AwsSecret", - "ContextParameterSource_BitwardenCreditCardData", - "ContextParameterSource_BitwardenLoginCredential", - "ContextParameterSource_BitwardenSensitiveInformation", - "ContextParameterSource_Context", - "ContextParameterSource_Output", - "ContextParameterSource_Workflow", - "ContextParameterValue", + "CreateCredentialRequest", "CreateTaskResponse", + "Credential", + "CredentialParameter", + "CredentialResponse", + "CredentialType", + "CreditCardCredentialResponse", + "Data", "DownloadToS3Block", "EntityType", "ExtractionBlock", @@ -317,6 +353,7 @@ __all__ = [ "ExtractionBlockParametersItem_BitwardenLoginCredential", "ExtractionBlockParametersItem_BitwardenSensitiveInformation", "ExtractionBlockParametersItem_Context", + "ExtractionBlockParametersItem_Credential", "ExtractionBlockParametersItem_Output", "ExtractionBlockParametersItem_Workflow", "FileDownloadBlock", @@ -327,10 +364,14 @@ __all__ = [ "FileDownloadBlockParametersItem_BitwardenLoginCredential", "FileDownloadBlockParametersItem_BitwardenSensitiveInformation", "FileDownloadBlockParametersItem_Context", + "FileDownloadBlockParametersItem_Credential", "FileDownloadBlockParametersItem_Output", "FileDownloadBlockParametersItem_Workflow", + "FileInfo", "FileParserBlock", + "FileStorageType", "FileType", + "FileUploadBlock", "ForLoopBlock", "ForLoopBlockLoopBlocksItem", "ForLoopBlockLoopBlocksItem_Action", @@ -338,6 +379,7 @@ __all__ = [ "ForLoopBlockLoopBlocksItem_DownloadToS3", "ForLoopBlockLoopBlocksItem_Extraction", "ForLoopBlockLoopBlocksItem_FileDownload", + "ForLoopBlockLoopBlocksItem_FileUpload", "ForLoopBlockLoopBlocksItem_FileUrlParser", "ForLoopBlockLoopBlocksItem_ForLoop", "ForLoopBlockLoopBlocksItem_GotoUrl", @@ -357,6 +399,7 @@ __all__ = [ "ForLoopBlockLoopOver_BitwardenLoginCredential", "ForLoopBlockLoopOver_BitwardenSensitiveInformation", "ForLoopBlockLoopOver_Context", + "ForLoopBlockLoopOver_Credential", "ForLoopBlockLoopOver_Output", "ForLoopBlockLoopOver_Workflow", "GetOrganizationApiKeysResponse", @@ -370,6 +413,7 @@ __all__ = [ "LoginBlockParametersItem_BitwardenLoginCredential", "LoginBlockParametersItem_BitwardenSensitiveInformation", "LoginBlockParametersItem_Context", + "LoginBlockParametersItem_Credential", "LoginBlockParametersItem_Output", "LoginBlockParametersItem_Workflow", "NavigationBlock", @@ -380,27 +424,36 @@ __all__ = [ "NavigationBlockParametersItem_BitwardenLoginCredential", "NavigationBlockParametersItem_BitwardenSensitiveInformation", "NavigationBlockParametersItem_Context", + "NavigationBlockParametersItem_Credential", "NavigationBlockParametersItem_Output", "NavigationBlockParametersItem_Workflow", - "ObserverTask", - "ObserverTaskOutput", - "ObserverTaskStatus", - "ObserverThought", - "ObserverThoughtScenario", - "ObserverThoughtType", + "NonEmptyCreditCardCredential", + "NonEmptyPasswordCredential", "OrderBy", "Organization", "OrganizationAuthToken", "OrganizationAuthTokenType", + "Output", "OutputParameter", + "PasswordCredentialResponse", "PdfParserBlock", "ProxyLocation", + "RunEngine", "RunWorkflowResponse", "SelectOption", "SendEmailBlock", "Skyvern", "SkyvernEnvironment", "SortDirection", + "Source", + "Source_AwsSecret", + "Source_BitwardenCreditCardData", + "Source_BitwardenLoginCredential", + "Source_BitwardenSensitiveInformation", + "Source_Context", + "Source_Credential", + "Source_Output", + "Source_Workflow", "Step", "StepStatus", "Task", @@ -415,6 +468,7 @@ __all__ = [ "TaskBlockParametersItem_BitwardenLoginCredential", "TaskBlockParametersItem_BitwardenSensitiveInformation", "TaskBlockParametersItem_Context", + "TaskBlockParametersItem_Credential", "TaskBlockParametersItem_Output", "TaskBlockParametersItem_Workflow", "TaskExtractedInformation", @@ -425,9 +479,17 @@ __all__ = [ "TaskRequestNavigationPayload", "TaskResponse", "TaskResponseExtractedInformation", + "TaskRunRequestDataExtractionSchema", + "TaskRunResponse", + "TaskRunResponseDataExtractionSchema", + "TaskRunStatus", "TaskStatus", "TaskType", + "TaskV2", "TaskV2Block", + "TaskV2ExtractedInformationSchema", + "TaskV2RequestExtractedInformationSchema", + "TaskV2Status", "TextPromptBlock", "TextPromptBlockParametersItem", "TextPromptBlockParametersItem_AwsSecret", @@ -435,8 +497,12 @@ __all__ = [ "TextPromptBlockParametersItem_BitwardenLoginCredential", "TextPromptBlockParametersItem_BitwardenSensitiveInformation", "TextPromptBlockParametersItem_Context", + "TextPromptBlockParametersItem_Credential", "TextPromptBlockParametersItem_Output", "TextPromptBlockParametersItem_Workflow", + "Thought", + "ThoughtScenario", + "ThoughtType", "TotpCode", "UnprocessableEntityError", "UploadToS3Block", @@ -448,6 +514,7 @@ __all__ = [ "UrlBlockParametersItem_BitwardenLoginCredential", "UrlBlockParametersItem_BitwardenSensitiveInformation", "UrlBlockParametersItem_Context", + "UrlBlockParametersItem_Credential", "UrlBlockParametersItem_Output", "UrlBlockParametersItem_Workflow", "UserDefinedError", @@ -459,10 +526,12 @@ __all__ = [ "ValidationBlockParametersItem_BitwardenLoginCredential", "ValidationBlockParametersItem_BitwardenSensitiveInformation", "ValidationBlockParametersItem_Context", + "ValidationBlockParametersItem_Credential", "ValidationBlockParametersItem_Output", "ValidationBlockParametersItem_Workflow", "ValidationError", "ValidationErrorLocItem", + "Value", "WaitBlock", "WaitBlockParametersItem", "WaitBlockParametersItem_AwsSecret", @@ -470,6 +539,7 @@ __all__ = [ "WaitBlockParametersItem_BitwardenLoginCredential", "WaitBlockParametersItem_BitwardenSensitiveInformation", "WaitBlockParametersItem_Context", + "WaitBlockParametersItem_Credential", "WaitBlockParametersItem_Output", "WaitBlockParametersItem_Workflow", "Workflow", @@ -480,6 +550,7 @@ __all__ = [ "WorkflowDefinitionBlocksItem_DownloadToS3", "WorkflowDefinitionBlocksItem_Extraction", "WorkflowDefinitionBlocksItem_FileDownload", + "WorkflowDefinitionBlocksItem_FileUpload", "WorkflowDefinitionBlocksItem_FileUrlParser", "WorkflowDefinitionBlocksItem_ForLoop", "WorkflowDefinitionBlocksItem_GotoUrl", @@ -499,6 +570,7 @@ __all__ = [ "WorkflowDefinitionParametersItem_BitwardenLoginCredential", "WorkflowDefinitionParametersItem_BitwardenSensitiveInformation", "WorkflowDefinitionParametersItem_Context", + "WorkflowDefinitionParametersItem_Credential", "WorkflowDefinitionParametersItem_Output", "WorkflowDefinitionParametersItem_Workflow", "WorkflowParameter", @@ -508,13 +580,13 @@ __all__ = [ "WorkflowRunBlock", "WorkflowRunBlockDataSchema", "WorkflowRunBlockNavigationPayload", - "WorkflowRunBlockOutput", - "WorkflowRunStatus", "WorkflowRunResponse", + "WorkflowRunStatus", "WorkflowRunTimeline", "WorkflowRunTimelineType", "WorkflowStatus", "__version__", "agent", "server", + "session", ] diff --git a/skyvern/client/agent/__init__.py b/skyvern/client/agent/__init__.py index 3814a00d..98599623 100644 --- a/skyvern/client/agent/__init__.py +++ b/skyvern/client/agent/__init__.py @@ -1,5 +1,21 @@ # This file was auto-generated by Fern from our API Definition. -from .types import TaskRequestExtractedInformationSchema, TaskRequestNavigationPayload +from .types import ( + AgentGetRunsResponseItem, + AgentRunTaskV2RequestXMaxIterationsOverride, + AgentRunTaskV2RequestXMaxStepsOverride, + TaskRequestExtractedInformationSchema, + TaskRequestNavigationPayload, + TaskRunRequestDataExtractionSchema, + TaskV2RequestExtractedInformationSchema, +) -__all__ = ["TaskRequestExtractedInformationSchema", "TaskRequestNavigationPayload"] +__all__ = [ + "AgentGetRunsResponseItem", + "AgentRunTaskV2RequestXMaxIterationsOverride", + "AgentRunTaskV2RequestXMaxStepsOverride", + "TaskRequestExtractedInformationSchema", + "TaskRequestNavigationPayload", + "TaskRunRequestDataExtractionSchema", + "TaskV2RequestExtractedInformationSchema", +] diff --git a/skyvern/client/agent/client.py b/skyvern/client/agent/client.py index 0232426d..4cb33607 100644 --- a/skyvern/client/agent/client.py +++ b/skyvern/client/agent/client.py @@ -1,44 +1,43 @@ # This file was auto-generated by Fern from our API Definition. -import asyncio -import time import typing from ..core.client_wrapper import SyncClientWrapper -from ..types.task_status import TaskStatus -from ..types.order_by import OrderBy -from ..types.sort_direction import SortDirection +from ..types.run_engine import RunEngine +from ..types.proxy_location import ProxyLocation +from .types.task_run_request_data_extraction_schema import TaskRunRequestDataExtractionSchema from ..core.request_options import RequestOptions -from ..types.task import Task +from ..types.task_run_response import TaskRunResponse +from ..core.serialization import convert_and_respect_annotation_metadata 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 ..types.task_status import TaskStatus +from ..types.order_by import OrderBy +from ..types.sort_direction import SortDirection +from ..types.task import Task from .types.task_request_navigation_payload import TaskRequestNavigationPayload -from ..types.proxy_location import ProxyLocation from .types.task_request_extracted_information_schema import TaskRequestExtractedInformationSchema from ..types.task_type import TaskType from ..types.create_task_response import CreateTaskResponse -from ..core.serialization import convert_and_respect_annotation_metadata -from ..types.step import Step -from ..core.jsonable_encoder import jsonable_encoder from ..types.task_response import TaskResponse +from ..core.jsonable_encoder import jsonable_encoder +from ..types.workflow_run_status import WorkflowRunStatus +from .types.agent_get_runs_response_item import AgentGetRunsResponseItem +from ..types.step import Step from ..types.entity_type import EntityType from ..types.artifact import Artifact from ..types.action import Action from ..types.run_workflow_response import RunWorkflowResponse -from ..types.workflow_run_status import WorkflowRunStatus from ..types.workflow_run import WorkflowRun from ..types.workflow_run_timeline import WorkflowRunTimeline -from ..types.workflow_run_status_response import WorkflowRunResponse +from ..types.workflow_run_response import WorkflowRunResponse from ..types.workflow import Workflow -from ..types.ai_suggestion_base import AiSuggestionBase from ..types.task_generation import TaskGeneration -from ..types.get_organizations_response import GetOrganizationsResponse -from ..types.organization import Organization -from ..types.get_organization_api_keys_response import GetOrganizationApiKeysResponse -from .. import core -from ..types.browser_session_response import BrowserSessionResponse +from .types.agent_run_task_v2request_x_max_iterations_override import AgentRunTaskV2RequestXMaxIterationsOverride +from .types.agent_run_task_v2request_x_max_steps_override import AgentRunTaskV2RequestXMaxStepsOverride +from .types.task_v2request_extracted_information_schema import TaskV2RequestExtractedInformationSchema import datetime as dt from ..types.totp_code import TotpCode from ..core.client_wrapper import AsyncClientWrapper @@ -51,6 +50,123 @@ class AgentClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper + def run_task( + self, + *, + goal: str, + url: typing.Optional[str] = OMIT, + title: typing.Optional[str] = OMIT, + engine: typing.Optional[RunEngine] = OMIT, + proxy_location: typing.Optional[ProxyLocation] = OMIT, + data_extraction_schema: typing.Optional[TaskRunRequestDataExtractionSchema] = OMIT, + error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, + max_steps: typing.Optional[int] = OMIT, + webhook_url: typing.Optional[str] = OMIT, + totp_identifier: typing.Optional[str] = OMIT, + totp_url: typing.Optional[str] = OMIT, + browser_session_id: typing.Optional[str] = OMIT, + publish_workflow: typing.Optional[bool] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> TaskRunResponse: + """ + Parameters + ---------- + goal : str + + url : typing.Optional[str] + + title : typing.Optional[str] + + engine : typing.Optional[RunEngine] + + proxy_location : typing.Optional[ProxyLocation] + + data_extraction_schema : typing.Optional[TaskRunRequestDataExtractionSchema] + + error_code_mapping : typing.Optional[typing.Dict[str, typing.Optional[str]]] + + max_steps : typing.Optional[int] + + webhook_url : typing.Optional[str] + + totp_identifier : typing.Optional[str] + + totp_url : typing.Optional[str] + + browser_session_id : typing.Optional[str] + + publish_workflow : typing.Optional[bool] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + TaskRunResponse + Successful Response + + Examples + -------- + from skyvern import Skyvern + + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.agent.run_task( + goal="goal", + ) + """ + _response = self._client_wrapper.httpx_client.request( + "v1/tasks", + method="POST", + json={ + "goal": goal, + "url": url, + "title": title, + "engine": engine, + "proxy_location": proxy_location, + "data_extraction_schema": convert_and_respect_annotation_metadata( + object_=data_extraction_schema, annotation=TaskRunRequestDataExtractionSchema, direction="write" + ), + "error_code_mapping": error_code_mapping, + "max_steps": max_steps, + "webhook_url": webhook_url, + "totp_identifier": totp_identifier, + "totp_url": totp_url, + "browser_session_id": browser_session_id, + "publish_workflow": publish_workflow, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + TaskRunResponse, + parse_obj_as( + type_=TaskRunResponse, # 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 get_tasks( self, *, @@ -62,8 +178,6 @@ class AgentClient: application: typing.Optional[str] = None, sort: typing.Optional[OrderBy] = None, order: typing.Optional[SortDirection] = None, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> typing.List[Task]: """ @@ -96,10 +210,6 @@ class AgentClient: order : typing.Optional[SortDirection] - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -110,9 +220,12 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) client.agent.get_tasks() """ _response = self._client_wrapper.httpx_client.request( @@ -128,10 +241,6 @@ class AgentClient: "sort": sort, "order": order, }, - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -158,13 +267,11 @@ class AgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def create_task( + def run_task_v1( self, *, url: str, - api_key: typing.Optional[str] = None, max_steps_override: typing.Optional[int] = None, - authorization: typing.Optional[str] = None, title: typing.Optional[str] = OMIT, webhook_callback_url: typing.Optional[str] = OMIT, totp_verification_url: typing.Optional[str] = OMIT, @@ -188,12 +295,8 @@ class AgentClient: url : str Starting URL for the task. - api_key : typing.Optional[str] - max_steps_override : typing.Optional[int] - authorization : typing.Optional[str] - title : typing.Optional[str] The title of the task. @@ -246,10 +349,13 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() - client.agent.create_task( + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.agent.run_task_v1( url="https://www.geico.com", ) """ @@ -282,9 +388,7 @@ class AgentClient: }, headers={ "content-type": "application/json", - "x-api-key": str(api_key) if api_key is not None else None, "x-max-steps-override": str(max_steps_override) if max_steps_override is not None else None, - "authorization": str(authorization) if authorization is not None else None, }, request_options=request_options, omit=OMIT, @@ -313,297 +417,12 @@ class AgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def run_task( - self, - *, - url: str, - api_key: typing.Optional[str] = None, - max_steps_override: typing.Optional[int] = None, - authorization: typing.Optional[str] = None, - title: typing.Optional[str] = OMIT, - webhook_callback_url: typing.Optional[str] = OMIT, - totp_verification_url: typing.Optional[str] = OMIT, - totp_identifier: typing.Optional[str] = OMIT, - navigation_goal: typing.Optional[str] = OMIT, - data_extraction_goal: typing.Optional[str] = OMIT, - navigation_payload: typing.Optional[TaskRequestNavigationPayload] = OMIT, - error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, - proxy_location: typing.Optional[ProxyLocation] = OMIT, - extracted_information_schema: typing.Optional[TaskRequestExtractedInformationSchema] = OMIT, - complete_criterion: typing.Optional[str] = OMIT, - terminate_criterion: typing.Optional[str] = OMIT, - task_type: typing.Optional[TaskType] = OMIT, - application: typing.Optional[str] = OMIT, - browser_session_id: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - timeout_seconds: int = 600, - ) -> TaskResponse: - created_task = self.create_task( - url=url, - api_key=api_key, - max_steps_override=max_steps_override, - authorization=authorization, - title=title, - webhook_callback_url=webhook_callback_url, - totp_verification_url=totp_verification_url, - totp_identifier=totp_identifier, - navigation_goal=navigation_goal, - data_extraction_goal=data_extraction_goal, - navigation_payload=navigation_payload, - error_code_mapping=error_code_mapping, - proxy_location=proxy_location, - extracted_information_schema=extracted_information_schema, - complete_criterion=complete_criterion, - terminate_criterion=terminate_criterion, - task_type=task_type, - application=application, - browser_session_id=browser_session_id, - request_options=request_options, - ) - - start_time = time.time() - while True: - if time.time() - start_time > timeout_seconds: - raise TimeoutError(f"Task timed out after {timeout_seconds} seconds") - - task = self.get_task( - created_task.task_id, api_key=api_key, authorization=authorization, request_options=request_options - ) - if task.status in ["timed_out", "failed", "terminated", "completed", "canceled"]: - return task - time.sleep(1) - - def get_task_steps( - self, - task_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.List[Step]: - """ - Get all steps for a task. - :param task_id: - :return: List of steps for a task with pagination. - - Parameters - ---------- - task_id : str - - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[Step] - Successful Response - - Examples - -------- - from skyverndocs import Skyvern - - client = Skyvern() - client.agent.get_task_steps( - task_id="task_id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"api/v1/tasks/{jsonable_encoder(task_id)}/steps", - method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[Step], - parse_obj_as( - type_=typing.List[Step], # 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 execute_task_steps( - self, - task_id: str, - *, - step_id: typing.Optional[str] = None, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> Step: + def get_task_v1(self, task_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> TaskResponse: """ Parameters ---------- task_id : str - step_id : typing.Optional[str] - - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - Step - Successful Response - - Examples - -------- - from skyverndocs import Skyvern - - client = Skyvern() - client.agent.execute_task_steps( - task_id="task_id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"api/v1/tasks/{jsonable_encoder(task_id)}/steps", - method="POST", - params={ - "step_id": step_id, - }, - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - Step, - parse_obj_as( - type_=Step, # 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 execute_task_step( - self, - task_id: str, - step_id: typing.Optional[str], - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> Step: - """ - Parameters - ---------- - task_id : str - - step_id : typing.Optional[str] - - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - Step - Successful Response - - Examples - -------- - from skyverndocs import Skyvern - - client = Skyvern() - client.agent.execute_task_step( - task_id="task_id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"api/v1/tasks/{jsonable_encoder(task_id)}/steps/{jsonable_encoder(step_id)}", - method="POST", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - Step, - parse_obj_as( - type_=Step, # 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 get_task( - self, - task_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> TaskResponse: - """ - Parameters - ---------- - task_id : str - - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -614,20 +433,19 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() - client.agent.get_task( + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.agent.get_task_v1( task_id="task_id", ) """ _response = self._client_wrapper.httpx_client.request( f"api/v1/tasks/{jsonable_encoder(task_id)}", method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -655,22 +473,13 @@ class AgentClient: raise ApiError(status_code=_response.status_code, body=_response_json) def cancel_task( - self, - task_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + self, task_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Optional[typing.Any]: """ Parameters ---------- task_id : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -681,9 +490,12 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) client.agent.cancel_task( task_id="task_id", ) @@ -691,10 +503,6 @@ class AgentClient: _response = self._client_wrapper.httpx_client.request( f"api/v1/tasks/{jsonable_encoder(task_id)}/cancel", method="POST", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -722,22 +530,13 @@ class AgentClient: raise ApiError(status_code=_response.status_code, body=_response_json) def cancel_workflow_run( - self, - workflow_run_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + self, workflow_run_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Optional[typing.Any]: """ Parameters ---------- workflow_run_id : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -748,9 +547,12 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) client.agent.cancel_workflow_run( workflow_run_id="workflow_run_id", ) @@ -758,10 +560,6 @@ class AgentClient: _response = self._client_wrapper.httpx_client.request( f"api/v1/workflows/runs/{jsonable_encoder(workflow_run_id)}/cancel", method="POST", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -788,23 +586,12 @@ class AgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def retry_webhook( - self, - task_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> TaskResponse: + def retry_webhook(self, task_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> TaskResponse: """ Parameters ---------- task_id : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -815,9 +602,12 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) client.agent.retry_webhook( task_id="task_id", ) @@ -825,10 +615,6 @@ class AgentClient: _response = self._client_wrapper.httpx_client.request( f"api/v1/tasks/{jsonable_encoder(task_id)}/retry_webhook", method="POST", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -855,139 +641,57 @@ class AgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_task_internal( - self, - task_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.List[Task]: - """ - Get all tasks. - :param page: Starting page, defaults to 1 - :param page_size: - :return: List of tasks with pagination without steps populated. Steps can be populated by calling the - get_agent_task endpoint. - - Parameters - ---------- - task_id : str - - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[Task] - Successful Response - - Examples - -------- - from skyverndocs import Skyvern - - client = Skyvern() - client.agent.get_task_internal( - task_id="task_id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"api/v1/internal/tasks/{jsonable_encoder(task_id)}", - method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[Task], - parse_obj_as( - type_=typing.List[Task], # 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 get_tasks_internal( + def get_runs( self, *, page: typing.Optional[int] = None, page_size: typing.Optional[int] = None, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, + status: typing.Optional[typing.Union[WorkflowRunStatus, typing.Sequence[WorkflowRunStatus]]] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> typing.List[Task]: + ) -> typing.List[AgentGetRunsResponseItem]: """ - Get all tasks. - :param page: Starting page, defaults to 1 - :param page_size: Page size, defaults to 10 - :return: List of tasks with pagination without steps populated. Steps can be populated by calling the - get_agent_task endpoint. - Parameters ---------- page : typing.Optional[int] page_size : typing.Optional[int] - api_key : typing.Optional[str] - - authorization : typing.Optional[str] + status : typing.Optional[typing.Union[WorkflowRunStatus, typing.Sequence[WorkflowRunStatus]]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - typing.List[Task] + typing.List[AgentGetRunsResponseItem] Successful Response Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() - client.agent.get_tasks_internal() + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.agent.get_runs() """ _response = self._client_wrapper.httpx_client.request( - "api/v1/internal/tasks", + "api/v1/runs", method="GET", params={ "page": page, "page_size": page_size, - }, - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, + "status": status, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: return typing.cast( - typing.List[Task], + typing.List[AgentGetRunsResponseItem], parse_obj_as( - type_=typing.List[Task], # type: ignore + type_=typing.List[AgentGetRunsResponseItem], # type: ignore object_=_response.json(), ), ) @@ -1006,14 +710,122 @@ class AgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_entity_artifacts( - self, - entity_type: EntityType, - entity_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + def get_run(self, run_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> TaskRunResponse: + """ + Parameters + ---------- + run_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + TaskRunResponse + Successful Response + + Examples + -------- + from skyvern import Skyvern + + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.agent.get_run( + run_id="run_id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"api/v1/runs/{jsonable_encoder(run_id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + TaskRunResponse, + parse_obj_as( + type_=TaskRunResponse, # 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 get_steps(self, task_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Step]: + """ + Get all steps for a task. + :param task_id: + :return: List of steps for a task with pagination. + + Parameters + ---------- + task_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[Step] + Successful Response + + Examples + -------- + from skyvern import Skyvern + + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.agent.get_steps( + task_id="task_id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"api/v1/tasks/{jsonable_encoder(task_id)}/steps", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[Step], + parse_obj_as( + type_=typing.List[Step], # 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 get_artifacts( + self, entity_type: EntityType, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.List[Artifact]: """ Get all artifacts for an entity (step, task, workflow_run). @@ -1035,10 +847,6 @@ class AgentClient: entity_id : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1049,10 +857,13 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() - client.agent.get_entity_artifacts( + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.agent.get_artifacts( entity_type="step", entity_id="entity_id", ) @@ -1060,10 +871,6 @@ class AgentClient: _response = self._client_wrapper.httpx_client.request( f"api/v1/{jsonable_encoder(entity_type)}/{jsonable_encoder(entity_id)}/artifacts", method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -1090,14 +897,8 @@ class AgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_task_step_artifacts( - self, - task_id: str, - step_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + def get_step_artifacts( + self, task_id: str, step_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.List[Artifact]: """ Get all artifacts for a list of steps. @@ -1111,10 +912,6 @@ class AgentClient: step_id : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1125,10 +922,13 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() - client.agent.get_task_step_artifacts( + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.agent.get_step_artifacts( task_id="task_id", step_id="step_id", ) @@ -1136,10 +936,6 @@ class AgentClient: _response = self._client_wrapper.httpx_client.request( f"api/v1/tasks/{jsonable_encoder(task_id)}/steps/{jsonable_encoder(step_id)}/artifacts", method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -1166,23 +962,14 @@ class AgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_task_actions( - self, - task_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + def get_actions( + self, task_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.List[Action]: """ Parameters ---------- task_id : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1193,20 +980,19 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() - client.agent.get_task_actions( + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.agent.get_actions( task_id="task_id", ) """ _response = self._client_wrapper.httpx_client.request( f"api/v1/tasks/{jsonable_encoder(task_id)}/actions", method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -1233,15 +1019,13 @@ class AgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def execute_workflow( + def run_workflow( self, workflow_id: str, *, version: typing.Optional[int] = None, template: typing.Optional[bool] = None, - api_key: typing.Optional[str] = None, max_steps_override: typing.Optional[int] = None, - authorization: typing.Optional[str] = None, data: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, proxy_location: typing.Optional[ProxyLocation] = OMIT, webhook_callback_url: typing.Optional[str] = OMIT, @@ -1259,12 +1043,8 @@ class AgentClient: template : typing.Optional[bool] - api_key : typing.Optional[str] - max_steps_override : typing.Optional[int] - authorization : typing.Optional[str] - data : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] proxy_location : typing.Optional[ProxyLocation] @@ -1287,10 +1067,13 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() - client.agent.execute_workflow( + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.agent.run_workflow( workflow_id="workflow_id", ) """ @@ -1311,9 +1094,7 @@ class AgentClient: }, headers={ "content-type": "application/json", - "x-api-key": str(api_key) if api_key is not None else None, "x-max-steps-override": str(max_steps_override) if max_steps_override is not None else None, - "authorization": str(authorization) if authorization is not None else None, }, request_options=request_options, omit=OMIT, @@ -1348,8 +1129,6 @@ class AgentClient: page: typing.Optional[int] = None, page_size: typing.Optional[int] = None, status: typing.Optional[typing.Union[WorkflowRunStatus, typing.Sequence[WorkflowRunStatus]]] = None, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> typing.List[WorkflowRun]: """ @@ -1361,10 +1140,6 @@ class AgentClient: status : typing.Optional[typing.Union[WorkflowRunStatus, typing.Sequence[WorkflowRunStatus]]] - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1375,9 +1150,12 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) client.agent.get_workflow_runs() """ _response = self._client_wrapper.httpx_client.request( @@ -1388,10 +1166,6 @@ class AgentClient: "page_size": page_size, "status": status, }, - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -1418,21 +1192,19 @@ class AgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_workflow_runs_for_workflow_permanent_id( + def get_workflow_runs_by_id( self, - workflow_permanent_id: str, + workflow_id: str, *, page: typing.Optional[int] = None, page_size: typing.Optional[int] = None, status: typing.Optional[typing.Union[WorkflowRunStatus, typing.Sequence[WorkflowRunStatus]]] = None, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> typing.List[WorkflowRun]: """ Parameters ---------- - workflow_permanent_id : str + workflow_id : str page : typing.Optional[int] @@ -1440,10 +1212,6 @@ class AgentClient: status : typing.Optional[typing.Union[WorkflowRunStatus, typing.Sequence[WorkflowRunStatus]]] - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1454,25 +1222,24 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() - client.agent.get_workflow_runs_for_workflow_permanent_id( - workflow_permanent_id="workflow_permanent_id", + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.agent.get_workflow_runs_by_id( + workflow_id="workflow_id", ) """ _response = self._client_wrapper.httpx_client.request( - f"api/v1/workflows/{jsonable_encoder(workflow_permanent_id)}/runs", + f"api/v1/workflows/{jsonable_encoder(workflow_id)}/runs", method="GET", params={ "page": page, "page_size": page_size, "status": status, }, - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -1499,14 +1266,8 @@ class AgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_workflow_run( - self, - workflow_id: str, - workflow_run_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + def get_workflow_run_with_workflow_id( + self, workflow_id: str, workflow_run_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Dict[str, typing.Optional[typing.Any]]: """ Parameters @@ -1515,10 +1276,6 @@ class AgentClient: workflow_run_id : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1529,10 +1286,13 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() - client.agent.get_workflow_run( + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.agent.get_workflow_run_with_workflow_id( workflow_id="workflow_id", workflow_run_id="workflow_run_id", ) @@ -1540,10 +1300,6 @@ class AgentClient: _response = self._client_wrapper.httpx_client.request( f"api/v1/workflows/{jsonable_encoder(workflow_id)}/runs/{jsonable_encoder(workflow_run_id)}", method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -1577,8 +1333,6 @@ class AgentClient: *, page: typing.Optional[int] = None, page_size: typing.Optional[int] = None, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> typing.List[WorkflowRunTimeline]: """ @@ -1592,10 +1346,6 @@ class AgentClient: page_size : typing.Optional[int] - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1606,9 +1356,12 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) client.agent.get_workflow_run_timeline( workflow_run_id="workflow_run_id", workflow_id="workflow_id", @@ -1621,10 +1374,6 @@ class AgentClient: "page": page, "page_size": page_size, }, - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -1651,23 +1400,14 @@ class AgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_workflow_run_by_run_id( - self, - workflow_run_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + def get_workflow_run( + self, workflow_run_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> WorkflowRunResponse: """ Parameters ---------- workflow_run_id : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1678,20 +1418,19 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() - client.agent.get_workflow_run_by_run_id( + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.agent.get_workflow_run( workflow_run_id="workflow_run_id", ) """ _response = self._client_wrapper.httpx_client.request( f"api/v1/workflows/runs/{jsonable_encoder(workflow_run_id)}", method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -1727,8 +1466,6 @@ class AgentClient: only_workflows: typing.Optional[bool] = None, title: typing.Optional[str] = None, template: typing.Optional[bool] = None, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> typing.List[Workflow]: """ @@ -1748,10 +1485,6 @@ class AgentClient: template : typing.Optional[bool] - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1762,9 +1495,12 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) client.agent.get_workflows() """ _response = self._client_wrapper.httpx_client.request( @@ -1778,10 +1514,6 @@ class AgentClient: "title": title, "template": template, }, - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -1808,20 +1540,10 @@ class AgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def create_workflow( - self, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> Workflow: + def create_workflow(self, *, request_options: typing.Optional[RequestOptions] = None) -> Workflow: """ Parameters ---------- - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1832,18 +1554,17 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) client.agent.create_workflow() """ _response = self._client_wrapper.httpx_client.request( "api/v1/workflows", method="POST", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -1876,8 +1597,6 @@ class AgentClient: *, version: typing.Optional[int] = None, template: typing.Optional[bool] = None, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> Workflow: """ @@ -1889,10 +1608,6 @@ class AgentClient: template : typing.Optional[bool] - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1903,9 +1618,12 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) client.agent.get_workflow( workflow_permanent_id="workflow_permanent_id", ) @@ -1917,10 +1635,6 @@ class AgentClient: "version": version, "template": template, }, - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -1948,22 +1662,13 @@ class AgentClient: raise ApiError(status_code=_response.status_code, body=_response_json) def update_workflow( - self, - workflow_permanent_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + self, workflow_permanent_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> Workflow: """ Parameters ---------- workflow_permanent_id : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1974,9 +1679,12 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) client.agent.update_workflow( workflow_permanent_id="workflow_permanent_id", ) @@ -1984,10 +1692,6 @@ class AgentClient: _response = self._client_wrapper.httpx_client.request( f"api/v1/workflows/{jsonable_encoder(workflow_permanent_id)}", method="PUT", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -2015,22 +1719,13 @@ class AgentClient: raise ApiError(status_code=_response.status_code, body=_response_json) def delete_workflow( - self, - workflow_permanent_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + self, workflow_permanent_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Optional[typing.Any]: """ Parameters ---------- workflow_permanent_id : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -2041,9 +1736,12 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) client.agent.delete_workflow( workflow_permanent_id="workflow_permanent_id", ) @@ -2051,10 +1749,6 @@ class AgentClient: _response = self._client_wrapper.httpx_client.request( f"api/v1/workflows/{jsonable_encoder(workflow_permanent_id)}", method="DELETE", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -2081,40 +1775,12 @@ class AgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def list_workflows( - self, - *, - page: typing.Optional[int] = None, - page_size: typing.Optional[int] = None, - only_saved_tasks: typing.Optional[bool] = None, - only_workflows: typing.Optional[bool] = None, - title: typing.Optional[str] = None, - template: typing.Optional[bool] = None, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + def get_workflow_templates( + self, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.List[Workflow]: """ - Get all workflows with the latest version for the organization. - Parameters ---------- - page : typing.Optional[int] - - page_size : typing.Optional[int] - - only_saved_tasks : typing.Optional[bool] - - only_workflows : typing.Optional[bool] - - title : typing.Optional[str] - - template : typing.Optional[bool] - - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -2125,26 +1791,17 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() - client.agent.list_workflows() + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.agent.get_workflow_templates() """ _response = self._client_wrapper.httpx_client.request( - "api/v1/workflows/", + "api/v1/workflows/templates", method="GET", - params={ - "page": page, - "page_size": page_size, - "only_saved_tasks": only_saved_tasks, - "only_workflows": only_workflows, - "title": title, - "template": template, - }, - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -2156,114 +1813,17 @@ class AgentClient: 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 make_ai_suggestion( - self, - *, - input: str, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - context: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AiSuggestionBase: - """ - Parameters - ---------- - input : str - - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - - context : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AiSuggestionBase - Successful Response - - Examples - -------- - from skyverndocs import Skyvern - - client = Skyvern() - client.agent.make_ai_suggestion( - input="input", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"api/v1/suggest/data_schema/", - method="POST", - json={ - "input": input, - "context": context, - }, - headers={ - "content-type": "application/json", - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - AiSuggestionBase, - parse_obj_as( - type_=AiSuggestionBase, # 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 generate_task( - self, - *, - prompt: str, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> TaskGeneration: + def generate_task(self, *, prompt: str, request_options: typing.Optional[RequestOptions] = None) -> TaskGeneration: """ Parameters ---------- prompt : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -2274,23 +1834,24 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) client.agent.generate_task( prompt="prompt", ) """ _response = self._client_wrapper.httpx_client.request( - "api/v1/generate/task/", + "api/v1/generate/task", method="POST", json={ "prompt": prompt, }, headers={ "content-type": "application/json", - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, }, request_options=request_options, omit=OMIT, @@ -2319,605 +1880,12 @@ class AgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_organizations( - self, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> GetOrganizationsResponse: - """ - Parameters - ---------- - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - GetOrganizationsResponse - Successful Response - - Examples - -------- - from skyverndocs import Skyvern - - client = Skyvern() - client.agent.get_organizations() - """ - _response = self._client_wrapper.httpx_client.request( - "api/v1/organizations", - method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - GetOrganizationsResponse, - parse_obj_as( - type_=GetOrganizationsResponse, # 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 update_organization( - self, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - max_steps_per_run: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> Organization: - """ - Parameters - ---------- - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - - max_steps_per_run : typing.Optional[int] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - Organization - Successful Response - - Examples - -------- - from skyverndocs import Skyvern - - client = Skyvern() - client.agent.update_organization() - """ - _response = self._client_wrapper.httpx_client.request( - "api/v1/organizations", - method="PUT", - json={ - "max_steps_per_run": max_steps_per_run, - }, - headers={ - "content-type": "application/json", - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - Organization, - parse_obj_as( - type_=Organization, # 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 get_org_api_keys( - self, - organization_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> GetOrganizationApiKeysResponse: - """ - Parameters - ---------- - organization_id : str - - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - GetOrganizationApiKeysResponse - Successful Response - - Examples - -------- - from skyverndocs import Skyvern - - client = Skyvern() - client.agent.get_org_api_keys( - organization_id="organization_id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"api/v1/organizations/{jsonable_encoder(organization_id)}/apikeys", - method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - GetOrganizationApiKeysResponse, - parse_obj_as( - type_=GetOrganizationApiKeysResponse, # 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 upload_file( - self, - *, - file: core.File, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.Optional[typing.Any]: - """ - Parameters - ---------- - file : core.File - See core.File for more documentation - - api_key : typing.Optional[str] - - authorization : 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.agent.upload_file() - """ - _response = self._client_wrapper.httpx_client.request( - "api/v1/upload_file", - method="POST", - data={}, - files={ - "file": file, - }, - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - omit=OMIT, - ) - 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 get_browser_session_by_id( - self, - browser_session_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> BrowserSessionResponse: - """ - Parameters - ---------- - browser_session_id : str - - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - BrowserSessionResponse - Successful Response - - Examples - -------- - from skyverndocs import Skyvern - - client = Skyvern() - client.agent.get_browser_session_by_id( - browser_session_id="browser_session_id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"api/v1/browser_sessions/{jsonable_encoder(browser_session_id)}", - method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - BrowserSessionResponse, - parse_obj_as( - type_=BrowserSessionResponse, # 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 get_browser_sessions( - self, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.List[BrowserSessionResponse]: - """ - Get all active browser sessions for the organization - - Parameters - ---------- - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[BrowserSessionResponse] - Successful Response - - Examples - -------- - from skyverndocs import Skyvern - - client = Skyvern() - client.agent.get_browser_sessions() - """ - _response = self._client_wrapper.httpx_client.request( - "api/v1/browser_sessions", - method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[BrowserSessionResponse], - parse_obj_as( - type_=typing.List[BrowserSessionResponse], # 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 create_browser_session( - self, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> BrowserSessionResponse: - """ - Parameters - ---------- - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - BrowserSessionResponse - Successful Response - - Examples - -------- - from skyverndocs import Skyvern - - client = Skyvern() - client.agent.create_browser_session() - """ - _response = self._client_wrapper.httpx_client.request( - "api/v1/browser_sessions", - method="POST", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - BrowserSessionResponse, - parse_obj_as( - type_=BrowserSessionResponse, # 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 close_browser_sessions( - self, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.Optional[typing.Any]: - """ - Parameters - ---------- - api_key : typing.Optional[str] - - authorization : 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.agent.close_browser_sessions() - """ - _response = self._client_wrapper.httpx_client.request( - "api/v1/browser_sessions/close", - method="POST", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization 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 close_browser_session( - self, - session_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.Optional[typing.Any]: - """ - Parameters - ---------- - session_id : str - - api_key : typing.Optional[str] - - authorization : 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.agent.close_browser_session( - session_id="session_id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"api/v1/browser_sessions/{jsonable_encoder(session_id)}/close", - method="POST", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization 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 observer_task_v_2( + def run_task_v2( self, *, user_prompt: str, - max_iterations_override: typing.Optional[int] = None, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, + max_iterations_override: typing.Optional[AgentRunTaskV2RequestXMaxIterationsOverride] = None, + max_steps_override: typing.Optional[AgentRunTaskV2RequestXMaxStepsOverride] = None, url: typing.Optional[str] = OMIT, browser_session_id: typing.Optional[str] = OMIT, webhook_callback_url: typing.Optional[str] = OMIT, @@ -2925,6 +1893,8 @@ class AgentClient: totp_identifier: typing.Optional[str] = OMIT, proxy_location: typing.Optional[ProxyLocation] = OMIT, publish_workflow: typing.Optional[bool] = OMIT, + extracted_information_schema: typing.Optional[TaskV2RequestExtractedInformationSchema] = OMIT, + error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Dict[str, typing.Optional[typing.Any]]: """ @@ -2932,11 +1902,9 @@ class AgentClient: ---------- user_prompt : str - max_iterations_override : typing.Optional[int] + max_iterations_override : typing.Optional[AgentRunTaskV2RequestXMaxIterationsOverride] - api_key : typing.Optional[str] - - authorization : typing.Optional[str] + max_steps_override : typing.Optional[AgentRunTaskV2RequestXMaxStepsOverride] url : typing.Optional[str] @@ -2952,6 +1920,10 @@ class AgentClient: publish_workflow : typing.Optional[bool] + extracted_information_schema : typing.Optional[TaskV2RequestExtractedInformationSchema] + + error_code_mapping : typing.Optional[typing.Dict[str, typing.Optional[str]]] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -2962,10 +1934,13 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() - client.agent.observer_task_v_2( + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.agent.run_task_v2( user_prompt="user_prompt", ) """ @@ -2981,14 +1956,19 @@ class AgentClient: "totp_identifier": totp_identifier, "proxy_location": proxy_location, "publish_workflow": publish_workflow, + "extracted_information_schema": convert_and_respect_annotation_metadata( + object_=extracted_information_schema, + annotation=TaskV2RequestExtractedInformationSchema, + direction="write", + ), + "error_code_mapping": error_code_mapping, }, headers={ "content-type": "application/json", "x-max-iterations-override": str(max_iterations_override) if max_iterations_override is not None else None, - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, + "x-max-steps-override": str(max_steps_override) if max_steps_override is not None else None, }, request_options=request_options, omit=OMIT, @@ -3017,23 +1997,14 @@ class AgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_observer_task_v_2( - self, - task_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + def get_task_v2( + self, task_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Dict[str, typing.Optional[typing.Any]]: """ Parameters ---------- task_id : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -3044,20 +2015,19 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() - client.agent.get_observer_task_v_2( + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.agent.get_task_v2( task_id="task_id", ) """ _response = self._client_wrapper.httpx_client.request( f"api/v2/tasks/{jsonable_encoder(task_id)}", method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -3084,58 +2054,11 @@ class AgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def run_observer_task_v_2( - self, - *, - user_prompt: str, - max_iterations_override: typing.Optional[int] = None, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - url: typing.Optional[str] = OMIT, - browser_session_id: typing.Optional[str] = OMIT, - webhook_callback_url: typing.Optional[str] = OMIT, - totp_verification_url: typing.Optional[str] = OMIT, - totp_identifier: typing.Optional[str] = OMIT, - proxy_location: typing.Optional[ProxyLocation] = OMIT, - publish_workflow: typing.Optional[bool] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - timeout_seconds: int = 600, - ) -> typing.Dict[str, typing.Optional[typing.Any]]: - observer_task = self.observer_task_v_2( - user_prompt=user_prompt, - max_iterations_override=max_iterations_override, - api_key=api_key, - authorization=authorization, - url=url, - browser_session_id=browser_session_id, - webhook_callback_url=webhook_callback_url, - totp_verification_url=totp_verification_url, - totp_identifier=totp_identifier, - proxy_location=proxy_location, - publish_workflow=publish_workflow, - request_options=request_options, - ) - task_id = observer_task.get("task_id") - - start_time = time.time() - while True: - if time.time() - start_time > timeout_seconds: - raise TimeoutError(f"Task timed out after {timeout_seconds} seconds") - - task = self.get_observer_task_v_2( - str(task_id), api_key=api_key, authorization=authorization, request_options=request_options - ) - if str(task.get("status")) in ["timed_out", "failed", "terminated", "completed", "canceled"]: - return task - time.sleep(1) - - def save_totp_code( + def send_totp_code( self, *, totp_identifier: str, content: str, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, task_id: typing.Optional[str] = OMIT, workflow_id: typing.Optional[str] = OMIT, source: typing.Optional[str] = OMIT, @@ -3149,10 +2072,6 @@ class AgentClient: content : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - task_id : typing.Optional[str] workflow_id : typing.Optional[str] @@ -3171,10 +2090,13 @@ class AgentClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() - client.agent.save_totp_code( + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.agent.send_totp_code( totp_identifier="totp_identifier", content="content", ) @@ -3192,8 +2114,6 @@ class AgentClient: }, headers={ "content-type": "application/json", - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, }, request_options=request_options, omit=OMIT, @@ -3222,769 +2142,136 @@ class AgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_eval_workflow_runs( - self, - *, - page: typing.Optional[int] = None, - page_size: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.List[WorkflowRun]: - """ - Parameters - ---------- - page : typing.Optional[int] - - page_size : typing.Optional[int] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[WorkflowRun] - Successful Response - - Examples - -------- - from skyverndocs import Skyvern - - client = Skyvern() - client.agent.get_eval_workflow_runs() - """ - _response = self._client_wrapper.httpx_client.request( - "api/v1/eval/workflows/runs", - method="GET", - params={ - "page": page, - "page_size": page_size, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[WorkflowRun], - parse_obj_as( - type_=typing.List[WorkflowRun], # 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 get_eval_workflow_run( - self, workflow_id: str, workflow_run_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> typing.Dict[str, typing.Optional[typing.Any]]: - """ - Parameters - ---------- - workflow_id : str - - workflow_run_id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.Dict[str, typing.Optional[typing.Any]] - Successful Response - - Examples - -------- - from skyverndocs import Skyvern - - client = Skyvern() - client.agent.get_eval_workflow_run( - workflow_id="workflow_id", - workflow_run_id="workflow_run_id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"api/v1/eval/workflows/{jsonable_encoder(workflow_id)}/runs/{jsonable_encoder(workflow_run_id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.Dict[str, typing.Optional[typing.Any]], - parse_obj_as( - type_=typing.Dict[str, 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 get_eval_workflow_run_timeline( - self, workflow_run_id: str, workflow_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> typing.List[WorkflowRunTimeline]: - """ - Parameters - ---------- - workflow_run_id : str - - workflow_id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[WorkflowRunTimeline] - Successful Response - - Examples - -------- - from skyverndocs import Skyvern - - client = Skyvern() - client.agent.get_eval_workflow_run_timeline( - workflow_run_id="workflow_run_id", - workflow_id="workflow_id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"api/v1/eval/workflows/{jsonable_encoder(workflow_id)}/runs/{jsonable_encoder(workflow_run_id)}/timeline/", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[WorkflowRunTimeline], - parse_obj_as( - type_=typing.List[WorkflowRunTimeline], # 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 list_workflow_run_timeline( - self, workflow_run_id: str, workflow_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> typing.List[WorkflowRunTimeline]: - """ - Parameters - ---------- - workflow_run_id : str - - workflow_id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[WorkflowRunTimeline] - Successful Response - - Examples - -------- - from skyverndocs import Skyvern - - client = Skyvern() - client.agent.list_workflow_run_timeline( - workflow_run_id="workflow_run_id", - workflow_id="workflow_id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"api/v1/eval/workflows/{jsonable_encoder(workflow_id)}/runs/{jsonable_encoder(workflow_run_id)}/timeline", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[WorkflowRunTimeline], - parse_obj_as( - type_=typing.List[WorkflowRunTimeline], # 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 get_eval_workflow_run_by_run_id( - self, workflow_run_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> WorkflowRunResponse: - """ - Parameters - ---------- - workflow_run_id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - WorkflowRunResponse - Successful Response - - Examples - -------- - from skyverndocs import Skyvern - - client = Skyvern() - client.agent.get_eval_workflow_run_by_run_id( - workflow_run_id="workflow_run_id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"api/v1/eval/workflows/runs/{jsonable_encoder(workflow_run_id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - WorkflowRunResponse, - parse_obj_as( - type_=WorkflowRunResponse, # 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 get_eval_workflow( - self, - workflow_permanent_id: str, - *, - version: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> Workflow: - """ - Parameters - ---------- - workflow_permanent_id : str - - version : typing.Optional[int] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - Workflow - Successful Response - - Examples - -------- - from skyverndocs import Skyvern - - client = Skyvern() - client.agent.get_eval_workflow( - workflow_permanent_id="workflow_permanent_id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"api/v1/eval/workflows/{jsonable_encoder(workflow_permanent_id)}/", - method="GET", - params={ - "version": version, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - Workflow, - parse_obj_as( - type_=Workflow, # 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 get_eval_workflow_runs_for_workflow_permanent_id( - self, - workflow_permanent_id: str, - *, - page: typing.Optional[int] = None, - page_size: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.List[WorkflowRun]: - """ - Parameters - ---------- - workflow_permanent_id : str - - page : typing.Optional[int] - - page_size : typing.Optional[int] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[WorkflowRun] - Successful Response - - Examples - -------- - from skyverndocs import Skyvern - - client = Skyvern() - client.agent.get_eval_workflow_runs_for_workflow_permanent_id( - workflow_permanent_id="workflow_permanent_id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"api/v1/eval/workflows/{jsonable_encoder(workflow_permanent_id)}/runs", - method="GET", - params={ - "page": page, - "page_size": page_size, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[WorkflowRun], - parse_obj_as( - type_=typing.List[WorkflowRun], # 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 get_eval_entity_artifacts( - self, entity_type: EntityType, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> typing.List[Artifact]: - """ - Get all artifacts for an entity (step, task, workflow_run). - - Args: - entity_type: Type of entity to fetch artifacts for - entity_id: ID of the entity - current_org: Current organization from auth - - Returns: - List of artifacts for the entity - - Raises: - HTTPException: If entity is not supported - - Parameters - ---------- - entity_type : EntityType - - entity_id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[Artifact] - Successful Response - - Examples - -------- - from skyverndocs import Skyvern - - client = Skyvern() - client.agent.get_eval_entity_artifacts( - entity_type="step", - entity_id="entity_id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"api/v1/eval/{jsonable_encoder(entity_type)}/{jsonable_encoder(entity_id)}/artifacts", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[Artifact], - parse_obj_as( - type_=typing.List[Artifact], # 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 get_eval_task_actions( - self, task_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> typing.List[Action]: - """ - Parameters - ---------- - task_id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[Action] - Successful Response - - Examples - -------- - from skyverndocs import Skyvern - - client = Skyvern() - client.agent.get_eval_task_actions( - task_id="task_id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"api/v1/eval/tasks/{jsonable_encoder(task_id)}/actions", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[Action], - parse_obj_as( - type_=typing.List[Action], # 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 get_eval_task_step_artifacts( - self, task_id: str, step_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> typing.List[Artifact]: - """ - Get all artifacts for a list of steps. - :param task_id: - :param step_id: - :return: List of artifacts for a list of steps. - - Parameters - ---------- - task_id : str - - step_id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[Artifact] - Successful Response - - Examples - -------- - from skyverndocs import Skyvern - - client = Skyvern() - client.agent.get_eval_task_step_artifacts( - task_id="task_id", - step_id="step_id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"api/v1/eval/tasks/{jsonable_encoder(task_id)}/steps/{jsonable_encoder(step_id)}/artifacts", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[Artifact], - parse_obj_as( - type_=typing.List[Artifact], # 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 get_eval_task_steps( - self, task_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> typing.List[Step]: - """ - Get all steps for a task. - :param task_id: - :return: List of steps for a task with pagination. - - Parameters - ---------- - task_id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[Step] - Successful Response - - Examples - -------- - from skyverndocs import Skyvern - - client = Skyvern() - client.agent.get_eval_task_steps( - task_id="task_id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"api/v1/eval/tasks/{jsonable_encoder(task_id)}/steps", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[Step], - parse_obj_as( - type_=typing.List[Step], # 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 get_agent_tasks( - self, - *, - page: typing.Optional[int] = None, - page_size: typing.Optional[int] = None, - task_status: typing.Optional[typing.Union[TaskStatus, typing.Sequence[TaskStatus]]] = None, - workflow_run_id: typing.Optional[str] = None, - only_standalone_tasks: typing.Optional[bool] = None, - application: typing.Optional[str] = None, - sort: typing.Optional[OrderBy] = None, - order: typing.Optional[SortDirection] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.List[Task]: - """ - Get all tasks. - :param page: Starting page, defaults to 1 - :param page_size: Page size, defaults to 10 - :param task_status: Task status filter - :param workflow_run_id: Workflow run id filter - :param only_standalone_tasks: Only standalone tasks, tasks which are part of a workflow run will be filtered out - :param order: Direction to sort by, ascending or descending - :param sort: Column to sort by, created_at or modified_at - :return: List of tasks with pagination without steps populated. Steps can be populated by calling the - get_agent_task endpoint. - - Parameters - ---------- - page : typing.Optional[int] - - page_size : typing.Optional[int] - - task_status : typing.Optional[typing.Union[TaskStatus, typing.Sequence[TaskStatus]]] - - workflow_run_id : typing.Optional[str] - - only_standalone_tasks : typing.Optional[bool] - - application : typing.Optional[str] - - sort : typing.Optional[OrderBy] - - order : typing.Optional[SortDirection] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[Task] - Successful Response - - Examples - -------- - from skyverndocs import Skyvern - - client = Skyvern() - client.agent.get_agent_tasks() - """ - _response = self._client_wrapper.httpx_client.request( - "api/v1/eval/tasks", - method="GET", - params={ - "page": page, - "page_size": page_size, - "task_status": task_status, - "workflow_run_id": workflow_run_id, - "only_standalone_tasks": only_standalone_tasks, - "application": application, - "sort": sort, - "order": order, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[Task], - parse_obj_as( - type_=typing.List[Task], # 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) - class AsyncAgentClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper + async def run_task( + self, + *, + goal: str, + url: typing.Optional[str] = OMIT, + title: typing.Optional[str] = OMIT, + engine: typing.Optional[RunEngine] = OMIT, + proxy_location: typing.Optional[ProxyLocation] = OMIT, + data_extraction_schema: typing.Optional[TaskRunRequestDataExtractionSchema] = OMIT, + error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, + max_steps: typing.Optional[int] = OMIT, + webhook_url: typing.Optional[str] = OMIT, + totp_identifier: typing.Optional[str] = OMIT, + totp_url: typing.Optional[str] = OMIT, + browser_session_id: typing.Optional[str] = OMIT, + publish_workflow: typing.Optional[bool] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> TaskRunResponse: + """ + Parameters + ---------- + goal : str + + url : typing.Optional[str] + + title : typing.Optional[str] + + engine : typing.Optional[RunEngine] + + proxy_location : typing.Optional[ProxyLocation] + + data_extraction_schema : typing.Optional[TaskRunRequestDataExtractionSchema] + + error_code_mapping : typing.Optional[typing.Dict[str, typing.Optional[str]]] + + max_steps : typing.Optional[int] + + webhook_url : typing.Optional[str] + + totp_identifier : typing.Optional[str] + + totp_url : typing.Optional[str] + + browser_session_id : typing.Optional[str] + + publish_workflow : typing.Optional[bool] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + TaskRunResponse + Successful Response + + Examples + -------- + import asyncio + + from skyvern import AsyncSkyvern + + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + + + async def main() -> None: + await client.agent.run_task( + goal="goal", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "v1/tasks", + method="POST", + json={ + "goal": goal, + "url": url, + "title": title, + "engine": engine, + "proxy_location": proxy_location, + "data_extraction_schema": convert_and_respect_annotation_metadata( + object_=data_extraction_schema, annotation=TaskRunRequestDataExtractionSchema, direction="write" + ), + "error_code_mapping": error_code_mapping, + "max_steps": max_steps, + "webhook_url": webhook_url, + "totp_identifier": totp_identifier, + "totp_url": totp_url, + "browser_session_id": browser_session_id, + "publish_workflow": publish_workflow, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + TaskRunResponse, + parse_obj_as( + type_=TaskRunResponse, # 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 get_tasks( self, *, @@ -3996,8 +2283,6 @@ class AsyncAgentClient: application: typing.Optional[str] = None, sort: typing.Optional[OrderBy] = None, order: typing.Optional[SortDirection] = None, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> typing.List[Task]: """ @@ -4030,10 +2315,6 @@ class AsyncAgentClient: order : typing.Optional[SortDirection] - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -4046,9 +2327,12 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: @@ -4070,10 +2354,6 @@ class AsyncAgentClient: "sort": sort, "order": order, }, - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -4100,13 +2380,11 @@ class AsyncAgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def create_task( + async def run_task_v1( self, *, url: str, - api_key: typing.Optional[str] = None, max_steps_override: typing.Optional[int] = None, - authorization: typing.Optional[str] = None, title: typing.Optional[str] = OMIT, webhook_callback_url: typing.Optional[str] = OMIT, totp_verification_url: typing.Optional[str] = OMIT, @@ -4130,12 +2408,8 @@ class AsyncAgentClient: url : str Starting URL for the task. - api_key : typing.Optional[str] - max_steps_override : typing.Optional[int] - authorization : typing.Optional[str] - title : typing.Optional[str] The title of the task. @@ -4190,13 +2464,16 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: - await client.agent.create_task( + await client.agent.run_task_v1( url="https://www.geico.com", ) @@ -4232,9 +2509,7 @@ class AsyncAgentClient: }, headers={ "content-type": "application/json", - "x-api-key": str(api_key) if api_key is not None else None, "x-max-steps-override": str(max_steps_override) if max_steps_override is not None else None, - "authorization": str(authorization) if authorization is not None else None, }, request_options=request_options, omit=OMIT, @@ -4263,318 +2538,14 @@ class AsyncAgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def run_task( - self, - *, - url: str, - api_key: typing.Optional[str] = None, - max_steps_override: typing.Optional[int] = None, - authorization: typing.Optional[str] = None, - title: typing.Optional[str] = OMIT, - webhook_callback_url: typing.Optional[str] = OMIT, - totp_verification_url: typing.Optional[str] = OMIT, - totp_identifier: typing.Optional[str] = OMIT, - navigation_goal: typing.Optional[str] = OMIT, - data_extraction_goal: typing.Optional[str] = OMIT, - navigation_payload: typing.Optional[TaskRequestNavigationPayload] = OMIT, - error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, - proxy_location: typing.Optional[ProxyLocation] = OMIT, - extracted_information_schema: typing.Optional[TaskRequestExtractedInformationSchema] = OMIT, - complete_criterion: typing.Optional[str] = OMIT, - terminate_criterion: typing.Optional[str] = OMIT, - task_type: typing.Optional[TaskType] = OMIT, - application: typing.Optional[str] = OMIT, - browser_session_id: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - timeout_seconds: int = 600, - ) -> TaskResponse: - created_task = await self.create_task( - url=url, - api_key=api_key, - max_steps_override=max_steps_override, - authorization=authorization, - title=title, - webhook_callback_url=webhook_callback_url, - totp_verification_url=totp_verification_url, - totp_identifier=totp_identifier, - navigation_goal=navigation_goal, - data_extraction_goal=data_extraction_goal, - navigation_payload=navigation_payload, - error_code_mapping=error_code_mapping, - proxy_location=proxy_location, - extracted_information_schema=extracted_information_schema, - complete_criterion=complete_criterion, - terminate_criterion=terminate_criterion, - task_type=task_type, - application=application, - browser_session_id=browser_session_id, - request_options=request_options, - ) - - async with asyncio.timeout(timeout_seconds): - while True: - task = await self.get_task( - created_task.task_id, api_key=api_key, authorization=authorization, request_options=request_options - ) - if task.status in ["timed_out", "failed", "terminated", "completed", "canceled"]: - return task - await asyncio.sleep(1) - - async def get_task_steps( - self, - task_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.List[Step]: - """ - Get all steps for a task. - :param task_id: - :return: List of steps for a task with pagination. - - Parameters - ---------- - task_id : str - - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[Step] - Successful Response - - Examples - -------- - import asyncio - - from skyverndocs import AsyncSkyvern - - client = AsyncSkyvern() - - - async def main() -> None: - await client.agent.get_task_steps( - task_id="task_id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"api/v1/tasks/{jsonable_encoder(task_id)}/steps", - method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[Step], - parse_obj_as( - type_=typing.List[Step], # 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 execute_task_steps( - self, - task_id: str, - *, - step_id: typing.Optional[str] = None, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> Step: - """ - Parameters - ---------- - task_id : str - - step_id : typing.Optional[str] - - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - Step - Successful Response - - Examples - -------- - import asyncio - - from skyverndocs import AsyncSkyvern - - client = AsyncSkyvern() - - - async def main() -> None: - await client.agent.execute_task_steps( - task_id="task_id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"api/v1/tasks/{jsonable_encoder(task_id)}/steps", - method="POST", - params={ - "step_id": step_id, - }, - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - Step, - parse_obj_as( - type_=Step, # 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 execute_task_step( - self, - task_id: str, - step_id: typing.Optional[str], - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> Step: - """ - Parameters - ---------- - task_id : str - - step_id : typing.Optional[str] - - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - Step - Successful Response - - Examples - -------- - import asyncio - - from skyverndocs import AsyncSkyvern - - client = AsyncSkyvern() - - - async def main() -> None: - await client.agent.execute_task_step( - task_id="task_id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"api/v1/tasks/{jsonable_encoder(task_id)}/steps/{jsonable_encoder(step_id)}", - method="POST", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - Step, - parse_obj_as( - type_=Step, # 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 get_task( - self, - task_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + async def get_task_v1( + self, task_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> TaskResponse: """ Parameters ---------- task_id : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -4587,13 +2558,16 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: - await client.agent.get_task( + await client.agent.get_task_v1( task_id="task_id", ) @@ -4603,10 +2577,6 @@ class AsyncAgentClient: _response = await self._client_wrapper.httpx_client.request( f"api/v1/tasks/{jsonable_encoder(task_id)}", method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -4634,22 +2604,13 @@ class AsyncAgentClient: raise ApiError(status_code=_response.status_code, body=_response_json) async def cancel_task( - self, - task_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + self, task_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Optional[typing.Any]: """ Parameters ---------- task_id : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -4662,9 +2623,12 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: @@ -4678,10 +2642,6 @@ class AsyncAgentClient: _response = await self._client_wrapper.httpx_client.request( f"api/v1/tasks/{jsonable_encoder(task_id)}/cancel", method="POST", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -4709,22 +2669,13 @@ class AsyncAgentClient: raise ApiError(status_code=_response.status_code, body=_response_json) async def cancel_workflow_run( - self, - workflow_run_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + self, workflow_run_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Optional[typing.Any]: """ Parameters ---------- workflow_run_id : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -4737,9 +2688,12 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: @@ -4753,10 +2707,6 @@ class AsyncAgentClient: _response = await self._client_wrapper.httpx_client.request( f"api/v1/workflows/runs/{jsonable_encoder(workflow_run_id)}/cancel", method="POST", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -4784,22 +2734,13 @@ class AsyncAgentClient: raise ApiError(status_code=_response.status_code, body=_response_json) async def retry_webhook( - self, - task_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + self, task_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> TaskResponse: """ Parameters ---------- task_id : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -4812,9 +2753,12 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: @@ -4828,10 +2772,6 @@ class AsyncAgentClient: _response = await self._client_wrapper.httpx_client.request( f"api/v1/tasks/{jsonable_encoder(task_id)}/retry_webhook", method="POST", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -4858,48 +2798,180 @@ class AsyncAgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get_task_internal( + async def get_runs( self, - task_id: str, *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, + page: typing.Optional[int] = None, + page_size: typing.Optional[int] = None, + status: typing.Optional[typing.Union[WorkflowRunStatus, typing.Sequence[WorkflowRunStatus]]] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> typing.List[Task]: + ) -> typing.List[AgentGetRunsResponseItem]: """ - Get all tasks. - :param page: Starting page, defaults to 1 - :param page_size: - :return: List of tasks with pagination without steps populated. Steps can be populated by calling the - get_agent_task endpoint. - Parameters ---------- - task_id : str + page : typing.Optional[int] - api_key : typing.Optional[str] + page_size : typing.Optional[int] - authorization : typing.Optional[str] + status : typing.Optional[typing.Union[WorkflowRunStatus, typing.Sequence[WorkflowRunStatus]]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - typing.List[Task] + typing.List[AgentGetRunsResponseItem] Successful Response Examples -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: - await client.agent.get_task_internal( + await client.agent.get_runs() + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "api/v1/runs", + method="GET", + params={ + "page": page, + "page_size": page_size, + "status": status, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[AgentGetRunsResponseItem], + parse_obj_as( + type_=typing.List[AgentGetRunsResponseItem], # 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 get_run(self, run_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> TaskRunResponse: + """ + Parameters + ---------- + run_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + TaskRunResponse + Successful Response + + Examples + -------- + import asyncio + + from skyvern import AsyncSkyvern + + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + + + async def main() -> None: + await client.agent.get_run( + run_id="run_id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"api/v1/runs/{jsonable_encoder(run_id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + TaskRunResponse, + parse_obj_as( + type_=TaskRunResponse, # 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 get_steps( + self, task_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> typing.List[Step]: + """ + Get all steps for a task. + :param task_id: + :return: List of steps for a task with pagination. + + Parameters + ---------- + task_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[Step] + Successful Response + + Examples + -------- + import asyncio + + from skyvern import AsyncSkyvern + + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + + + async def main() -> None: + await client.agent.get_steps( task_id="task_id", ) @@ -4907,20 +2979,16 @@ class AsyncAgentClient: asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"api/v1/internal/tasks/{jsonable_encoder(task_id)}", + f"api/v1/tasks/{jsonable_encoder(task_id)}/steps", method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: return typing.cast( - typing.List[Task], + typing.List[Step], parse_obj_as( - type_=typing.List[Task], # type: ignore + type_=typing.List[Step], # type: ignore object_=_response.json(), ), ) @@ -4939,100 +3007,8 @@ class AsyncAgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get_tasks_internal( - self, - *, - page: typing.Optional[int] = None, - page_size: typing.Optional[int] = None, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.List[Task]: - """ - Get all tasks. - :param page: Starting page, defaults to 1 - :param page_size: Page size, defaults to 10 - :return: List of tasks with pagination without steps populated. Steps can be populated by calling the - get_agent_task endpoint. - - Parameters - ---------- - page : typing.Optional[int] - - page_size : typing.Optional[int] - - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[Task] - Successful Response - - Examples - -------- - import asyncio - - from skyverndocs import AsyncSkyvern - - client = AsyncSkyvern() - - - async def main() -> None: - await client.agent.get_tasks_internal() - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - "api/v1/internal/tasks", - method="GET", - params={ - "page": page, - "page_size": page_size, - }, - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[Task], - parse_obj_as( - type_=typing.List[Task], # 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 get_entity_artifacts( - self, - entity_type: EntityType, - entity_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + async def get_artifacts( + self, entity_type: EntityType, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.List[Artifact]: """ Get all artifacts for an entity (step, task, workflow_run). @@ -5054,10 +3030,6 @@ class AsyncAgentClient: entity_id : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -5070,13 +3042,16 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: - await client.agent.get_entity_artifacts( + await client.agent.get_artifacts( entity_type="step", entity_id="entity_id", ) @@ -5087,10 +3062,6 @@ class AsyncAgentClient: _response = await self._client_wrapper.httpx_client.request( f"api/v1/{jsonable_encoder(entity_type)}/{jsonable_encoder(entity_id)}/artifacts", method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -5117,14 +3088,8 @@ class AsyncAgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get_task_step_artifacts( - self, - task_id: str, - step_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + async def get_step_artifacts( + self, task_id: str, step_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.List[Artifact]: """ Get all artifacts for a list of steps. @@ -5138,10 +3103,6 @@ class AsyncAgentClient: step_id : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -5154,13 +3115,16 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: - await client.agent.get_task_step_artifacts( + await client.agent.get_step_artifacts( task_id="task_id", step_id="step_id", ) @@ -5171,10 +3135,6 @@ class AsyncAgentClient: _response = await self._client_wrapper.httpx_client.request( f"api/v1/tasks/{jsonable_encoder(task_id)}/steps/{jsonable_encoder(step_id)}/artifacts", method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -5201,23 +3161,14 @@ class AsyncAgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get_task_actions( - self, - task_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + async def get_actions( + self, task_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.List[Action]: """ Parameters ---------- task_id : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -5230,13 +3181,16 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: - await client.agent.get_task_actions( + await client.agent.get_actions( task_id="task_id", ) @@ -5246,10 +3200,6 @@ class AsyncAgentClient: _response = await self._client_wrapper.httpx_client.request( f"api/v1/tasks/{jsonable_encoder(task_id)}/actions", method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -5276,15 +3226,13 @@ class AsyncAgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def execute_workflow( + async def run_workflow( self, workflow_id: str, *, version: typing.Optional[int] = None, template: typing.Optional[bool] = None, - api_key: typing.Optional[str] = None, max_steps_override: typing.Optional[int] = None, - authorization: typing.Optional[str] = None, data: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, proxy_location: typing.Optional[ProxyLocation] = OMIT, webhook_callback_url: typing.Optional[str] = OMIT, @@ -5302,12 +3250,8 @@ class AsyncAgentClient: template : typing.Optional[bool] - api_key : typing.Optional[str] - max_steps_override : typing.Optional[int] - authorization : typing.Optional[str] - data : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] proxy_location : typing.Optional[ProxyLocation] @@ -5332,13 +3276,16 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: - await client.agent.execute_workflow( + await client.agent.run_workflow( workflow_id="workflow_id", ) @@ -5362,9 +3309,7 @@ class AsyncAgentClient: }, headers={ "content-type": "application/json", - "x-api-key": str(api_key) if api_key is not None else None, "x-max-steps-override": str(max_steps_override) if max_steps_override is not None else None, - "authorization": str(authorization) if authorization is not None else None, }, request_options=request_options, omit=OMIT, @@ -5399,8 +3344,6 @@ class AsyncAgentClient: page: typing.Optional[int] = None, page_size: typing.Optional[int] = None, status: typing.Optional[typing.Union[WorkflowRunStatus, typing.Sequence[WorkflowRunStatus]]] = None, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> typing.List[WorkflowRun]: """ @@ -5412,10 +3355,6 @@ class AsyncAgentClient: status : typing.Optional[typing.Union[WorkflowRunStatus, typing.Sequence[WorkflowRunStatus]]] - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -5428,9 +3367,12 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: @@ -5447,10 +3389,6 @@ class AsyncAgentClient: "page_size": page_size, "status": status, }, - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -5477,21 +3415,19 @@ class AsyncAgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get_workflow_runs_for_workflow_permanent_id( + async def get_workflow_runs_by_id( self, - workflow_permanent_id: str, + workflow_id: str, *, page: typing.Optional[int] = None, page_size: typing.Optional[int] = None, status: typing.Optional[typing.Union[WorkflowRunStatus, typing.Sequence[WorkflowRunStatus]]] = None, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> typing.List[WorkflowRun]: """ Parameters ---------- - workflow_permanent_id : str + workflow_id : str page : typing.Optional[int] @@ -5499,10 +3435,6 @@ class AsyncAgentClient: status : typing.Optional[typing.Union[WorkflowRunStatus, typing.Sequence[WorkflowRunStatus]]] - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -5515,31 +3447,30 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: - await client.agent.get_workflow_runs_for_workflow_permanent_id( - workflow_permanent_id="workflow_permanent_id", + await client.agent.get_workflow_runs_by_id( + workflow_id="workflow_id", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"api/v1/workflows/{jsonable_encoder(workflow_permanent_id)}/runs", + f"api/v1/workflows/{jsonable_encoder(workflow_id)}/runs", method="GET", params={ "page": page, "page_size": page_size, "status": status, }, - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -5566,14 +3497,8 @@ class AsyncAgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get_workflow_run( - self, - workflow_id: str, - workflow_run_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + async def get_workflow_run_with_workflow_id( + self, workflow_id: str, workflow_run_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Dict[str, typing.Optional[typing.Any]]: """ Parameters @@ -5582,10 +3507,6 @@ class AsyncAgentClient: workflow_run_id : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -5598,13 +3519,16 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: - await client.agent.get_workflow_run( + await client.agent.get_workflow_run_with_workflow_id( workflow_id="workflow_id", workflow_run_id="workflow_run_id", ) @@ -5615,10 +3539,6 @@ class AsyncAgentClient: _response = await self._client_wrapper.httpx_client.request( f"api/v1/workflows/{jsonable_encoder(workflow_id)}/runs/{jsonable_encoder(workflow_run_id)}", method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -5652,8 +3572,6 @@ class AsyncAgentClient: *, page: typing.Optional[int] = None, page_size: typing.Optional[int] = None, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> typing.List[WorkflowRunTimeline]: """ @@ -5667,10 +3585,6 @@ class AsyncAgentClient: page_size : typing.Optional[int] - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -5683,9 +3597,12 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: @@ -5704,10 +3621,6 @@ class AsyncAgentClient: "page": page, "page_size": page_size, }, - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -5734,23 +3647,14 @@ class AsyncAgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get_workflow_run_by_run_id( - self, - workflow_run_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + async def get_workflow_run( + self, workflow_run_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> WorkflowRunResponse: """ Parameters ---------- workflow_run_id : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -5763,13 +3667,16 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: - await client.agent.get_workflow_run_by_run_id( + await client.agent.get_workflow_run( workflow_run_id="workflow_run_id", ) @@ -5779,10 +3686,6 @@ class AsyncAgentClient: _response = await self._client_wrapper.httpx_client.request( f"api/v1/workflows/runs/{jsonable_encoder(workflow_run_id)}", method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -5818,8 +3721,6 @@ class AsyncAgentClient: only_workflows: typing.Optional[bool] = None, title: typing.Optional[str] = None, template: typing.Optional[bool] = None, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> typing.List[Workflow]: """ @@ -5839,10 +3740,6 @@ class AsyncAgentClient: template : typing.Optional[bool] - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -5855,9 +3752,12 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: @@ -5877,10 +3777,6 @@ class AsyncAgentClient: "title": title, "template": template, }, - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -5907,20 +3803,10 @@ class AsyncAgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def create_workflow( - self, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> Workflow: + async def create_workflow(self, *, request_options: typing.Optional[RequestOptions] = None) -> Workflow: """ Parameters ---------- - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -5933,9 +3819,12 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: @@ -5947,10 +3836,6 @@ class AsyncAgentClient: _response = await self._client_wrapper.httpx_client.request( "api/v1/workflows", method="POST", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -5983,8 +3868,6 @@ class AsyncAgentClient: *, version: typing.Optional[int] = None, template: typing.Optional[bool] = None, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> Workflow: """ @@ -5996,10 +3879,6 @@ class AsyncAgentClient: template : typing.Optional[bool] - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -6012,9 +3891,12 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: @@ -6032,10 +3914,6 @@ class AsyncAgentClient: "version": version, "template": template, }, - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -6063,22 +3941,13 @@ class AsyncAgentClient: raise ApiError(status_code=_response.status_code, body=_response_json) async def update_workflow( - self, - workflow_permanent_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + self, workflow_permanent_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> Workflow: """ Parameters ---------- workflow_permanent_id : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -6091,9 +3960,12 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: @@ -6107,10 +3979,6 @@ class AsyncAgentClient: _response = await self._client_wrapper.httpx_client.request( f"api/v1/workflows/{jsonable_encoder(workflow_permanent_id)}", method="PUT", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -6138,22 +4006,13 @@ class AsyncAgentClient: raise ApiError(status_code=_response.status_code, body=_response_json) async def delete_workflow( - self, - workflow_permanent_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + self, workflow_permanent_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Optional[typing.Any]: """ Parameters ---------- workflow_permanent_id : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -6166,9 +4025,12 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: @@ -6182,10 +4044,6 @@ class AsyncAgentClient: _response = await self._client_wrapper.httpx_client.request( f"api/v1/workflows/{jsonable_encoder(workflow_permanent_id)}", method="DELETE", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -6212,40 +4070,12 @@ class AsyncAgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def list_workflows( - self, - *, - page: typing.Optional[int] = None, - page_size: typing.Optional[int] = None, - only_saved_tasks: typing.Optional[bool] = None, - only_workflows: typing.Optional[bool] = None, - title: typing.Optional[str] = None, - template: typing.Optional[bool] = None, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + async def get_workflow_templates( + self, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.List[Workflow]: """ - Get all workflows with the latest version for the organization. - Parameters ---------- - page : typing.Optional[int] - - page_size : typing.Optional[int] - - only_saved_tasks : typing.Optional[bool] - - only_workflows : typing.Optional[bool] - - title : typing.Optional[str] - - template : typing.Optional[bool] - - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -6258,32 +4088,23 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: - await client.agent.list_workflows() + await client.agent.get_workflow_templates() asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "api/v1/workflows/", + "api/v1/workflows/templates", method="GET", - params={ - "page": page, - "page_size": page_size, - "only_saved_tasks": only_saved_tasks, - "only_workflows": only_workflows, - "title": title, - "template": template, - }, - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -6295,122 +4116,19 @@ class AsyncAgentClient: 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 make_ai_suggestion( - self, - *, - input: str, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - context: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AiSuggestionBase: - """ - Parameters - ---------- - input : str - - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - - context : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AiSuggestionBase - Successful Response - - Examples - -------- - import asyncio - - from skyverndocs import AsyncSkyvern - - client = AsyncSkyvern() - - - async def main() -> None: - await client.agent.make_ai_suggestion( - input="input", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"api/v1/suggest/data_schema/", - method="POST", - json={ - "input": input, - "context": context, - }, - headers={ - "content-type": "application/json", - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - AiSuggestionBase, - parse_obj_as( - type_=AiSuggestionBase, # 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 generate_task( - self, - *, - prompt: str, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + self, *, prompt: str, request_options: typing.Optional[RequestOptions] = None ) -> TaskGeneration: """ Parameters ---------- prompt : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -6423,9 +4141,12 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: @@ -6437,15 +4158,13 @@ class AsyncAgentClient: asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "api/v1/generate/task/", + "api/v1/generate/task", method="POST", json={ "prompt": prompt, }, headers={ "content-type": "application/json", - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, }, request_options=request_options, omit=OMIT, @@ -6474,677 +4193,12 @@ class AsyncAgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get_organizations( - self, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> GetOrganizationsResponse: - """ - Parameters - ---------- - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - GetOrganizationsResponse - Successful Response - - Examples - -------- - import asyncio - - from skyverndocs import AsyncSkyvern - - client = AsyncSkyvern() - - - async def main() -> None: - await client.agent.get_organizations() - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - "api/v1/organizations", - method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - GetOrganizationsResponse, - parse_obj_as( - type_=GetOrganizationsResponse, # 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 update_organization( - self, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - max_steps_per_run: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> Organization: - """ - Parameters - ---------- - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - - max_steps_per_run : typing.Optional[int] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - Organization - Successful Response - - Examples - -------- - import asyncio - - from skyverndocs import AsyncSkyvern - - client = AsyncSkyvern() - - - async def main() -> None: - await client.agent.update_organization() - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - "api/v1/organizations", - method="PUT", - json={ - "max_steps_per_run": max_steps_per_run, - }, - headers={ - "content-type": "application/json", - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - Organization, - parse_obj_as( - type_=Organization, # 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 get_org_api_keys( - self, - organization_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> GetOrganizationApiKeysResponse: - """ - Parameters - ---------- - organization_id : str - - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - GetOrganizationApiKeysResponse - Successful Response - - Examples - -------- - import asyncio - - from skyverndocs import AsyncSkyvern - - client = AsyncSkyvern() - - - async def main() -> None: - await client.agent.get_org_api_keys( - organization_id="organization_id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"api/v1/organizations/{jsonable_encoder(organization_id)}/apikeys", - method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - GetOrganizationApiKeysResponse, - parse_obj_as( - type_=GetOrganizationApiKeysResponse, # 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 upload_file( - self, - *, - file: core.File, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.Optional[typing.Any]: - """ - Parameters - ---------- - file : core.File - See core.File for more documentation - - api_key : typing.Optional[str] - - authorization : 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.agent.upload_file() - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - "api/v1/upload_file", - method="POST", - data={}, - files={ - "file": file, - }, - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - omit=OMIT, - ) - 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 get_browser_session_by_id( - self, - browser_session_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> BrowserSessionResponse: - """ - Parameters - ---------- - browser_session_id : str - - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - BrowserSessionResponse - Successful Response - - Examples - -------- - import asyncio - - from skyverndocs import AsyncSkyvern - - client = AsyncSkyvern() - - - async def main() -> None: - await client.agent.get_browser_session_by_id( - browser_session_id="browser_session_id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"api/v1/browser_sessions/{jsonable_encoder(browser_session_id)}", - method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - BrowserSessionResponse, - parse_obj_as( - type_=BrowserSessionResponse, # 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 get_browser_sessions( - self, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.List[BrowserSessionResponse]: - """ - Get all active browser sessions for the organization - - Parameters - ---------- - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[BrowserSessionResponse] - Successful Response - - Examples - -------- - import asyncio - - from skyverndocs import AsyncSkyvern - - client = AsyncSkyvern() - - - async def main() -> None: - await client.agent.get_browser_sessions() - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - "api/v1/browser_sessions", - method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[BrowserSessionResponse], - parse_obj_as( - type_=typing.List[BrowserSessionResponse], # 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 create_browser_session( - self, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> BrowserSessionResponse: - """ - Parameters - ---------- - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - BrowserSessionResponse - Successful Response - - Examples - -------- - import asyncio - - from skyverndocs import AsyncSkyvern - - client = AsyncSkyvern() - - - async def main() -> None: - await client.agent.create_browser_session() - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - "api/v1/browser_sessions", - method="POST", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - BrowserSessionResponse, - parse_obj_as( - type_=BrowserSessionResponse, # 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 close_browser_sessions( - self, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.Optional[typing.Any]: - """ - Parameters - ---------- - api_key : typing.Optional[str] - - authorization : 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.agent.close_browser_sessions() - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - "api/v1/browser_sessions/close", - method="POST", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization 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 close_browser_session( - self, - session_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.Optional[typing.Any]: - """ - Parameters - ---------- - session_id : str - - api_key : typing.Optional[str] - - authorization : 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.agent.close_browser_session( - session_id="session_id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"api/v1/browser_sessions/{jsonable_encoder(session_id)}/close", - method="POST", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization 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 observer_task_v_2( + async def run_task_v2( self, *, user_prompt: str, - max_iterations_override: typing.Optional[int] = None, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, + max_iterations_override: typing.Optional[AgentRunTaskV2RequestXMaxIterationsOverride] = None, + max_steps_override: typing.Optional[AgentRunTaskV2RequestXMaxStepsOverride] = None, url: typing.Optional[str] = OMIT, browser_session_id: typing.Optional[str] = OMIT, webhook_callback_url: typing.Optional[str] = OMIT, @@ -7152,6 +4206,8 @@ class AsyncAgentClient: totp_identifier: typing.Optional[str] = OMIT, proxy_location: typing.Optional[ProxyLocation] = OMIT, publish_workflow: typing.Optional[bool] = OMIT, + extracted_information_schema: typing.Optional[TaskV2RequestExtractedInformationSchema] = OMIT, + error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Dict[str, typing.Optional[typing.Any]]: """ @@ -7159,11 +4215,9 @@ class AsyncAgentClient: ---------- user_prompt : str - max_iterations_override : typing.Optional[int] + max_iterations_override : typing.Optional[AgentRunTaskV2RequestXMaxIterationsOverride] - api_key : typing.Optional[str] - - authorization : typing.Optional[str] + max_steps_override : typing.Optional[AgentRunTaskV2RequestXMaxStepsOverride] url : typing.Optional[str] @@ -7179,6 +4233,10 @@ class AsyncAgentClient: publish_workflow : typing.Optional[bool] + extracted_information_schema : typing.Optional[TaskV2RequestExtractedInformationSchema] + + error_code_mapping : typing.Optional[typing.Dict[str, typing.Optional[str]]] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -7191,13 +4249,16 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: - await client.agent.observer_task_v_2( + await client.agent.run_task_v2( user_prompt="user_prompt", ) @@ -7216,14 +4277,19 @@ class AsyncAgentClient: "totp_identifier": totp_identifier, "proxy_location": proxy_location, "publish_workflow": publish_workflow, + "extracted_information_schema": convert_and_respect_annotation_metadata( + object_=extracted_information_schema, + annotation=TaskV2RequestExtractedInformationSchema, + direction="write", + ), + "error_code_mapping": error_code_mapping, }, headers={ "content-type": "application/json", "x-max-iterations-override": str(max_iterations_override) if max_iterations_override is not None else None, - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, + "x-max-steps-override": str(max_steps_override) if max_steps_override is not None else None, }, request_options=request_options, omit=OMIT, @@ -7252,23 +4318,14 @@ class AsyncAgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get_observer_task_v_2( - self, - task_id: str, - *, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, + async def get_task_v2( + self, task_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Dict[str, typing.Optional[typing.Any]]: """ Parameters ---------- task_id : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -7281,13 +4338,16 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: - await client.agent.get_observer_task_v_2( + await client.agent.get_task_v2( task_id="task_id", ) @@ -7297,10 +4357,6 @@ class AsyncAgentClient: _response = await self._client_wrapper.httpx_client.request( f"api/v2/tasks/{jsonable_encoder(task_id)}", method="GET", - headers={ - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, - }, request_options=request_options, ) try: @@ -7327,57 +4383,11 @@ class AsyncAgentClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def run_observer_task_v_2( - self, - *, - user_prompt: str, - max_iterations_override: typing.Optional[int] = None, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, - url: typing.Optional[str] = OMIT, - browser_session_id: typing.Optional[str] = OMIT, - webhook_callback_url: typing.Optional[str] = OMIT, - totp_verification_url: typing.Optional[str] = OMIT, - totp_identifier: typing.Optional[str] = OMIT, - proxy_location: typing.Optional[ProxyLocation] = OMIT, - publish_workflow: typing.Optional[bool] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - timeout_seconds: int = 600, - ) -> typing.Dict[str, typing.Optional[typing.Any]]: - observer_task = await self.observer_task_v_2( - user_prompt=user_prompt, - max_iterations_override=max_iterations_override, - api_key=api_key, - authorization=authorization, - url=url, - browser_session_id=browser_session_id, - webhook_callback_url=webhook_callback_url, - totp_verification_url=totp_verification_url, - totp_identifier=totp_identifier, - proxy_location=proxy_location, - publish_workflow=publish_workflow, - request_options=request_options, - ) - task_id = observer_task.get("task_id") - async with asyncio.timeout(timeout_seconds): - while True: - task = await self.get_observer_task_v_2( - str(task_id), - api_key=api_key, - authorization=authorization, - request_options=request_options, - ) - if str(task.get("status")) in ["timed_out", "failed", "terminated", "completed", "canceled"]: - return task - await asyncio.sleep(1) - - async def save_totp_code( + async def send_totp_code( self, *, totp_identifier: str, content: str, - api_key: typing.Optional[str] = None, - authorization: typing.Optional[str] = None, task_id: typing.Optional[str] = OMIT, workflow_id: typing.Optional[str] = OMIT, source: typing.Optional[str] = OMIT, @@ -7391,10 +4401,6 @@ class AsyncAgentClient: content : str - api_key : typing.Optional[str] - - authorization : typing.Optional[str] - task_id : typing.Optional[str] workflow_id : typing.Optional[str] @@ -7415,13 +4421,16 @@ class AsyncAgentClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: - await client.agent.save_totp_code( + await client.agent.send_totp_code( totp_identifier="totp_identifier", content="content", ) @@ -7442,8 +4451,6 @@ class AsyncAgentClient: }, headers={ "content-type": "application/json", - "x-api-key": str(api_key) if api_key is not None else None, - "authorization": str(authorization) if authorization is not None else None, }, request_options=request_options, omit=OMIT, @@ -7471,857 +4478,3 @@ class AsyncAgentClient: except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - - async def get_eval_workflow_runs( - self, - *, - page: typing.Optional[int] = None, - page_size: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.List[WorkflowRun]: - """ - Parameters - ---------- - page : typing.Optional[int] - - page_size : typing.Optional[int] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[WorkflowRun] - Successful Response - - Examples - -------- - import asyncio - - from skyverndocs import AsyncSkyvern - - client = AsyncSkyvern() - - - async def main() -> None: - await client.agent.get_eval_workflow_runs() - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - "api/v1/eval/workflows/runs", - method="GET", - params={ - "page": page, - "page_size": page_size, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[WorkflowRun], - parse_obj_as( - type_=typing.List[WorkflowRun], # 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 get_eval_workflow_run( - self, workflow_id: str, workflow_run_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> typing.Dict[str, typing.Optional[typing.Any]]: - """ - Parameters - ---------- - workflow_id : str - - workflow_run_id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.Dict[str, typing.Optional[typing.Any]] - Successful Response - - Examples - -------- - import asyncio - - from skyverndocs import AsyncSkyvern - - client = AsyncSkyvern() - - - async def main() -> None: - await client.agent.get_eval_workflow_run( - workflow_id="workflow_id", - workflow_run_id="workflow_run_id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"api/v1/eval/workflows/{jsonable_encoder(workflow_id)}/runs/{jsonable_encoder(workflow_run_id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.Dict[str, typing.Optional[typing.Any]], - parse_obj_as( - type_=typing.Dict[str, 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 get_eval_workflow_run_timeline( - self, workflow_run_id: str, workflow_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> typing.List[WorkflowRunTimeline]: - """ - Parameters - ---------- - workflow_run_id : str - - workflow_id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[WorkflowRunTimeline] - Successful Response - - Examples - -------- - import asyncio - - from skyverndocs import AsyncSkyvern - - client = AsyncSkyvern() - - - async def main() -> None: - await client.agent.get_eval_workflow_run_timeline( - workflow_run_id="workflow_run_id", - workflow_id="workflow_id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"api/v1/eval/workflows/{jsonable_encoder(workflow_id)}/runs/{jsonable_encoder(workflow_run_id)}/timeline/", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[WorkflowRunTimeline], - parse_obj_as( - type_=typing.List[WorkflowRunTimeline], # 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 list_workflow_run_timeline( - self, workflow_run_id: str, workflow_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> typing.List[WorkflowRunTimeline]: - """ - Parameters - ---------- - workflow_run_id : str - - workflow_id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[WorkflowRunTimeline] - Successful Response - - Examples - -------- - import asyncio - - from skyverndocs import AsyncSkyvern - - client = AsyncSkyvern() - - - async def main() -> None: - await client.agent.list_workflow_run_timeline( - workflow_run_id="workflow_run_id", - workflow_id="workflow_id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"api/v1/eval/workflows/{jsonable_encoder(workflow_id)}/runs/{jsonable_encoder(workflow_run_id)}/timeline", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[WorkflowRunTimeline], - parse_obj_as( - type_=typing.List[WorkflowRunTimeline], # 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 get_eval_workflow_run_by_run_id( - self, workflow_run_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> WorkflowRunResponse: - """ - Parameters - ---------- - workflow_run_id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - WorkflowRunResponse - Successful Response - - Examples - -------- - import asyncio - - from skyverndocs import AsyncSkyvern - - client = AsyncSkyvern() - - - async def main() -> None: - await client.agent.get_eval_workflow_run_by_run_id( - workflow_run_id="workflow_run_id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"api/v1/eval/workflows/runs/{jsonable_encoder(workflow_run_id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - WorkflowRunResponse, - parse_obj_as( - type_=WorkflowRunResponse, # 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 get_eval_workflow( - self, - workflow_permanent_id: str, - *, - version: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> Workflow: - """ - Parameters - ---------- - workflow_permanent_id : str - - version : typing.Optional[int] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - Workflow - Successful Response - - Examples - -------- - import asyncio - - from skyverndocs import AsyncSkyvern - - client = AsyncSkyvern() - - - async def main() -> None: - await client.agent.get_eval_workflow( - workflow_permanent_id="workflow_permanent_id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"api/v1/eval/workflows/{jsonable_encoder(workflow_permanent_id)}/", - method="GET", - params={ - "version": version, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - Workflow, - parse_obj_as( - type_=Workflow, # 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 get_eval_workflow_runs_for_workflow_permanent_id( - self, - workflow_permanent_id: str, - *, - page: typing.Optional[int] = None, - page_size: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.List[WorkflowRun]: - """ - Parameters - ---------- - workflow_permanent_id : str - - page : typing.Optional[int] - - page_size : typing.Optional[int] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[WorkflowRun] - Successful Response - - Examples - -------- - import asyncio - - from skyverndocs import AsyncSkyvern - - client = AsyncSkyvern() - - - async def main() -> None: - await client.agent.get_eval_workflow_runs_for_workflow_permanent_id( - workflow_permanent_id="workflow_permanent_id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"api/v1/eval/workflows/{jsonable_encoder(workflow_permanent_id)}/runs", - method="GET", - params={ - "page": page, - "page_size": page_size, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[WorkflowRun], - parse_obj_as( - type_=typing.List[WorkflowRun], # 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 get_eval_entity_artifacts( - self, entity_type: EntityType, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> typing.List[Artifact]: - """ - Get all artifacts for an entity (step, task, workflow_run). - - Args: - entity_type: Type of entity to fetch artifacts for - entity_id: ID of the entity - current_org: Current organization from auth - - Returns: - List of artifacts for the entity - - Raises: - HTTPException: If entity is not supported - - Parameters - ---------- - entity_type : EntityType - - entity_id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[Artifact] - Successful Response - - Examples - -------- - import asyncio - - from skyverndocs import AsyncSkyvern - - client = AsyncSkyvern() - - - async def main() -> None: - await client.agent.get_eval_entity_artifacts( - entity_type="step", - entity_id="entity_id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"api/v1/eval/{jsonable_encoder(entity_type)}/{jsonable_encoder(entity_id)}/artifacts", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[Artifact], - parse_obj_as( - type_=typing.List[Artifact], # 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 get_eval_task_actions( - self, task_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> typing.List[Action]: - """ - Parameters - ---------- - task_id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[Action] - Successful Response - - Examples - -------- - import asyncio - - from skyverndocs import AsyncSkyvern - - client = AsyncSkyvern() - - - async def main() -> None: - await client.agent.get_eval_task_actions( - task_id="task_id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"api/v1/eval/tasks/{jsonable_encoder(task_id)}/actions", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[Action], - parse_obj_as( - type_=typing.List[Action], # 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 get_eval_task_step_artifacts( - self, task_id: str, step_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> typing.List[Artifact]: - """ - Get all artifacts for a list of steps. - :param task_id: - :param step_id: - :return: List of artifacts for a list of steps. - - Parameters - ---------- - task_id : str - - step_id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[Artifact] - Successful Response - - Examples - -------- - import asyncio - - from skyverndocs import AsyncSkyvern - - client = AsyncSkyvern() - - - async def main() -> None: - await client.agent.get_eval_task_step_artifacts( - task_id="task_id", - step_id="step_id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"api/v1/eval/tasks/{jsonable_encoder(task_id)}/steps/{jsonable_encoder(step_id)}/artifacts", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[Artifact], - parse_obj_as( - type_=typing.List[Artifact], # 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 get_eval_task_steps( - self, task_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> typing.List[Step]: - """ - Get all steps for a task. - :param task_id: - :return: List of steps for a task with pagination. - - Parameters - ---------- - task_id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[Step] - Successful Response - - Examples - -------- - import asyncio - - from skyverndocs import AsyncSkyvern - - client = AsyncSkyvern() - - - async def main() -> None: - await client.agent.get_eval_task_steps( - task_id="task_id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"api/v1/eval/tasks/{jsonable_encoder(task_id)}/steps", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[Step], - parse_obj_as( - type_=typing.List[Step], # 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 get_agent_tasks( - self, - *, - page: typing.Optional[int] = None, - page_size: typing.Optional[int] = None, - task_status: typing.Optional[typing.Union[TaskStatus, typing.Sequence[TaskStatus]]] = None, - workflow_run_id: typing.Optional[str] = None, - only_standalone_tasks: typing.Optional[bool] = None, - application: typing.Optional[str] = None, - sort: typing.Optional[OrderBy] = None, - order: typing.Optional[SortDirection] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.List[Task]: - """ - Get all tasks. - :param page: Starting page, defaults to 1 - :param page_size: Page size, defaults to 10 - :param task_status: Task status filter - :param workflow_run_id: Workflow run id filter - :param only_standalone_tasks: Only standalone tasks, tasks which are part of a workflow run will be filtered out - :param order: Direction to sort by, ascending or descending - :param sort: Column to sort by, created_at or modified_at - :return: List of tasks with pagination without steps populated. Steps can be populated by calling the - get_agent_task endpoint. - - Parameters - ---------- - page : typing.Optional[int] - - page_size : typing.Optional[int] - - task_status : typing.Optional[typing.Union[TaskStatus, typing.Sequence[TaskStatus]]] - - workflow_run_id : typing.Optional[str] - - only_standalone_tasks : typing.Optional[bool] - - application : typing.Optional[str] - - sort : typing.Optional[OrderBy] - - order : typing.Optional[SortDirection] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[Task] - Successful Response - - Examples - -------- - import asyncio - - from skyverndocs import AsyncSkyvern - - client = AsyncSkyvern() - - - async def main() -> None: - await client.agent.get_agent_tasks() - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - "api/v1/eval/tasks", - method="GET", - params={ - "page": page, - "page_size": page_size, - "task_status": task_status, - "workflow_run_id": workflow_run_id, - "only_standalone_tasks": only_standalone_tasks, - "application": application, - "sort": sort, - "order": order, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - typing.List[Task], - parse_obj_as( - type_=typing.List[Task], # 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) diff --git a/skyvern/client/agent/types/__init__.py b/skyvern/client/agent/types/__init__.py index 8953704e..1e3045d6 100644 --- a/skyvern/client/agent/types/__init__.py +++ b/skyvern/client/agent/types/__init__.py @@ -1,6 +1,19 @@ # This file was auto-generated by Fern from our API Definition. +from .agent_get_runs_response_item import AgentGetRunsResponseItem +from .agent_run_task_v2request_x_max_iterations_override import AgentRunTaskV2RequestXMaxIterationsOverride +from .agent_run_task_v2request_x_max_steps_override import AgentRunTaskV2RequestXMaxStepsOverride from .task_request_extracted_information_schema import TaskRequestExtractedInformationSchema from .task_request_navigation_payload import TaskRequestNavigationPayload +from .task_run_request_data_extraction_schema import TaskRunRequestDataExtractionSchema +from .task_v2request_extracted_information_schema import TaskV2RequestExtractedInformationSchema -__all__ = ["TaskRequestExtractedInformationSchema", "TaskRequestNavigationPayload"] +__all__ = [ + "AgentGetRunsResponseItem", + "AgentRunTaskV2RequestXMaxIterationsOverride", + "AgentRunTaskV2RequestXMaxStepsOverride", + "TaskRequestExtractedInformationSchema", + "TaskRequestNavigationPayload", + "TaskRunRequestDataExtractionSchema", + "TaskV2RequestExtractedInformationSchema", +] diff --git a/skyvern/client/agent/types/agent_get_runs_response_item.py b/skyvern/client/agent/types/agent_get_runs_response_item.py new file mode 100644 index 00000000..6d4ef9e9 --- /dev/null +++ b/skyvern/client/agent/types/agent_get_runs_response_item.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ...types.workflow_run import WorkflowRun +from ...types.task import Task + +AgentGetRunsResponseItem = typing.Union[WorkflowRun, Task] diff --git a/skyvern/client/agent/types/agent_run_task_v2request_x_max_iterations_override.py b/skyvern/client/agent/types/agent_run_task_v2request_x_max_iterations_override.py new file mode 100644 index 00000000..94cdd41d --- /dev/null +++ b/skyvern/client/agent/types/agent_run_task_v2request_x_max_iterations_override.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AgentRunTaskV2RequestXMaxIterationsOverride = typing.Union[int, str] diff --git a/skyvern/client/agent/types/agent_run_task_v2request_x_max_steps_override.py b/skyvern/client/agent/types/agent_run_task_v2request_x_max_steps_override.py new file mode 100644 index 00000000..756c7a35 --- /dev/null +++ b/skyvern/client/agent/types/agent_run_task_v2request_x_max_steps_override.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AgentRunTaskV2RequestXMaxStepsOverride = typing.Union[int, str] diff --git a/skyvern/client/types/observer_task_output.py b/skyvern/client/agent/types/task_run_request_data_extraction_schema.py similarity index 77% rename from skyvern/client/types/observer_task_output.py rename to skyvern/client/agent/types/task_run_request_data_extraction_schema.py index ea421a73..d315a4c2 100644 --- a/skyvern/client/types/observer_task_output.py +++ b/skyvern/client/agent/types/task_run_request_data_extraction_schema.py @@ -2,6 +2,6 @@ import typing -ObserverTaskOutput = typing.Union[ +TaskRunRequestDataExtractionSchema = typing.Union[ typing.Dict[str, typing.Optional[typing.Any]], typing.List[typing.Optional[typing.Any]], str ] diff --git a/skyvern/client/agent/types/task_v2request_extracted_information_schema.py b/skyvern/client/agent/types/task_v2request_extracted_information_schema.py new file mode 100644 index 00000000..e38fe5cf --- /dev/null +++ b/skyvern/client/agent/types/task_v2request_extracted_information_schema.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +TaskV2RequestExtractedInformationSchema = typing.Union[ + typing.Dict[str, typing.Optional[typing.Any]], typing.List[typing.Optional[typing.Any]], str +] diff --git a/skyvern/client/client.py b/skyvern/client/client.py index 0a0ecc74..193162c0 100644 --- a/skyvern/client/client.py +++ b/skyvern/client/client.py @@ -4,11 +4,13 @@ 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 .server.client import ServerClient +from .session.client import SessionClient from .core.client_wrapper import AsyncClientWrapper -from .server.client import AsyncServerClient from .agent.client import AsyncAgentClient +from .server.client import AsyncServerClient +from .session.client import AsyncSessionClient class Skyvern: @@ -29,6 +31,8 @@ class Skyvern: + api_key : typing.Optional[str] + authorization : typing.Optional[str] 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. @@ -40,9 +44,12 @@ class Skyvern: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) """ def __init__( @@ -50,6 +57,8 @@ class Skyvern: *, base_url: typing.Optional[str] = None, environment: SkyvernEnvironment = SkyvernEnvironment.PRODUCTION, + api_key: typing.Optional[str] = None, + authorization: typing.Optional[str] = None, timeout: typing.Optional[float] = None, follow_redirects: typing.Optional[bool] = True, httpx_client: typing.Optional[httpx.Client] = None, @@ -57,6 +66,8 @@ class Skyvern: _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), + api_key=api_key, + authorization=authorization, httpx_client=httpx_client if httpx_client is not None else httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects) @@ -64,8 +75,9 @@ class Skyvern: 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) + self.server = ServerClient(client_wrapper=self._client_wrapper) + self.session = SessionClient(client_wrapper=self._client_wrapper) class AsyncSkyvern: @@ -86,6 +98,8 @@ class AsyncSkyvern: + api_key : typing.Optional[str] + authorization : typing.Optional[str] 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. @@ -97,9 +111,12 @@ class AsyncSkyvern: Examples -------- - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) """ def __init__( @@ -107,6 +124,8 @@ class AsyncSkyvern: *, base_url: typing.Optional[str] = None, environment: SkyvernEnvironment = SkyvernEnvironment.PRODUCTION, + api_key: typing.Optional[str] = None, + authorization: typing.Optional[str] = None, timeout: typing.Optional[float] = None, follow_redirects: typing.Optional[bool] = True, httpx_client: typing.Optional[httpx.AsyncClient] = None, @@ -114,6 +133,8 @@ class AsyncSkyvern: _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), + api_key=api_key, + authorization=authorization, httpx_client=httpx_client if httpx_client is not None else httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects) @@ -121,8 +142,9 @@ class AsyncSkyvern: 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) + self.server = AsyncServerClient(client_wrapper=self._client_wrapper) + self.session = AsyncSessionClient(client_wrapper=self._client_wrapper) def _get_base_url(*, base_url: typing.Optional[str] = None, environment: SkyvernEnvironment) -> str: diff --git a/skyvern/client/core/client_wrapper.py b/skyvern/client/core/client_wrapper.py index fc187c93..35c53931 100644 --- a/skyvern/client/core/client_wrapper.py +++ b/skyvern/client/core/client_wrapper.py @@ -7,7 +7,16 @@ from .http_client import AsyncHttpClient class BaseClientWrapper: - def __init__(self, *, base_url: str, timeout: typing.Optional[float] = None): + def __init__( + self, + *, + api_key: typing.Optional[str] = None, + authorization: typing.Optional[str] = None, + base_url: str, + timeout: typing.Optional[float] = None, + ): + self._api_key = api_key + self._authorization = authorization self._base_url = base_url self._timeout = timeout @@ -15,8 +24,12 @@ class BaseClientWrapper: headers: typing.Dict[str, str] = { "X-Fern-Language": "Python", "X-Fern-SDK-Name": "skyvern", - "X-Fern-SDK-Version": "0.1.56", + "X-Fern-SDK-Version": "0.1.65", } + if self._api_key is not None: + headers["x-api-key"] = self._api_key + if self._authorization is not None: + headers["authorization"] = self._authorization return headers def get_base_url(self) -> str: @@ -27,8 +40,16 @@ class BaseClientWrapper: 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) + def __init__( + self, + *, + api_key: typing.Optional[str] = None, + authorization: typing.Optional[str] = None, + base_url: str, + timeout: typing.Optional[float] = None, + httpx_client: httpx.Client, + ): + super().__init__(api_key=api_key, authorization=authorization, base_url=base_url, timeout=timeout) self.httpx_client = HttpClient( httpx_client=httpx_client, base_headers=self.get_headers, @@ -38,8 +59,16 @@ class SyncClientWrapper(BaseClientWrapper): 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) + def __init__( + self, + *, + api_key: typing.Optional[str] = None, + authorization: typing.Optional[str] = None, + base_url: str, + timeout: typing.Optional[float] = None, + httpx_client: httpx.AsyncClient, + ): + super().__init__(api_key=api_key, authorization=authorization, base_url=base_url, timeout=timeout) self.httpx_client = AsyncHttpClient( httpx_client=httpx_client, base_headers=self.get_headers, diff --git a/skyvern/client/core/http_client.py b/skyvern/client/core/http_client.py index 1a1a1311..275a54cc 100644 --- a/skyvern/client/core/http_client.py +++ b/skyvern/client/core/http_client.py @@ -85,8 +85,8 @@ def _retry_timeout(response: httpx.Response, retries: int) -> float: def _should_retry(response: httpx.Response) -> bool: - retriable_400s = [429, 408, 409] - return response.status_code >= 500 or response.status_code in retriable_400s + retryable_400s = [429, 408, 409] + return response.status_code >= 500 or response.status_code in retryable_400s def remove_omit_from_dict( @@ -183,7 +183,7 @@ class HttpClient: 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, + retries: int = 2, omit: typing.Optional[typing.Any] = None, ) -> httpx.Response: base_url = self.get_base_url(base_url) @@ -269,7 +269,7 @@ class HttpClient: 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, + retries: int = 2, omit: typing.Optional[typing.Any] = None, ) -> typing.Iterator[httpx.Response]: base_url = self.get_base_url(base_url) @@ -359,7 +359,7 @@ class AsyncHttpClient: 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, + retries: int = 2, omit: typing.Optional[typing.Any] = None, ) -> httpx.Response: base_url = self.get_base_url(base_url) @@ -445,7 +445,7 @@ class AsyncHttpClient: 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, + retries: int = 2, omit: typing.Optional[typing.Any] = None, ) -> typing.AsyncIterator[httpx.Response]: base_url = self.get_base_url(base_url) diff --git a/skyvern/client/core/pydantic_utilities.py b/skyvern/client/core/pydantic_utilities.py index ee8f0e41..ca1f4792 100644 --- a/skyvern/client/core/pydantic_utilities.py +++ b/skyvern/client/core/pydantic_utilities.py @@ -79,7 +79,7 @@ def to_jsonable_with_fallback( 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 + # Allow fields beginning with `model_` to be used in the model protected_namespaces=(), ) # type: ignore # Pydantic v2 @@ -128,7 +128,7 @@ class UniversalBaseModel(pydantic.BaseModel): 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 + # Note: the logic here is multiplexed 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 diff --git a/skyvern/client/environment.py b/skyvern/client/environment.py index bf9fd034..a2001184 100644 --- a/skyvern/client/environment.py +++ b/skyvern/client/environment.py @@ -5,3 +5,5 @@ import enum class SkyvernEnvironment(enum.Enum): PRODUCTION = "https://api.skyvern.com" + STAGING = "https://api-staging.skyvern.com" + DEVELOPMENT = "http://localhost:8000" diff --git a/skyvern/client/server/client.py b/skyvern/client/server/client.py index d44b5e9e..a1a497a9 100644 --- a/skyvern/client/server/client.py +++ b/skyvern/client/server/client.py @@ -1,15 +1,23 @@ # This file was auto-generated by Fern from our API Definition. -from ..core.client_wrapper import SyncClientWrapper import typing +from ..core.client_wrapper import SyncClientWrapper 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 ..types.get_organizations_response import GetOrganizationsResponse +from ..types.organization import Organization +from ..types.get_organization_api_keys_response import GetOrganizationApiKeysResponse +from ..core.jsonable_encoder import jsonable_encoder +from .. import core from ..core.client_wrapper import AsyncClientWrapper +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + class ServerClient: def __init__(self, *, client_wrapper: SyncClientWrapper): @@ -39,9 +47,12 @@ class ServerClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) client.server.webhook() """ _response = self._client_wrapper.httpx_client.request( @@ -77,7 +88,7 @@ class ServerClient: 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]: + def heartbeat(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Optional[typing.Any]: """ Check if the server is running. @@ -93,10 +104,13 @@ class ServerClient: Examples -------- - from skyverndocs import Skyvern + from skyvern import Skyvern - client = Skyvern() - client.server.check_status() + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.server.heartbeat() """ _response = self._client_wrapper.httpx_client.request( "api/v1/heartbeat", @@ -117,6 +131,237 @@ class ServerClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) + def get_organizations(self, *, request_options: typing.Optional[RequestOptions] = None) -> GetOrganizationsResponse: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetOrganizationsResponse + Successful Response + + Examples + -------- + from skyvern import Skyvern + + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.server.get_organizations() + """ + _response = self._client_wrapper.httpx_client.request( + "api/v1/organizations", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + GetOrganizationsResponse, + parse_obj_as( + type_=GetOrganizationsResponse, # 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 update_organization( + self, *, max_steps_per_run: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None + ) -> Organization: + """ + Parameters + ---------- + max_steps_per_run : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Organization + Successful Response + + Examples + -------- + from skyvern import Skyvern + + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.server.update_organization() + """ + _response = self._client_wrapper.httpx_client.request( + "api/v1/organizations", + method="PUT", + json={ + "max_steps_per_run": max_steps_per_run, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Organization, + parse_obj_as( + type_=Organization, # 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 get_api_keys( + self, organization_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> GetOrganizationApiKeysResponse: + """ + Parameters + ---------- + organization_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetOrganizationApiKeysResponse + Successful Response + + Examples + -------- + from skyvern import Skyvern + + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.server.get_api_keys( + organization_id="organization_id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"api/v1/organizations/{jsonable_encoder(organization_id)}/apikeys/", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + GetOrganizationApiKeysResponse, + parse_obj_as( + type_=GetOrganizationApiKeysResponse, # 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 upload_file( + self, *, file: core.File, request_options: typing.Optional[RequestOptions] = None + ) -> typing.Optional[typing.Any]: + """ + Parameters + ---------- + file : core.File + See core.File for more documentation + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.Optional[typing.Any] + Successful Response + + Examples + -------- + from skyvern import Skyvern + + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.server.upload_file() + """ + _response = self._client_wrapper.httpx_client.request( + "api/v1/upload_file", + method="POST", + data={}, + files={ + "file": file, + }, + request_options=request_options, + omit=OMIT, + ) + 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) + class AsyncServerClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): @@ -148,9 +393,12 @@ class AsyncServerClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: @@ -192,7 +440,7 @@ class AsyncServerClient: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def check_status( + async def heartbeat( self, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Optional[typing.Any]: """ @@ -212,13 +460,16 @@ class AsyncServerClient: -------- import asyncio - from skyverndocs import AsyncSkyvern + from skyvern import AsyncSkyvern - client = AsyncSkyvern() + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) async def main() -> None: - await client.server.check_status() + await client.server.heartbeat() asyncio.run(main()) @@ -241,3 +492,268 @@ class AsyncServerClient: except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_organizations( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> GetOrganizationsResponse: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetOrganizationsResponse + Successful Response + + Examples + -------- + import asyncio + + from skyvern import AsyncSkyvern + + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + + + async def main() -> None: + await client.server.get_organizations() + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "api/v1/organizations", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + GetOrganizationsResponse, + parse_obj_as( + type_=GetOrganizationsResponse, # 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 update_organization( + self, *, max_steps_per_run: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None + ) -> Organization: + """ + Parameters + ---------- + max_steps_per_run : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Organization + Successful Response + + Examples + -------- + import asyncio + + from skyvern import AsyncSkyvern + + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + + + async def main() -> None: + await client.server.update_organization() + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "api/v1/organizations", + method="PUT", + json={ + "max_steps_per_run": max_steps_per_run, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Organization, + parse_obj_as( + type_=Organization, # 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 get_api_keys( + self, organization_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> GetOrganizationApiKeysResponse: + """ + Parameters + ---------- + organization_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetOrganizationApiKeysResponse + Successful Response + + Examples + -------- + import asyncio + + from skyvern import AsyncSkyvern + + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + + + async def main() -> None: + await client.server.get_api_keys( + organization_id="organization_id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"api/v1/organizations/{jsonable_encoder(organization_id)}/apikeys/", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + GetOrganizationApiKeysResponse, + parse_obj_as( + type_=GetOrganizationApiKeysResponse, # 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 upload_file( + self, *, file: core.File, request_options: typing.Optional[RequestOptions] = None + ) -> typing.Optional[typing.Any]: + """ + Parameters + ---------- + file : core.File + See core.File for more documentation + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.Optional[typing.Any] + Successful Response + + Examples + -------- + import asyncio + + from skyvern import AsyncSkyvern + + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + + + async def main() -> None: + await client.server.upload_file() + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "api/v1/upload_file", + method="POST", + data={}, + files={ + "file": file, + }, + request_options=request_options, + omit=OMIT, + ) + 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) diff --git a/skyvern/client/session/__init__.py b/skyvern/client/session/__init__.py new file mode 100644 index 00000000..f3ea2659 --- /dev/null +++ b/skyvern/client/session/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/skyvern/client/session/client.py b/skyvern/client/session/client.py new file mode 100644 index 00000000..b283151c --- /dev/null +++ b/skyvern/client/session/client.py @@ -0,0 +1,499 @@ +# 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 ..types.browser_session_response import BrowserSessionResponse +from ..core.jsonable_encoder import jsonable_encoder +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 SessionClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get_browser_session( + self, browser_session_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> BrowserSessionResponse: + """ + Parameters + ---------- + browser_session_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + BrowserSessionResponse + Successful Response + + Examples + -------- + from skyvern import Skyvern + + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.session.get_browser_session( + browser_session_id="browser_session_id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"api/v1/browser_sessions/{jsonable_encoder(browser_session_id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + BrowserSessionResponse, + parse_obj_as( + type_=BrowserSessionResponse, # 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 get_browser_sessions( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> typing.List[BrowserSessionResponse]: + """ + Get all active browser sessions for the organization + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[BrowserSessionResponse] + Successful Response + + Examples + -------- + from skyvern import Skyvern + + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.session.get_browser_sessions() + """ + _response = self._client_wrapper.httpx_client.request( + "api/v1/browser_sessions", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[BrowserSessionResponse], + parse_obj_as( + type_=typing.List[BrowserSessionResponse], # 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 create_browser_session( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> BrowserSessionResponse: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + BrowserSessionResponse + Successful Response + + Examples + -------- + from skyvern import Skyvern + + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.session.create_browser_session() + """ + _response = self._client_wrapper.httpx_client.request( + "api/v1/browser_sessions", + method="POST", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + BrowserSessionResponse, + parse_obj_as( + type_=BrowserSessionResponse, # 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 close_browser_session( + self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> typing.Optional[typing.Any]: + """ + Parameters + ---------- + session_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.Optional[typing.Any] + Successful Response + + Examples + -------- + from skyvern import Skyvern + + client = Skyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + client.session.close_browser_session( + session_id="session_id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"api/v1/browser_sessions/{jsonable_encoder(session_id)}/close", + method="POST", + 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) + + +class AsyncSessionClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get_browser_session( + self, browser_session_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> BrowserSessionResponse: + """ + Parameters + ---------- + browser_session_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + BrowserSessionResponse + Successful Response + + Examples + -------- + import asyncio + + from skyvern import AsyncSkyvern + + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + + + async def main() -> None: + await client.session.get_browser_session( + browser_session_id="browser_session_id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"api/v1/browser_sessions/{jsonable_encoder(browser_session_id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + BrowserSessionResponse, + parse_obj_as( + type_=BrowserSessionResponse, # 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 get_browser_sessions( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> typing.List[BrowserSessionResponse]: + """ + Get all active browser sessions for the organization + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[BrowserSessionResponse] + Successful Response + + Examples + -------- + import asyncio + + from skyvern import AsyncSkyvern + + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + + + async def main() -> None: + await client.session.get_browser_sessions() + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "api/v1/browser_sessions", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[BrowserSessionResponse], + parse_obj_as( + type_=typing.List[BrowserSessionResponse], # 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 create_browser_session( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> BrowserSessionResponse: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + BrowserSessionResponse + Successful Response + + Examples + -------- + import asyncio + + from skyvern import AsyncSkyvern + + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + + + async def main() -> None: + await client.session.create_browser_session() + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "api/v1/browser_sessions", + method="POST", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + BrowserSessionResponse, + parse_obj_as( + type_=BrowserSessionResponse, # 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 close_browser_session( + self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> typing.Optional[typing.Any]: + """ + Parameters + ---------- + session_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.Optional[typing.Any] + Successful Response + + Examples + -------- + import asyncio + + from skyvern import AsyncSkyvern + + client = AsyncSkyvern( + api_key="YOUR_API_KEY", + authorization="YOUR_AUTHORIZATION", + ) + + + async def main() -> None: + await client.session.close_browser_session( + session_id="session_id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"api/v1/browser_sessions/{jsonable_encoder(session_id)}/close", + method="POST", + 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) diff --git a/skyvern/client/types/__init__.py b/skyvern/client/types/__init__.py index d7bce910..82d43911 100644 --- a/skyvern/client/types/__init__.py +++ b/skyvern/client/types/__init__.py @@ -10,17 +10,14 @@ from .action_block_parameters_item import ( ActionBlockParametersItem_BitwardenLoginCredential, ActionBlockParametersItem_BitwardenSensitiveInformation, ActionBlockParametersItem_Context, + ActionBlockParametersItem_Credential, 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 @@ -37,23 +34,20 @@ from .code_block_parameters_item import ( CodeBlockParametersItem_BitwardenLoginCredential, CodeBlockParametersItem_BitwardenSensitiveInformation, CodeBlockParametersItem_Context, + CodeBlockParametersItem_Credential, 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_credential_request import CreateCredentialRequest from .create_task_response import CreateTaskResponse -from .download_to_s_3_block import DownloadToS3Block +from .credential import Credential +from .credential_parameter import CredentialParameter +from .credential_response import CredentialResponse +from .credential_type import CredentialType +from .credit_card_credential_response import CreditCardCredentialResponse +from .data import Data +from .download_to_s3block import DownloadToS3Block from .entity_type import EntityType from .extraction_block import ExtractionBlock from .extraction_block_data_schema import ExtractionBlockDataSchema @@ -64,6 +58,7 @@ from .extraction_block_parameters_item import ( ExtractionBlockParametersItem_BitwardenLoginCredential, ExtractionBlockParametersItem_BitwardenSensitiveInformation, ExtractionBlockParametersItem_Context, + ExtractionBlockParametersItem_Credential, ExtractionBlockParametersItem_Output, ExtractionBlockParametersItem_Workflow, ) @@ -76,11 +71,15 @@ from .file_download_block_parameters_item import ( FileDownloadBlockParametersItem_BitwardenLoginCredential, FileDownloadBlockParametersItem_BitwardenSensitiveInformation, FileDownloadBlockParametersItem_Context, + FileDownloadBlockParametersItem_Credential, FileDownloadBlockParametersItem_Output, FileDownloadBlockParametersItem_Workflow, ) +from .file_info import FileInfo from .file_parser_block import FileParserBlock +from .file_storage_type import FileStorageType from .file_type import FileType +from .file_upload_block import FileUploadBlock from .for_loop_block import ForLoopBlock from .for_loop_block_loop_blocks_item import ( ForLoopBlockLoopBlocksItem, @@ -89,6 +88,7 @@ from .for_loop_block_loop_blocks_item import ( ForLoopBlockLoopBlocksItem_DownloadToS3, ForLoopBlockLoopBlocksItem_Extraction, ForLoopBlockLoopBlocksItem_FileDownload, + ForLoopBlockLoopBlocksItem_FileUpload, ForLoopBlockLoopBlocksItem_FileUrlParser, ForLoopBlockLoopBlocksItem_ForLoop, ForLoopBlockLoopBlocksItem_GotoUrl, @@ -110,6 +110,7 @@ from .for_loop_block_loop_over import ( ForLoopBlockLoopOver_BitwardenLoginCredential, ForLoopBlockLoopOver_BitwardenSensitiveInformation, ForLoopBlockLoopOver_Context, + ForLoopBlockLoopOver_Credential, ForLoopBlockLoopOver_Output, ForLoopBlockLoopOver_Workflow, ) @@ -125,6 +126,7 @@ from .login_block_parameters_item import ( LoginBlockParametersItem_BitwardenLoginCredential, LoginBlockParametersItem_BitwardenSensitiveInformation, LoginBlockParametersItem_Context, + LoginBlockParametersItem_Credential, LoginBlockParametersItem_Output, LoginBlockParametersItem_Workflow, ) @@ -137,26 +139,37 @@ from .navigation_block_parameters_item import ( NavigationBlockParametersItem_BitwardenLoginCredential, NavigationBlockParametersItem_BitwardenSensitiveInformation, NavigationBlockParametersItem_Context, + NavigationBlockParametersItem_Credential, 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 .non_empty_credit_card_credential import NonEmptyCreditCardCredential +from .non_empty_password_credential import NonEmptyPasswordCredential from .order_by import OrderBy from .organization import Organization from .organization_auth_token import OrganizationAuthToken from .organization_auth_token_type import OrganizationAuthTokenType +from .output import Output from .output_parameter import OutputParameter +from .password_credential_response import PasswordCredentialResponse from .pdf_parser_block import PdfParserBlock from .proxy_location import ProxyLocation +from .run_engine import RunEngine from .run_workflow_response import RunWorkflowResponse from .select_option import SelectOption from .send_email_block import SendEmailBlock from .sort_direction import SortDirection +from .source import ( + Source, + Source_AwsSecret, + Source_BitwardenCreditCardData, + Source_BitwardenLoginCredential, + Source_BitwardenSensitiveInformation, + Source_Context, + Source_Credential, + Source_Output, + Source_Workflow, +) from .step import Step from .step_status import StepStatus from .task import Task @@ -172,6 +185,7 @@ from .task_block_parameters_item import ( TaskBlockParametersItem_BitwardenLoginCredential, TaskBlockParametersItem_BitwardenSensitiveInformation, TaskBlockParametersItem_Context, + TaskBlockParametersItem_Credential, TaskBlockParametersItem_Output, TaskBlockParametersItem_Workflow, ) @@ -181,9 +195,15 @@ 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_run_response import TaskRunResponse +from .task_run_response_data_extraction_schema import TaskRunResponseDataExtractionSchema +from .task_run_status import TaskRunStatus from .task_status import TaskStatus from .task_type import TaskType -from .task_v_2_block import TaskV2Block +from .task_v2 import TaskV2 +from .task_v2block import TaskV2Block +from .task_v2extracted_information_schema import TaskV2ExtractedInformationSchema +from .task_v2status import TaskV2Status from .text_prompt_block import TextPromptBlock from .text_prompt_block_parameters_item import ( TextPromptBlockParametersItem, @@ -192,11 +212,15 @@ from .text_prompt_block_parameters_item import ( TextPromptBlockParametersItem_BitwardenLoginCredential, TextPromptBlockParametersItem_BitwardenSensitiveInformation, TextPromptBlockParametersItem_Context, + TextPromptBlockParametersItem_Credential, TextPromptBlockParametersItem_Output, TextPromptBlockParametersItem_Workflow, ) +from .thought import Thought +from .thought_scenario import ThoughtScenario +from .thought_type import ThoughtType from .totp_code import TotpCode -from .upload_to_s_3_block import UploadToS3Block +from .upload_to_s3block import UploadToS3Block from .url_block import UrlBlock from .url_block_data_schema import UrlBlockDataSchema from .url_block_parameters_item import ( @@ -206,6 +230,7 @@ from .url_block_parameters_item import ( UrlBlockParametersItem_BitwardenLoginCredential, UrlBlockParametersItem_BitwardenSensitiveInformation, UrlBlockParametersItem_Context, + UrlBlockParametersItem_Credential, UrlBlockParametersItem_Output, UrlBlockParametersItem_Workflow, ) @@ -219,11 +244,13 @@ from .validation_block_parameters_item import ( ValidationBlockParametersItem_BitwardenLoginCredential, ValidationBlockParametersItem_BitwardenSensitiveInformation, ValidationBlockParametersItem_Context, + ValidationBlockParametersItem_Credential, ValidationBlockParametersItem_Output, ValidationBlockParametersItem_Workflow, ) from .validation_error import ValidationError from .validation_error_loc_item import ValidationErrorLocItem +from .value import Value from .wait_block import WaitBlock from .wait_block_parameters_item import ( WaitBlockParametersItem, @@ -232,6 +259,7 @@ from .wait_block_parameters_item import ( WaitBlockParametersItem_BitwardenLoginCredential, WaitBlockParametersItem_BitwardenSensitiveInformation, WaitBlockParametersItem_Context, + WaitBlockParametersItem_Credential, WaitBlockParametersItem_Output, WaitBlockParametersItem_Workflow, ) @@ -244,6 +272,7 @@ from .workflow_definition_blocks_item import ( WorkflowDefinitionBlocksItem_DownloadToS3, WorkflowDefinitionBlocksItem_Extraction, WorkflowDefinitionBlocksItem_FileDownload, + WorkflowDefinitionBlocksItem_FileUpload, WorkflowDefinitionBlocksItem_FileUrlParser, WorkflowDefinitionBlocksItem_ForLoop, WorkflowDefinitionBlocksItem_GotoUrl, @@ -265,6 +294,7 @@ from .workflow_definition_parameters_item import ( WorkflowDefinitionParametersItem_BitwardenLoginCredential, WorkflowDefinitionParametersItem_BitwardenSensitiveInformation, WorkflowDefinitionParametersItem_Context, + WorkflowDefinitionParametersItem_Credential, WorkflowDefinitionParametersItem_Output, WorkflowDefinitionParametersItem_Workflow, ) @@ -275,9 +305,8 @@ 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_response import WorkflowRunResponse from .workflow_run_status import WorkflowRunStatus -from .workflow_run_status_response import WorkflowRunResponse from .workflow_run_timeline import WorkflowRunTimeline from .workflow_run_timeline_type import WorkflowRunTimelineType from .workflow_status import WorkflowStatus @@ -292,16 +321,13 @@ __all__ = [ "ActionBlockParametersItem_BitwardenLoginCredential", "ActionBlockParametersItem_BitwardenSensitiveInformation", "ActionBlockParametersItem_Context", + "ActionBlockParametersItem_Credential", "ActionBlockParametersItem_Output", "ActionBlockParametersItem_Workflow", "ActionResult", - "ActionResultData", "ActionStatus", "ActionType", "AgentStepOutput", - "AiSuggestionBase", - "AiSuggestionBaseOutput", - "AiSuggestionType", "Artifact", "ArtifactType", "AwsSecretParameter", @@ -317,19 +343,18 @@ __all__ = [ "CodeBlockParametersItem_BitwardenLoginCredential", "CodeBlockParametersItem_BitwardenSensitiveInformation", "CodeBlockParametersItem_Context", + "CodeBlockParametersItem_Credential", "CodeBlockParametersItem_Output", "CodeBlockParametersItem_Workflow", "ContextParameter", - "ContextParameterSource", - "ContextParameterSource_AwsSecret", - "ContextParameterSource_BitwardenCreditCardData", - "ContextParameterSource_BitwardenLoginCredential", - "ContextParameterSource_BitwardenSensitiveInformation", - "ContextParameterSource_Context", - "ContextParameterSource_Output", - "ContextParameterSource_Workflow", - "ContextParameterValue", + "CreateCredentialRequest", "CreateTaskResponse", + "Credential", + "CredentialParameter", + "CredentialResponse", + "CredentialType", + "CreditCardCredentialResponse", + "Data", "DownloadToS3Block", "EntityType", "ExtractionBlock", @@ -340,6 +365,7 @@ __all__ = [ "ExtractionBlockParametersItem_BitwardenLoginCredential", "ExtractionBlockParametersItem_BitwardenSensitiveInformation", "ExtractionBlockParametersItem_Context", + "ExtractionBlockParametersItem_Credential", "ExtractionBlockParametersItem_Output", "ExtractionBlockParametersItem_Workflow", "FileDownloadBlock", @@ -350,10 +376,14 @@ __all__ = [ "FileDownloadBlockParametersItem_BitwardenLoginCredential", "FileDownloadBlockParametersItem_BitwardenSensitiveInformation", "FileDownloadBlockParametersItem_Context", + "FileDownloadBlockParametersItem_Credential", "FileDownloadBlockParametersItem_Output", "FileDownloadBlockParametersItem_Workflow", + "FileInfo", "FileParserBlock", + "FileStorageType", "FileType", + "FileUploadBlock", "ForLoopBlock", "ForLoopBlockLoopBlocksItem", "ForLoopBlockLoopBlocksItem_Action", @@ -361,6 +391,7 @@ __all__ = [ "ForLoopBlockLoopBlocksItem_DownloadToS3", "ForLoopBlockLoopBlocksItem_Extraction", "ForLoopBlockLoopBlocksItem_FileDownload", + "ForLoopBlockLoopBlocksItem_FileUpload", "ForLoopBlockLoopBlocksItem_FileUrlParser", "ForLoopBlockLoopBlocksItem_ForLoop", "ForLoopBlockLoopBlocksItem_GotoUrl", @@ -380,6 +411,7 @@ __all__ = [ "ForLoopBlockLoopOver_BitwardenLoginCredential", "ForLoopBlockLoopOver_BitwardenSensitiveInformation", "ForLoopBlockLoopOver_Context", + "ForLoopBlockLoopOver_Credential", "ForLoopBlockLoopOver_Output", "ForLoopBlockLoopOver_Workflow", "GetOrganizationApiKeysResponse", @@ -393,6 +425,7 @@ __all__ = [ "LoginBlockParametersItem_BitwardenLoginCredential", "LoginBlockParametersItem_BitwardenSensitiveInformation", "LoginBlockParametersItem_Context", + "LoginBlockParametersItem_Credential", "LoginBlockParametersItem_Output", "LoginBlockParametersItem_Workflow", "NavigationBlock", @@ -403,25 +436,34 @@ __all__ = [ "NavigationBlockParametersItem_BitwardenLoginCredential", "NavigationBlockParametersItem_BitwardenSensitiveInformation", "NavigationBlockParametersItem_Context", + "NavigationBlockParametersItem_Credential", "NavigationBlockParametersItem_Output", "NavigationBlockParametersItem_Workflow", - "ObserverTask", - "ObserverTaskOutput", - "ObserverTaskStatus", - "ObserverThought", - "ObserverThoughtScenario", - "ObserverThoughtType", + "NonEmptyCreditCardCredential", + "NonEmptyPasswordCredential", "OrderBy", "Organization", "OrganizationAuthToken", "OrganizationAuthTokenType", + "Output", "OutputParameter", + "PasswordCredentialResponse", "PdfParserBlock", "ProxyLocation", + "RunEngine", "RunWorkflowResponse", "SelectOption", "SendEmailBlock", "SortDirection", + "Source", + "Source_AwsSecret", + "Source_BitwardenCreditCardData", + "Source_BitwardenLoginCredential", + "Source_BitwardenSensitiveInformation", + "Source_Context", + "Source_Credential", + "Source_Output", + "Source_Workflow", "Step", "StepStatus", "Task", @@ -436,6 +478,7 @@ __all__ = [ "TaskBlockParametersItem_BitwardenLoginCredential", "TaskBlockParametersItem_BitwardenSensitiveInformation", "TaskBlockParametersItem_Context", + "TaskBlockParametersItem_Credential", "TaskBlockParametersItem_Output", "TaskBlockParametersItem_Workflow", "TaskExtractedInformation", @@ -444,9 +487,15 @@ __all__ = [ "TaskNavigationPayload", "TaskResponse", "TaskResponseExtractedInformation", + "TaskRunResponse", + "TaskRunResponseDataExtractionSchema", + "TaskRunStatus", "TaskStatus", "TaskType", + "TaskV2", "TaskV2Block", + "TaskV2ExtractedInformationSchema", + "TaskV2Status", "TextPromptBlock", "TextPromptBlockParametersItem", "TextPromptBlockParametersItem_AwsSecret", @@ -454,8 +503,12 @@ __all__ = [ "TextPromptBlockParametersItem_BitwardenLoginCredential", "TextPromptBlockParametersItem_BitwardenSensitiveInformation", "TextPromptBlockParametersItem_Context", + "TextPromptBlockParametersItem_Credential", "TextPromptBlockParametersItem_Output", "TextPromptBlockParametersItem_Workflow", + "Thought", + "ThoughtScenario", + "ThoughtType", "TotpCode", "UploadToS3Block", "UrlBlock", @@ -466,6 +519,7 @@ __all__ = [ "UrlBlockParametersItem_BitwardenLoginCredential", "UrlBlockParametersItem_BitwardenSensitiveInformation", "UrlBlockParametersItem_Context", + "UrlBlockParametersItem_Credential", "UrlBlockParametersItem_Output", "UrlBlockParametersItem_Workflow", "UserDefinedError", @@ -477,10 +531,12 @@ __all__ = [ "ValidationBlockParametersItem_BitwardenLoginCredential", "ValidationBlockParametersItem_BitwardenSensitiveInformation", "ValidationBlockParametersItem_Context", + "ValidationBlockParametersItem_Credential", "ValidationBlockParametersItem_Output", "ValidationBlockParametersItem_Workflow", "ValidationError", "ValidationErrorLocItem", + "Value", "WaitBlock", "WaitBlockParametersItem", "WaitBlockParametersItem_AwsSecret", @@ -488,6 +544,7 @@ __all__ = [ "WaitBlockParametersItem_BitwardenLoginCredential", "WaitBlockParametersItem_BitwardenSensitiveInformation", "WaitBlockParametersItem_Context", + "WaitBlockParametersItem_Credential", "WaitBlockParametersItem_Output", "WaitBlockParametersItem_Workflow", "Workflow", @@ -498,6 +555,7 @@ __all__ = [ "WorkflowDefinitionBlocksItem_DownloadToS3", "WorkflowDefinitionBlocksItem_Extraction", "WorkflowDefinitionBlocksItem_FileDownload", + "WorkflowDefinitionBlocksItem_FileUpload", "WorkflowDefinitionBlocksItem_FileUrlParser", "WorkflowDefinitionBlocksItem_ForLoop", "WorkflowDefinitionBlocksItem_GotoUrl", @@ -517,6 +575,7 @@ __all__ = [ "WorkflowDefinitionParametersItem_BitwardenLoginCredential", "WorkflowDefinitionParametersItem_BitwardenSensitiveInformation", "WorkflowDefinitionParametersItem_Context", + "WorkflowDefinitionParametersItem_Credential", "WorkflowDefinitionParametersItem_Output", "WorkflowDefinitionParametersItem_Workflow", "WorkflowParameter", @@ -526,9 +585,8 @@ __all__ = [ "WorkflowRunBlock", "WorkflowRunBlockDataSchema", "WorkflowRunBlockNavigationPayload", - "WorkflowRunBlockOutput", - "WorkflowRunStatus", "WorkflowRunResponse", + "WorkflowRunStatus", "WorkflowRunTimeline", "WorkflowRunTimelineType", "WorkflowStatus", diff --git a/skyvern/client/types/action.py b/skyvern/client/types/action.py index c381dca6..e1d2247b 100644 --- a/skyvern/client/types/action.py +++ b/skyvern/client/types/action.py @@ -39,6 +39,7 @@ class Action(UniversalBaseModel): text: typing.Optional[str] = None option: typing.Optional[SelectOption] = None is_checked: typing.Optional[bool] = None + verified: typing.Optional[bool] = None created_at: typing.Optional[dt.datetime] = None modified_at: typing.Optional[dt.datetime] = None diff --git a/skyvern/client/types/action_block.py b/skyvern/client/types/action_block.py index 01c6aeb6..65b4277e 100644 --- a/skyvern/client/types/action_block.py +++ b/skyvern/client/types/action_block.py @@ -1,6 +1,5 @@ # 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 @@ -9,7 +8,6 @@ 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): @@ -33,6 +31,7 @@ class ActionBlock(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -42,6 +41,3 @@ class ActionBlock(UniversalBaseModel): frozen = True smart_union = True extra = pydantic.Extra.allow - - -update_forward_refs(ContextParameter, ActionBlock=ActionBlock) diff --git a/skyvern/client/types/action_block_parameters_item.py b/skyvern/client/types/action_block_parameters_item.py index 8e16701c..761b44e1 100644 --- a/skyvern/client/types/action_block_parameters_item.py +++ b/skyvern/client/types/action_block_parameters_item.py @@ -6,7 +6,7 @@ import typing import datetime as dt from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -from .context_parameter_value import ContextParameterValue +from .value import Value from .workflow_parameter_type import WorkflowParameterType from .workflow_parameter_default_value import WorkflowParameterDefaultValue from ..core.pydantic_utilities import update_forward_refs @@ -67,8 +67,9 @@ class ActionBlockParametersItem_BitwardenLoginCredential(UniversalBaseModel): 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 + url_parameter_key: typing.Optional[str] = None bitwarden_collection_id: typing.Optional[str] = None + bitwarden_item_id: typing.Optional[str] = None created_at: dt.datetime modified_at: dt.datetime deleted_at: typing.Optional[dt.datetime] = None @@ -113,8 +114,8 @@ class ActionBlockParametersItem_Context(UniversalBaseModel): parameter_type: typing.Literal["context"] = "context" key: str description: typing.Optional[str] = None - source: "ContextParameterSource" - value: typing.Optional[ContextParameterValue] = None + source: "Source" + value: typing.Optional[Value] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -127,7 +128,28 @@ class ActionBlockParametersItem_Context(UniversalBaseModel): from .context_parameter import ContextParameter # noqa: E402 -from .context_parameter_source import ContextParameterSource # noqa: E402 +from .source import Source # noqa: E402 + + +class ActionBlockParametersItem_Credential(UniversalBaseModel): + parameter_type: typing.Literal["credential"] = "credential" + key: str + description: typing.Optional[str] = None + credential_parameter_id: str + workflow_id: str + credential_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_Output(UniversalBaseModel): @@ -178,8 +200,8 @@ ActionBlockParametersItem = typing.Union[ ActionBlockParametersItem_BitwardenLoginCredential, ActionBlockParametersItem_BitwardenSensitiveInformation, ActionBlockParametersItem_Context, + ActionBlockParametersItem_Credential, ActionBlockParametersItem_Output, ActionBlockParametersItem_Workflow, ] -update_forward_refs(ContextParameter, ActionBlockParametersItem_Context=ActionBlockParametersItem_Context) update_forward_refs(ActionBlockParametersItem_Context) diff --git a/skyvern/client/types/action_result.py b/skyvern/client/types/action_result.py index 2d525595..58284ab5 100644 --- a/skyvern/client/types/action_result.py +++ b/skyvern/client/types/action_result.py @@ -2,7 +2,7 @@ from ..core.pydantic_utilities import UniversalBaseModel import typing -from .action_result_data import ActionResultData +from .data import Data from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic @@ -12,7 +12,7 @@ class ActionResult(UniversalBaseModel): 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 + data: typing.Optional[Data] = None step_retry_number: typing.Optional[int] = None step_order: typing.Optional[int] = None download_triggered: typing.Optional[bool] = None diff --git a/skyvern/client/types/ai_suggestion_base_output.py b/skyvern/client/types/ai_suggestion_base_output.py deleted file mode 100644 index cd6544f0..00000000 --- a/skyvern/client/types/ai_suggestion_base_output.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -AiSuggestionBaseOutput = typing.Union[typing.Dict[str, typing.Optional[typing.Any]], str] diff --git a/skyvern/client/types/bitwarden_login_credential_parameter.py b/skyvern/client/types/bitwarden_login_credential_parameter.py index 62827f66..349cd2f1 100644 --- a/skyvern/client/types/bitwarden_login_credential_parameter.py +++ b/skyvern/client/types/bitwarden_login_credential_parameter.py @@ -15,8 +15,9 @@ class BitwardenLoginCredentialParameter(UniversalBaseModel): 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 + url_parameter_key: typing.Optional[str] = None bitwarden_collection_id: typing.Optional[str] = None + bitwarden_item_id: typing.Optional[str] = None created_at: dt.datetime modified_at: dt.datetime deleted_at: typing.Optional[dt.datetime] = None diff --git a/skyvern/client/types/block_type.py b/skyvern/client/types/block_type.py index 1f9ad809..41778dbf 100644 --- a/skyvern/client/types/block_type.py +++ b/skyvern/client/types/block_type.py @@ -11,6 +11,7 @@ BlockType = typing.Union[ "text_prompt", "download_to_s3", "upload_to_s3", + "file_upload", "send_email", "file_url_parser", "validation", diff --git a/skyvern/client/types/code_block.py b/skyvern/client/types/code_block.py index 85701f15..acf0ae03 100644 --- a/skyvern/client/types/code_block.py +++ b/skyvern/client/types/code_block.py @@ -1,6 +1,5 @@ # 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 @@ -8,7 +7,6 @@ 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): @@ -26,6 +24,3 @@ class CodeBlock(UniversalBaseModel): frozen = True smart_union = True extra = pydantic.Extra.allow - - -update_forward_refs(ContextParameter, CodeBlock=CodeBlock) diff --git a/skyvern/client/types/code_block_parameters_item.py b/skyvern/client/types/code_block_parameters_item.py index 781d7270..54f5fc40 100644 --- a/skyvern/client/types/code_block_parameters_item.py +++ b/skyvern/client/types/code_block_parameters_item.py @@ -6,7 +6,7 @@ import typing import datetime as dt from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -from .context_parameter_value import ContextParameterValue +from .value import Value from .workflow_parameter_type import WorkflowParameterType from .workflow_parameter_default_value import WorkflowParameterDefaultValue from ..core.pydantic_utilities import update_forward_refs @@ -67,8 +67,9 @@ class CodeBlockParametersItem_BitwardenLoginCredential(UniversalBaseModel): 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 + url_parameter_key: typing.Optional[str] = None bitwarden_collection_id: typing.Optional[str] = None + bitwarden_item_id: typing.Optional[str] = None created_at: dt.datetime modified_at: dt.datetime deleted_at: typing.Optional[dt.datetime] = None @@ -113,8 +114,8 @@ class CodeBlockParametersItem_Context(UniversalBaseModel): parameter_type: typing.Literal["context"] = "context" key: str description: typing.Optional[str] = None - source: "ContextParameterSource" - value: typing.Optional[ContextParameterValue] = None + source: "Source" + value: typing.Optional[Value] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -127,7 +128,28 @@ class CodeBlockParametersItem_Context(UniversalBaseModel): from .context_parameter import ContextParameter # noqa: E402 -from .context_parameter_source import ContextParameterSource # noqa: E402 +from .source import Source # noqa: E402 + + +class CodeBlockParametersItem_Credential(UniversalBaseModel): + parameter_type: typing.Literal["credential"] = "credential" + key: str + description: typing.Optional[str] = None + credential_parameter_id: str + workflow_id: str + credential_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_Output(UniversalBaseModel): @@ -178,8 +200,8 @@ CodeBlockParametersItem = typing.Union[ CodeBlockParametersItem_BitwardenLoginCredential, CodeBlockParametersItem_BitwardenSensitiveInformation, CodeBlockParametersItem_Context, + CodeBlockParametersItem_Credential, CodeBlockParametersItem_Output, CodeBlockParametersItem_Workflow, ] -update_forward_refs(ContextParameter, CodeBlockParametersItem_Context=CodeBlockParametersItem_Context) update_forward_refs(CodeBlockParametersItem_Context) diff --git a/skyvern/client/types/context_parameter.py b/skyvern/client/types/context_parameter.py index de2cff89..48fa1aae 100644 --- a/skyvern/client/types/context_parameter.py +++ b/skyvern/client/types/context_parameter.py @@ -3,7 +3,7 @@ from __future__ import annotations from ..core.pydantic_utilities import UniversalBaseModel import typing -from .context_parameter_value import ContextParameterValue +from .value import Value from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic from ..core.pydantic_utilities import update_forward_refs @@ -12,8 +12,8 @@ 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 + source: "Source" + value: typing.Optional[Value] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -25,6 +25,6 @@ class ContextParameter(UniversalBaseModel): extra = pydantic.Extra.allow -from .context_parameter_source import ContextParameterSource # noqa: E402 +from .source import Source # noqa: E402 update_forward_refs(ContextParameter) diff --git a/skyvern/client/types/create_credential_request.py b/skyvern/client/types/create_credential_request.py new file mode 100644 index 00000000..7525848c --- /dev/null +++ b/skyvern/client/types/create_credential_request.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +from .credential_type import CredentialType +from .credential import Credential +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +import pydantic + + +class CreateCredentialRequest(UniversalBaseModel): + name: str + credential_type: CredentialType + credential: Credential + + 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 diff --git a/skyvern/client/types/credential.py b/skyvern/client/types/credential.py new file mode 100644 index 00000000..c2224546 --- /dev/null +++ b/skyvern/client/types/credential.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from .password_credential_response import PasswordCredentialResponse +from .credit_card_credential_response import CreditCardCredentialResponse + +Credential = typing.Union[PasswordCredentialResponse, CreditCardCredentialResponse] diff --git a/skyvern/client/types/credential_parameter.py b/skyvern/client/types/credential_parameter.py new file mode 100644 index 00000000..1fcca362 --- /dev/null +++ b/skyvern/client/types/credential_parameter.py @@ -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 CredentialParameter(UniversalBaseModel): + key: str + description: typing.Optional[str] = None + credential_parameter_id: str + workflow_id: str + credential_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 diff --git a/skyvern/client/types/credential_response.py b/skyvern/client/types/credential_response.py new file mode 100644 index 00000000..5082ec57 --- /dev/null +++ b/skyvern/client/types/credential_response.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +from .credential import Credential +from .credential_type import CredentialType +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +import pydantic + + +class CredentialResponse(UniversalBaseModel): + credential_id: str + credential: Credential + credential_type: CredentialType + name: 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 diff --git a/skyvern/client/types/credential_type.py b/skyvern/client/types/credential_type.py new file mode 100644 index 00000000..ccd719a4 --- /dev/null +++ b/skyvern/client/types/credential_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CredentialType = typing.Union[typing.Literal["password", "credit_card"], typing.Any] diff --git a/skyvern/client/types/ai_suggestion_base.py b/skyvern/client/types/credit_card_credential_response.py similarity index 75% rename from skyvern/client/types/ai_suggestion_base.py rename to skyvern/client/types/credit_card_credential_response.py index 39c6d5a2..b3a5064e 100644 --- a/skyvern/client/types/ai_suggestion_base.py +++ b/skyvern/client/types/credit_card_credential_response.py @@ -1,14 +1,14 @@ # 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 typing import pydantic -class AiSuggestionBase(UniversalBaseModel): - output: typing.Optional[AiSuggestionBaseOutput] = None +class CreditCardCredentialResponse(UniversalBaseModel): + last_four: str + brand: str if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/skyvern/client/types/data.py b/skyvern/client/types/data.py new file mode 100644 index 00000000..02a0a860 --- /dev/null +++ b/skyvern/client/types/data.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +Data = typing.Union[typing.Dict[str, typing.Optional[typing.Any]], typing.List[typing.Optional[typing.Any]], str] diff --git a/skyvern/client/types/download_to_s_3_block.py b/skyvern/client/types/download_to_s3block.py similarity index 100% rename from skyvern/client/types/download_to_s_3_block.py rename to skyvern/client/types/download_to_s3block.py diff --git a/skyvern/client/types/entity_type.py b/skyvern/client/types/entity_type.py index 875f3273..0fe7c806 100644 --- a/skyvern/client/types/entity_type.py +++ b/skyvern/client/types/entity_type.py @@ -2,6 +2,4 @@ import typing -EntityType = typing.Union[ - typing.Literal["step", "task", "workflow_run", "workflow_run_block", "observer_thought"], typing.Any -] +EntityType = typing.Union[typing.Literal["step", "task", "workflow_run", "workflow_run_block", "thought"], typing.Any] diff --git a/skyvern/client/types/extraction_block.py b/skyvern/client/types/extraction_block.py index 10f357e6..5656b1de 100644 --- a/skyvern/client/types/extraction_block.py +++ b/skyvern/client/types/extraction_block.py @@ -1,6 +1,5 @@ # 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 @@ -9,7 +8,6 @@ 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): @@ -33,6 +31,7 @@ class ExtractionBlock(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -42,6 +41,3 @@ class ExtractionBlock(UniversalBaseModel): frozen = True smart_union = True extra = pydantic.Extra.allow - - -update_forward_refs(ContextParameter, ExtractionBlock=ExtractionBlock) diff --git a/skyvern/client/types/extraction_block_parameters_item.py b/skyvern/client/types/extraction_block_parameters_item.py index f96c5fd6..cd6babe0 100644 --- a/skyvern/client/types/extraction_block_parameters_item.py +++ b/skyvern/client/types/extraction_block_parameters_item.py @@ -6,7 +6,7 @@ import typing import datetime as dt from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -from .context_parameter_value import ContextParameterValue +from .value import Value from .workflow_parameter_type import WorkflowParameterType from .workflow_parameter_default_value import WorkflowParameterDefaultValue from ..core.pydantic_utilities import update_forward_refs @@ -67,8 +67,9 @@ class ExtractionBlockParametersItem_BitwardenLoginCredential(UniversalBaseModel) 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 + url_parameter_key: typing.Optional[str] = None bitwarden_collection_id: typing.Optional[str] = None + bitwarden_item_id: typing.Optional[str] = None created_at: dt.datetime modified_at: dt.datetime deleted_at: typing.Optional[dt.datetime] = None @@ -113,8 +114,8 @@ class ExtractionBlockParametersItem_Context(UniversalBaseModel): parameter_type: typing.Literal["context"] = "context" key: str description: typing.Optional[str] = None - source: "ContextParameterSource" - value: typing.Optional[ContextParameterValue] = None + source: "Source" + value: typing.Optional[Value] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -127,7 +128,28 @@ class ExtractionBlockParametersItem_Context(UniversalBaseModel): from .context_parameter import ContextParameter # noqa: E402 -from .context_parameter_source import ContextParameterSource # noqa: E402 +from .source import Source # noqa: E402 + + +class ExtractionBlockParametersItem_Credential(UniversalBaseModel): + parameter_type: typing.Literal["credential"] = "credential" + key: str + description: typing.Optional[str] = None + credential_parameter_id: str + workflow_id: str + credential_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_Output(UniversalBaseModel): @@ -178,8 +200,8 @@ ExtractionBlockParametersItem = typing.Union[ ExtractionBlockParametersItem_BitwardenLoginCredential, ExtractionBlockParametersItem_BitwardenSensitiveInformation, ExtractionBlockParametersItem_Context, + ExtractionBlockParametersItem_Credential, ExtractionBlockParametersItem_Output, ExtractionBlockParametersItem_Workflow, ] -update_forward_refs(ContextParameter, ExtractionBlockParametersItem_Context=ExtractionBlockParametersItem_Context) update_forward_refs(ExtractionBlockParametersItem_Context) diff --git a/skyvern/client/types/file_download_block.py b/skyvern/client/types/file_download_block.py index 9ab9ecd8..49995244 100644 --- a/skyvern/client/types/file_download_block.py +++ b/skyvern/client/types/file_download_block.py @@ -1,6 +1,5 @@ # 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 @@ -9,7 +8,6 @@ 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): @@ -33,6 +31,7 @@ class FileDownloadBlock(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -42,6 +41,3 @@ class FileDownloadBlock(UniversalBaseModel): frozen = True smart_union = True extra = pydantic.Extra.allow - - -update_forward_refs(ContextParameter, FileDownloadBlock=FileDownloadBlock) diff --git a/skyvern/client/types/file_download_block_parameters_item.py b/skyvern/client/types/file_download_block_parameters_item.py index 62038e96..04004d8a 100644 --- a/skyvern/client/types/file_download_block_parameters_item.py +++ b/skyvern/client/types/file_download_block_parameters_item.py @@ -6,7 +6,7 @@ import typing import datetime as dt from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -from .context_parameter_value import ContextParameterValue +from .value import Value from .workflow_parameter_type import WorkflowParameterType from .workflow_parameter_default_value import WorkflowParameterDefaultValue from ..core.pydantic_utilities import update_forward_refs @@ -67,8 +67,9 @@ class FileDownloadBlockParametersItem_BitwardenLoginCredential(UniversalBaseMode 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 + url_parameter_key: typing.Optional[str] = None bitwarden_collection_id: typing.Optional[str] = None + bitwarden_item_id: typing.Optional[str] = None created_at: dt.datetime modified_at: dt.datetime deleted_at: typing.Optional[dt.datetime] = None @@ -113,8 +114,8 @@ class FileDownloadBlockParametersItem_Context(UniversalBaseModel): parameter_type: typing.Literal["context"] = "context" key: str description: typing.Optional[str] = None - source: "ContextParameterSource" - value: typing.Optional[ContextParameterValue] = None + source: "Source" + value: typing.Optional[Value] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -127,7 +128,28 @@ class FileDownloadBlockParametersItem_Context(UniversalBaseModel): from .context_parameter import ContextParameter # noqa: E402 -from .context_parameter_source import ContextParameterSource # noqa: E402 +from .source import Source # noqa: E402 + + +class FileDownloadBlockParametersItem_Credential(UniversalBaseModel): + parameter_type: typing.Literal["credential"] = "credential" + key: str + description: typing.Optional[str] = None + credential_parameter_id: str + workflow_id: str + credential_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_Output(UniversalBaseModel): @@ -178,8 +200,8 @@ FileDownloadBlockParametersItem = typing.Union[ FileDownloadBlockParametersItem_BitwardenLoginCredential, FileDownloadBlockParametersItem_BitwardenSensitiveInformation, FileDownloadBlockParametersItem_Context, + FileDownloadBlockParametersItem_Credential, FileDownloadBlockParametersItem_Output, FileDownloadBlockParametersItem_Workflow, ] -update_forward_refs(ContextParameter, FileDownloadBlockParametersItem_Context=FileDownloadBlockParametersItem_Context) update_forward_refs(FileDownloadBlockParametersItem_Context) diff --git a/skyvern/client/types/file_info.py b/skyvern/client/types/file_info.py new file mode 100644 index 00000000..90aefad3 --- /dev/null +++ b/skyvern/client/types/file_info.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class FileInfo(UniversalBaseModel): + """ + Information about a downloaded file, including URL and checksum. + """ + + url: str = pydantic.Field() + """ + URL to access the file + """ + + checksum: typing.Optional[str] = pydantic.Field(default=None) + """ + SHA-256 checksum of the file + """ + + filename: typing.Optional[str] = pydantic.Field(default=None) + """ + Original filename + """ + + 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 diff --git a/skyvern/client/types/ai_suggestion_type.py b/skyvern/client/types/file_storage_type.py similarity index 62% rename from skyvern/client/types/ai_suggestion_type.py rename to skyvern/client/types/file_storage_type.py index f1a1e016..132c3ca8 100644 --- a/skyvern/client/types/ai_suggestion_type.py +++ b/skyvern/client/types/file_storage_type.py @@ -2,4 +2,4 @@ import typing -AiSuggestionType = typing.Literal["data_schema"] +FileStorageType = typing.Literal["s3"] diff --git a/skyvern/client/types/file_upload_block.py b/skyvern/client/types/file_upload_block.py new file mode 100644 index 00000000..75954aa6 --- /dev/null +++ b/skyvern/client/types/file_upload_block.py @@ -0,0 +1,31 @@ +# 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_storage_type import FileStorageType +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class FileUploadBlock(UniversalBaseModel): + label: str + output_parameter: OutputParameter + continue_on_failure: typing.Optional[bool] = None + storage_type: typing.Optional[FileStorageType] = None + s3bucket: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="s3_bucket")] = None + aws_access_key_id: typing.Optional[str] = None + aws_secret_access_key: typing.Optional[str] = None + region_name: typing.Optional[str] = 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 diff --git a/skyvern/client/types/for_loop_block.py b/skyvern/client/types/for_loop_block.py index e2888a57..8b666de7 100644 --- a/skyvern/client/types/for_loop_block.py +++ b/skyvern/client/types/for_loop_block.py @@ -32,5 +32,4 @@ class ForLoopBlock(UniversalBaseModel): from .for_loop_block_loop_blocks_item import ForLoopBlockLoopBlocksItem # noqa: E402 -update_forward_refs(ContextParameter, ForLoopBlock=ForLoopBlock) update_forward_refs(ForLoopBlock) diff --git a/skyvern/client/types/for_loop_block_loop_blocks_item.py b/skyvern/client/types/for_loop_block_loop_blocks_item.py index 9da44c52..cf6dca81 100644 --- a/skyvern/client/types/for_loop_block_loop_blocks_item.py +++ b/skyvern/client/types/for_loop_block_loop_blocks_item.py @@ -14,6 +14,9 @@ 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_storage_type import FileStorageType +import typing_extensions +from ..core.serialization import FieldMetadata from .file_type import FileType from .for_loop_block_loop_over import ForLoopBlockLoopOver from .url_block_data_schema import UrlBlockDataSchema @@ -54,6 +57,7 @@ class ForLoopBlockLoopBlocksItem_Action(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -122,6 +126,7 @@ class ForLoopBlockLoopBlocksItem_Extraction(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -155,6 +160,29 @@ class ForLoopBlockLoopBlocksItem_FileDownload(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: 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_FileUpload(UniversalBaseModel): + block_type: typing.Literal["file_upload"] = "file_upload" + label: str + output_parameter: OutputParameter + continue_on_failure: typing.Optional[bool] = None + storage_type: typing.Optional[FileStorageType] = None + s3bucket: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="s3_bucket")] = None + aws_access_key_id: typing.Optional[str] = None + aws_secret_access_key: typing.Optional[str] = None + region_name: typing.Optional[str] = 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 @@ -229,6 +257,7 @@ class ForLoopBlockLoopBlocksItem_GotoUrl(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -262,6 +291,7 @@ class ForLoopBlockLoopBlocksItem_Login(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -295,6 +325,7 @@ class ForLoopBlockLoopBlocksItem_Navigation(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -371,6 +402,7 @@ class ForLoopBlockLoopBlocksItem_Task(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -392,6 +424,7 @@ class ForLoopBlockLoopBlocksItem_TaskV2(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None max_iterations: typing.Optional[int] = None + max_steps: typing.Optional[int] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -462,6 +495,7 @@ class ForLoopBlockLoopBlocksItem_Validation(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -497,6 +531,7 @@ ForLoopBlockLoopBlocksItem = typing.Union[ ForLoopBlockLoopBlocksItem_DownloadToS3, ForLoopBlockLoopBlocksItem_Extraction, ForLoopBlockLoopBlocksItem_FileDownload, + ForLoopBlockLoopBlocksItem_FileUpload, ForLoopBlockLoopBlocksItem_FileUrlParser, ForLoopBlockLoopBlocksItem_ForLoop, ForLoopBlockLoopBlocksItem_GotoUrl, @@ -511,17 +546,4 @@ ForLoopBlockLoopBlocksItem = typing.Union[ 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) diff --git a/skyvern/client/types/for_loop_block_loop_over.py b/skyvern/client/types/for_loop_block_loop_over.py index ae0f5d31..95a58d9e 100644 --- a/skyvern/client/types/for_loop_block_loop_over.py +++ b/skyvern/client/types/for_loop_block_loop_over.py @@ -6,7 +6,7 @@ import typing import datetime as dt from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -from .context_parameter_value import ContextParameterValue +from .value import Value from .workflow_parameter_type import WorkflowParameterType from .workflow_parameter_default_value import WorkflowParameterDefaultValue from ..core.pydantic_utilities import update_forward_refs @@ -67,8 +67,9 @@ class ForLoopBlockLoopOver_BitwardenLoginCredential(UniversalBaseModel): 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 + url_parameter_key: typing.Optional[str] = None bitwarden_collection_id: typing.Optional[str] = None + bitwarden_item_id: typing.Optional[str] = None created_at: dt.datetime modified_at: dt.datetime deleted_at: typing.Optional[dt.datetime] = None @@ -113,8 +114,8 @@ class ForLoopBlockLoopOver_Context(UniversalBaseModel): parameter_type: typing.Literal["context"] = "context" key: str description: typing.Optional[str] = None - source: "ContextParameterSource" - value: typing.Optional[ContextParameterValue] = None + source: "Source" + value: typing.Optional[Value] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -127,7 +128,28 @@ class ForLoopBlockLoopOver_Context(UniversalBaseModel): from .context_parameter import ContextParameter # noqa: E402 -from .context_parameter_source import ContextParameterSource # noqa: E402 +from .source import Source # noqa: E402 + + +class ForLoopBlockLoopOver_Credential(UniversalBaseModel): + parameter_type: typing.Literal["credential"] = "credential" + key: str + description: typing.Optional[str] = None + credential_parameter_id: str + workflow_id: str + credential_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_Output(UniversalBaseModel): @@ -178,8 +200,8 @@ ForLoopBlockLoopOver = typing.Union[ ForLoopBlockLoopOver_BitwardenLoginCredential, ForLoopBlockLoopOver_BitwardenSensitiveInformation, ForLoopBlockLoopOver_Context, + ForLoopBlockLoopOver_Credential, ForLoopBlockLoopOver_Output, ForLoopBlockLoopOver_Workflow, ] -update_forward_refs(ContextParameter, ForLoopBlockLoopOver_Context=ForLoopBlockLoopOver_Context) update_forward_refs(ForLoopBlockLoopOver_Context) diff --git a/skyvern/client/types/login_block.py b/skyvern/client/types/login_block.py index 70fec9c4..602c5c8a 100644 --- a/skyvern/client/types/login_block.py +++ b/skyvern/client/types/login_block.py @@ -1,6 +1,5 @@ # 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 @@ -9,7 +8,6 @@ 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): @@ -33,6 +31,7 @@ class LoginBlock(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -42,6 +41,3 @@ class LoginBlock(UniversalBaseModel): frozen = True smart_union = True extra = pydantic.Extra.allow - - -update_forward_refs(ContextParameter, LoginBlock=LoginBlock) diff --git a/skyvern/client/types/login_block_parameters_item.py b/skyvern/client/types/login_block_parameters_item.py index b0713977..615fc83f 100644 --- a/skyvern/client/types/login_block_parameters_item.py +++ b/skyvern/client/types/login_block_parameters_item.py @@ -6,7 +6,7 @@ import typing import datetime as dt from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -from .context_parameter_value import ContextParameterValue +from .value import Value from .workflow_parameter_type import WorkflowParameterType from .workflow_parameter_default_value import WorkflowParameterDefaultValue from ..core.pydantic_utilities import update_forward_refs @@ -67,8 +67,9 @@ class LoginBlockParametersItem_BitwardenLoginCredential(UniversalBaseModel): 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 + url_parameter_key: typing.Optional[str] = None bitwarden_collection_id: typing.Optional[str] = None + bitwarden_item_id: typing.Optional[str] = None created_at: dt.datetime modified_at: dt.datetime deleted_at: typing.Optional[dt.datetime] = None @@ -113,8 +114,8 @@ class LoginBlockParametersItem_Context(UniversalBaseModel): parameter_type: typing.Literal["context"] = "context" key: str description: typing.Optional[str] = None - source: "ContextParameterSource" - value: typing.Optional[ContextParameterValue] = None + source: "Source" + value: typing.Optional[Value] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -127,7 +128,28 @@ class LoginBlockParametersItem_Context(UniversalBaseModel): from .context_parameter import ContextParameter # noqa: E402 -from .context_parameter_source import ContextParameterSource # noqa: E402 +from .source import Source # noqa: E402 + + +class LoginBlockParametersItem_Credential(UniversalBaseModel): + parameter_type: typing.Literal["credential"] = "credential" + key: str + description: typing.Optional[str] = None + credential_parameter_id: str + workflow_id: str + credential_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_Output(UniversalBaseModel): @@ -178,8 +200,8 @@ LoginBlockParametersItem = typing.Union[ LoginBlockParametersItem_BitwardenLoginCredential, LoginBlockParametersItem_BitwardenSensitiveInformation, LoginBlockParametersItem_Context, + LoginBlockParametersItem_Credential, LoginBlockParametersItem_Output, LoginBlockParametersItem_Workflow, ] -update_forward_refs(ContextParameter, LoginBlockParametersItem_Context=LoginBlockParametersItem_Context) update_forward_refs(LoginBlockParametersItem_Context) diff --git a/skyvern/client/types/navigation_block.py b/skyvern/client/types/navigation_block.py index a7ec1e20..41cdbf25 100644 --- a/skyvern/client/types/navigation_block.py +++ b/skyvern/client/types/navigation_block.py @@ -1,6 +1,5 @@ # 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 @@ -9,7 +8,6 @@ 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): @@ -33,6 +31,7 @@ class NavigationBlock(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -42,6 +41,3 @@ class NavigationBlock(UniversalBaseModel): frozen = True smart_union = True extra = pydantic.Extra.allow - - -update_forward_refs(ContextParameter, NavigationBlock=NavigationBlock) diff --git a/skyvern/client/types/navigation_block_parameters_item.py b/skyvern/client/types/navigation_block_parameters_item.py index 138d2ca3..47b123f2 100644 --- a/skyvern/client/types/navigation_block_parameters_item.py +++ b/skyvern/client/types/navigation_block_parameters_item.py @@ -6,7 +6,7 @@ import typing import datetime as dt from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -from .context_parameter_value import ContextParameterValue +from .value import Value from .workflow_parameter_type import WorkflowParameterType from .workflow_parameter_default_value import WorkflowParameterDefaultValue from ..core.pydantic_utilities import update_forward_refs @@ -67,8 +67,9 @@ class NavigationBlockParametersItem_BitwardenLoginCredential(UniversalBaseModel) 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 + url_parameter_key: typing.Optional[str] = None bitwarden_collection_id: typing.Optional[str] = None + bitwarden_item_id: typing.Optional[str] = None created_at: dt.datetime modified_at: dt.datetime deleted_at: typing.Optional[dt.datetime] = None @@ -113,8 +114,8 @@ class NavigationBlockParametersItem_Context(UniversalBaseModel): parameter_type: typing.Literal["context"] = "context" key: str description: typing.Optional[str] = None - source: "ContextParameterSource" - value: typing.Optional[ContextParameterValue] = None + source: "Source" + value: typing.Optional[Value] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -127,7 +128,28 @@ class NavigationBlockParametersItem_Context(UniversalBaseModel): from .context_parameter import ContextParameter # noqa: E402 -from .context_parameter_source import ContextParameterSource # noqa: E402 +from .source import Source # noqa: E402 + + +class NavigationBlockParametersItem_Credential(UniversalBaseModel): + parameter_type: typing.Literal["credential"] = "credential" + key: str + description: typing.Optional[str] = None + credential_parameter_id: str + workflow_id: str + credential_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_Output(UniversalBaseModel): @@ -178,8 +200,8 @@ NavigationBlockParametersItem = typing.Union[ NavigationBlockParametersItem_BitwardenLoginCredential, NavigationBlockParametersItem_BitwardenSensitiveInformation, NavigationBlockParametersItem_Context, + NavigationBlockParametersItem_Credential, NavigationBlockParametersItem_Output, NavigationBlockParametersItem_Workflow, ] -update_forward_refs(ContextParameter, NavigationBlockParametersItem_Context=NavigationBlockParametersItem_Context) update_forward_refs(NavigationBlockParametersItem_Context) diff --git a/skyvern/client/types/non_empty_credit_card_credential.py b/skyvern/client/types/non_empty_credit_card_credential.py new file mode 100644 index 00000000..a908f9ce --- /dev/null +++ b/skyvern/client/types/non_empty_credit_card_credential.py @@ -0,0 +1,24 @@ +# 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 NonEmptyCreditCardCredential(UniversalBaseModel): + card_number: str + card_cvv: str + card_exp_month: str + card_exp_year: str + card_brand: str + card_holder_name: 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 diff --git a/skyvern/client/types/non_empty_password_credential.py b/skyvern/client/types/non_empty_password_credential.py new file mode 100644 index 00000000..bde4b3cb --- /dev/null +++ b/skyvern/client/types/non_empty_password_credential.py @@ -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 NonEmptyPasswordCredential(UniversalBaseModel): + password: str + username: str + totp: 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 diff --git a/skyvern/client/types/observer_thought_type.py b/skyvern/client/types/observer_thought_type.py deleted file mode 100644 index edcdaa64..00000000 --- a/skyvern/client/types/observer_thought_type.py +++ /dev/null @@ -1,5 +0,0 @@ -# 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] diff --git a/skyvern/client/types/output.py b/skyvern/client/types/output.py new file mode 100644 index 00000000..639cb9f6 --- /dev/null +++ b/skyvern/client/types/output.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +Output = typing.Union[typing.Dict[str, typing.Optional[typing.Any]], typing.List[typing.Optional[typing.Any]], str] diff --git a/skyvern/client/types/password_credential_response.py b/skyvern/client/types/password_credential_response.py new file mode 100644 index 00000000..7f39ca7d --- /dev/null +++ b/skyvern/client/types/password_credential_response.py @@ -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 PasswordCredentialResponse(UniversalBaseModel): + username: 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 diff --git a/skyvern/client/types/proxy_location.py b/skyvern/client/types/proxy_location.py index 94b131f0..0994a307 100644 --- a/skyvern/client/types/proxy_location.py +++ b/skyvern/client/types/proxy_location.py @@ -16,6 +16,11 @@ ProxyLocation = typing.Union[ "RESIDENTIAL_IN", "RESIDENTIAL_JP", "RESIDENTIAL_FR", + "RESIDENTIAL_DE", + "RESIDENTIAL_NZ", + "RESIDENTIAL_ZA", + "RESIDENTIAL_AR", + "RESIDENTIAL_ISP", "NONE", ], typing.Any, diff --git a/skyvern/client/types/run_engine.py b/skyvern/client/types/run_engine.py new file mode 100644 index 00000000..2e499226 --- /dev/null +++ b/skyvern/client/types/run_engine.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +RunEngine = typing.Union[typing.Literal["skyvern-1.0", "skyvern-2.0"], typing.Any] diff --git a/skyvern/client/types/context_parameter_source.py b/skyvern/client/types/source.py similarity index 78% rename from skyvern/client/types/context_parameter_source.py rename to skyvern/client/types/source.py index 4398b862..e3fbdf3e 100644 --- a/skyvern/client/types/context_parameter_source.py +++ b/skyvern/client/types/source.py @@ -8,11 +8,11 @@ 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 .value import Value from ..core.pydantic_utilities import update_forward_refs -class ContextParameterSource_Workflow(UniversalBaseModel): +class Source_Workflow(UniversalBaseModel): parameter_type: typing.Literal["workflow"] = "workflow" key: str description: typing.Optional[str] = None @@ -34,12 +34,12 @@ class ContextParameterSource_Workflow(UniversalBaseModel): extra = pydantic.Extra.allow -class ContextParameterSource_Context(UniversalBaseModel): +class Source_Context(UniversalBaseModel): parameter_type: typing.Literal["context"] = "context" key: str description: typing.Optional[str] = None - source: "ContextParameterSource" - value: typing.Optional[ContextParameterValue] = None + source: "Source" + value: typing.Optional[Value] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -54,7 +54,7 @@ class ContextParameterSource_Context(UniversalBaseModel): from .context_parameter import ContextParameter # noqa: E402 -class ContextParameterSource_AwsSecret(UniversalBaseModel): +class Source_AwsSecret(UniversalBaseModel): parameter_type: typing.Literal["aws_secret"] = "aws_secret" key: str description: typing.Optional[str] = None @@ -75,7 +75,7 @@ class ContextParameterSource_AwsSecret(UniversalBaseModel): extra = pydantic.Extra.allow -class ContextParameterSource_BitwardenLoginCredential(UniversalBaseModel): +class Source_BitwardenLoginCredential(UniversalBaseModel): parameter_type: typing.Literal["bitwarden_login_credential"] = "bitwarden_login_credential" key: str description: typing.Optional[str] = None @@ -84,8 +84,9 @@ class ContextParameterSource_BitwardenLoginCredential(UniversalBaseModel): 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 + url_parameter_key: typing.Optional[str] = None bitwarden_collection_id: typing.Optional[str] = None + bitwarden_item_id: typing.Optional[str] = None created_at: dt.datetime modified_at: dt.datetime deleted_at: typing.Optional[dt.datetime] = None @@ -100,7 +101,7 @@ class ContextParameterSource_BitwardenLoginCredential(UniversalBaseModel): extra = pydantic.Extra.allow -class ContextParameterSource_BitwardenSensitiveInformation(UniversalBaseModel): +class Source_BitwardenSensitiveInformation(UniversalBaseModel): parameter_type: typing.Literal["bitwarden_sensitive_information"] = "bitwarden_sensitive_information" key: str description: typing.Optional[str] = None @@ -126,7 +127,7 @@ class ContextParameterSource_BitwardenSensitiveInformation(UniversalBaseModel): extra = pydantic.Extra.allow -class ContextParameterSource_BitwardenCreditCardData(UniversalBaseModel): +class Source_BitwardenCreditCardData(UniversalBaseModel): parameter_type: typing.Literal["bitwarden_credit_card_data"] = "bitwarden_credit_card_data" key: str description: typing.Optional[str] = None @@ -151,7 +152,7 @@ class ContextParameterSource_BitwardenCreditCardData(UniversalBaseModel): extra = pydantic.Extra.allow -class ContextParameterSource_Output(UniversalBaseModel): +class Source_Output(UniversalBaseModel): parameter_type: typing.Literal["output"] = "output" key: str description: typing.Optional[str] = None @@ -171,14 +172,35 @@ class ContextParameterSource_Output(UniversalBaseModel): extra = pydantic.Extra.allow -ContextParameterSource = typing.Union[ - ContextParameterSource_Workflow, - ContextParameterSource_Context, - ContextParameterSource_AwsSecret, - ContextParameterSource_BitwardenLoginCredential, - ContextParameterSource_BitwardenSensitiveInformation, - ContextParameterSource_BitwardenCreditCardData, - ContextParameterSource_Output, +class Source_Credential(UniversalBaseModel): + parameter_type: typing.Literal["credential"] = "credential" + key: str + description: typing.Optional[str] = None + credential_parameter_id: str + workflow_id: str + credential_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 + + +Source = typing.Union[ + Source_Workflow, + Source_Context, + Source_AwsSecret, + Source_BitwardenLoginCredential, + Source_BitwardenSensitiveInformation, + Source_BitwardenCreditCardData, + Source_Output, + Source_Credential, ] -update_forward_refs(ContextParameter, ContextParameterSource_Context=ContextParameterSource_Context) -update_forward_refs(ContextParameterSource_Context) +update_forward_refs(Source_Context) diff --git a/skyvern/client/types/step.py b/skyvern/client/types/step.py index fdc6fa11..b0a2762b 100644 --- a/skyvern/client/types/step.py +++ b/skyvern/client/types/step.py @@ -22,6 +22,8 @@ class Step(UniversalBaseModel): organization_id: typing.Optional[str] = None input_token_count: typing.Optional[int] = None output_token_count: typing.Optional[int] = None + reasoning_token_count: typing.Optional[int] = None + cached_token_count: typing.Optional[int] = None step_cost: typing.Optional[float] = None if IS_PYDANTIC_V2: diff --git a/skyvern/client/types/task_block.py b/skyvern/client/types/task_block.py index ab89723b..b90b391a 100644 --- a/skyvern/client/types/task_block.py +++ b/skyvern/client/types/task_block.py @@ -1,6 +1,5 @@ # 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 @@ -9,7 +8,6 @@ from .task_block_data_schema import TaskBlockDataSchema from .task_block_parameters_item import TaskBlockParametersItem from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -from ..core.pydantic_utilities import update_forward_refs class TaskBlock(UniversalBaseModel): @@ -33,6 +31,7 @@ class TaskBlock(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -42,6 +41,3 @@ class TaskBlock(UniversalBaseModel): frozen = True smart_union = True extra = pydantic.Extra.allow - - -update_forward_refs(ContextParameter, TaskBlock=TaskBlock) diff --git a/skyvern/client/types/task_block_parameters_item.py b/skyvern/client/types/task_block_parameters_item.py index a716e998..1bce86fa 100644 --- a/skyvern/client/types/task_block_parameters_item.py +++ b/skyvern/client/types/task_block_parameters_item.py @@ -6,7 +6,7 @@ import typing import datetime as dt from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -from .context_parameter_value import ContextParameterValue +from .value import Value from .workflow_parameter_type import WorkflowParameterType from .workflow_parameter_default_value import WorkflowParameterDefaultValue from ..core.pydantic_utilities import update_forward_refs @@ -67,8 +67,9 @@ class TaskBlockParametersItem_BitwardenLoginCredential(UniversalBaseModel): 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 + url_parameter_key: typing.Optional[str] = None bitwarden_collection_id: typing.Optional[str] = None + bitwarden_item_id: typing.Optional[str] = None created_at: dt.datetime modified_at: dt.datetime deleted_at: typing.Optional[dt.datetime] = None @@ -113,8 +114,8 @@ class TaskBlockParametersItem_Context(UniversalBaseModel): parameter_type: typing.Literal["context"] = "context" key: str description: typing.Optional[str] = None - source: "ContextParameterSource" - value: typing.Optional[ContextParameterValue] = None + source: "Source" + value: typing.Optional[Value] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -127,7 +128,28 @@ class TaskBlockParametersItem_Context(UniversalBaseModel): from .context_parameter import ContextParameter # noqa: E402 -from .context_parameter_source import ContextParameterSource # noqa: E402 +from .source import Source # noqa: E402 + + +class TaskBlockParametersItem_Credential(UniversalBaseModel): + parameter_type: typing.Literal["credential"] = "credential" + key: str + description: typing.Optional[str] = None + credential_parameter_id: str + workflow_id: str + credential_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 TaskBlockParametersItem_Output(UniversalBaseModel): @@ -178,8 +200,8 @@ TaskBlockParametersItem = typing.Union[ TaskBlockParametersItem_BitwardenLoginCredential, TaskBlockParametersItem_BitwardenSensitiveInformation, TaskBlockParametersItem_Context, + TaskBlockParametersItem_Credential, TaskBlockParametersItem_Output, TaskBlockParametersItem_Workflow, ] -update_forward_refs(ContextParameter, TaskBlockParametersItem_Context=TaskBlockParametersItem_Context) update_forward_refs(TaskBlockParametersItem_Context) diff --git a/skyvern/client/types/task_response.py b/skyvern/client/types/task_response.py index 54bb8304..5d62fd6f 100644 --- a/skyvern/client/types/task_response.py +++ b/skyvern/client/types/task_response.py @@ -6,6 +6,7 @@ from .task_status import TaskStatus import datetime as dt import typing from .task_response_extracted_information import TaskResponseExtractedInformation +from .file_info import FileInfo from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic @@ -21,6 +22,7 @@ class TaskResponse(UniversalBaseModel): screenshot_url: typing.Optional[str] = None recording_url: typing.Optional[str] = None browser_console_log_url: typing.Optional[str] = None + downloaded_files: typing.Optional[typing.List[FileInfo]] = None downloaded_file_urls: typing.Optional[typing.List[str]] = None failure_reason: typing.Optional[str] = None errors: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = None diff --git a/skyvern/client/types/task_run_response.py b/skyvern/client/types/task_run_response.py new file mode 100644 index 00000000..62df5322 --- /dev/null +++ b/skyvern/client/types/task_run_response.py @@ -0,0 +1,41 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .run_engine import RunEngine +from .task_run_status import TaskRunStatus +from .output import Output +from .proxy_location import ProxyLocation +from .task_run_response_data_extraction_schema import TaskRunResponseDataExtractionSchema +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class TaskRunResponse(UniversalBaseModel): + run_id: str + engine: typing.Optional[RunEngine] = None + status: TaskRunStatus + goal: typing.Optional[str] = None + url: typing.Optional[str] = None + output: typing.Optional[Output] = None + failure_reason: typing.Optional[str] = None + webhook_url: typing.Optional[str] = None + totp_identifier: typing.Optional[str] = None + totp_url: typing.Optional[str] = None + proxy_location: typing.Optional[ProxyLocation] = None + error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None + data_extraction_schema: typing.Optional[TaskRunResponseDataExtractionSchema] = None + title: typing.Optional[str] = None + max_steps: typing.Optional[int] = 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 diff --git a/skyvern/client/types/workflow_run_block_output.py b/skyvern/client/types/task_run_response_data_extraction_schema.py similarity index 77% rename from skyvern/client/types/workflow_run_block_output.py rename to skyvern/client/types/task_run_response_data_extraction_schema.py index df9da62d..99c5d60c 100644 --- a/skyvern/client/types/workflow_run_block_output.py +++ b/skyvern/client/types/task_run_response_data_extraction_schema.py @@ -2,6 +2,6 @@ import typing -WorkflowRunBlockOutput = typing.Union[ +TaskRunResponseDataExtractionSchema = typing.Union[ typing.Dict[str, typing.Optional[typing.Any]], typing.List[typing.Optional[typing.Any]], str ] diff --git a/skyvern/client/types/task_run_status.py b/skyvern/client/types/task_run_status.py new file mode 100644 index 00000000..0cd14d28 --- /dev/null +++ b/skyvern/client/types/task_run_status.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +TaskRunStatus = typing.Union[ + typing.Literal["created", "queued", "running", "timed_out", "failed", "terminated", "completed", "canceled"], + typing.Any, +] diff --git a/skyvern/client/types/observer_task.py b/skyvern/client/types/task_v2.py similarity index 72% rename from skyvern/client/types/observer_task.py rename to skyvern/client/types/task_v2.py index a35bb0b3..56925d94 100644 --- a/skyvern/client/types/observer_task.py +++ b/skyvern/client/types/task_v2.py @@ -1,18 +1,19 @@ # This file was auto-generated by Fern from our API Definition. from ..core.pydantic_utilities import UniversalBaseModel -from .observer_task_status import ObserverTaskStatus +from .task_v2status import TaskV2Status import typing -from .observer_task_output import ObserverTaskOutput +from .output import Output from .proxy_location import ProxyLocation +from .task_v2extracted_information_schema import TaskV2ExtractedInformationSchema import datetime as dt from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -class ObserverTask(UniversalBaseModel): +class TaskV2(UniversalBaseModel): task_id: str - status: ObserverTaskStatus + status: TaskV2Status organization_id: typing.Optional[str] = None workflow_run_id: typing.Optional[str] = None workflow_id: typing.Optional[str] = None @@ -20,11 +21,13 @@ class ObserverTask(UniversalBaseModel): prompt: typing.Optional[str] = None url: typing.Optional[str] = None summary: typing.Optional[str] = None - output: typing.Optional[ObserverTaskOutput] = None + output: typing.Optional[Output] = 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 + extracted_information_schema: typing.Optional[TaskV2ExtractedInformationSchema] = None + error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None created_at: dt.datetime modified_at: dt.datetime diff --git a/skyvern/client/types/task_v_2_block.py b/skyvern/client/types/task_v2block.py similarity index 95% rename from skyvern/client/types/task_v_2_block.py rename to skyvern/client/types/task_v2block.py index e735e2e7..4ac7484a 100644 --- a/skyvern/client/types/task_v_2_block.py +++ b/skyvern/client/types/task_v2block.py @@ -16,6 +16,7 @@ class TaskV2Block(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None max_iterations: typing.Optional[int] = None + max_steps: typing.Optional[int] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/skyvern/client/types/action_result_data.py b/skyvern/client/types/task_v2extracted_information_schema.py similarity index 78% rename from skyvern/client/types/action_result_data.py rename to skyvern/client/types/task_v2extracted_information_schema.py index f781972a..43b3e7ea 100644 --- a/skyvern/client/types/action_result_data.py +++ b/skyvern/client/types/task_v2extracted_information_schema.py @@ -2,6 +2,6 @@ import typing -ActionResultData = typing.Union[ +TaskV2ExtractedInformationSchema = typing.Union[ typing.Dict[str, typing.Optional[typing.Any]], typing.List[typing.Optional[typing.Any]], str ] diff --git a/skyvern/client/types/observer_task_status.py b/skyvern/client/types/task_v2status.py similarity index 85% rename from skyvern/client/types/observer_task_status.py rename to skyvern/client/types/task_v2status.py index d0094099..e9b7f795 100644 --- a/skyvern/client/types/observer_task_status.py +++ b/skyvern/client/types/task_v2status.py @@ -2,7 +2,7 @@ import typing -ObserverTaskStatus = typing.Union[ +TaskV2Status = typing.Union[ typing.Literal["created", "queued", "running", "failed", "terminated", "canceled", "timed_out", "completed"], typing.Any, ] diff --git a/skyvern/client/types/text_prompt_block.py b/skyvern/client/types/text_prompt_block.py index 768f8e2d..8295a83a 100644 --- a/skyvern/client/types/text_prompt_block.py +++ b/skyvern/client/types/text_prompt_block.py @@ -1,6 +1,5 @@ # 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 @@ -8,7 +7,6 @@ import typing from .text_prompt_block_parameters_item import TextPromptBlockParametersItem from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -from ..core.pydantic_utilities import update_forward_refs class TextPromptBlock(UniversalBaseModel): @@ -28,6 +26,3 @@ class TextPromptBlock(UniversalBaseModel): frozen = True smart_union = True extra = pydantic.Extra.allow - - -update_forward_refs(ContextParameter, TextPromptBlock=TextPromptBlock) diff --git a/skyvern/client/types/text_prompt_block_parameters_item.py b/skyvern/client/types/text_prompt_block_parameters_item.py index c0179ca8..0cc9250b 100644 --- a/skyvern/client/types/text_prompt_block_parameters_item.py +++ b/skyvern/client/types/text_prompt_block_parameters_item.py @@ -6,7 +6,7 @@ import typing import datetime as dt from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -from .context_parameter_value import ContextParameterValue +from .value import Value from .workflow_parameter_type import WorkflowParameterType from .workflow_parameter_default_value import WorkflowParameterDefaultValue from ..core.pydantic_utilities import update_forward_refs @@ -67,8 +67,9 @@ class TextPromptBlockParametersItem_BitwardenLoginCredential(UniversalBaseModel) 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 + url_parameter_key: typing.Optional[str] = None bitwarden_collection_id: typing.Optional[str] = None + bitwarden_item_id: typing.Optional[str] = None created_at: dt.datetime modified_at: dt.datetime deleted_at: typing.Optional[dt.datetime] = None @@ -113,8 +114,8 @@ class TextPromptBlockParametersItem_Context(UniversalBaseModel): parameter_type: typing.Literal["context"] = "context" key: str description: typing.Optional[str] = None - source: "ContextParameterSource" - value: typing.Optional[ContextParameterValue] = None + source: "Source" + value: typing.Optional[Value] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -127,7 +128,28 @@ class TextPromptBlockParametersItem_Context(UniversalBaseModel): from .context_parameter import ContextParameter # noqa: E402 -from .context_parameter_source import ContextParameterSource # noqa: E402 +from .source import Source # noqa: E402 + + +class TextPromptBlockParametersItem_Credential(UniversalBaseModel): + parameter_type: typing.Literal["credential"] = "credential" + key: str + description: typing.Optional[str] = None + credential_parameter_id: str + workflow_id: str + credential_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 TextPromptBlockParametersItem_Output(UniversalBaseModel): @@ -178,8 +200,8 @@ TextPromptBlockParametersItem = typing.Union[ TextPromptBlockParametersItem_BitwardenLoginCredential, TextPromptBlockParametersItem_BitwardenSensitiveInformation, TextPromptBlockParametersItem_Context, + TextPromptBlockParametersItem_Credential, TextPromptBlockParametersItem_Output, TextPromptBlockParametersItem_Workflow, ] -update_forward_refs(ContextParameter, TextPromptBlockParametersItem_Context=TextPromptBlockParametersItem_Context) update_forward_refs(TextPromptBlockParametersItem_Context) diff --git a/skyvern/client/types/observer_thought.py b/skyvern/client/types/thought.py similarity index 78% rename from skyvern/client/types/observer_thought.py rename to skyvern/client/types/thought.py index dc90f909..bae268d6 100644 --- a/skyvern/client/types/observer_thought.py +++ b/skyvern/client/types/thought.py @@ -2,14 +2,14 @@ from ..core.pydantic_utilities import UniversalBaseModel import typing -from .observer_thought_type import ObserverThoughtType -from .observer_thought_scenario import ObserverThoughtScenario +from .thought_type import ThoughtType +from .thought_scenario import ThoughtScenario import datetime as dt from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -class ObserverThought(UniversalBaseModel): +class Thought(UniversalBaseModel): thought_id: str task_id: str organization_id: typing.Optional[str] = None @@ -21,11 +21,13 @@ class ObserverThought(UniversalBaseModel): 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 + thought_type: typing.Optional[ThoughtType] = None + thought_scenario: typing.Optional[ThoughtScenario] = 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 + reasoning_token_count: typing.Optional[int] = None + cached_token_count: typing.Optional[int] = None thought_cost: typing.Optional[float] = None created_at: dt.datetime modified_at: dt.datetime diff --git a/skyvern/client/types/observer_thought_scenario.py b/skyvern/client/types/thought_scenario.py similarity index 89% rename from skyvern/client/types/observer_thought_scenario.py rename to skyvern/client/types/thought_scenario.py index 7c4b53f8..b65ee541 100644 --- a/skyvern/client/types/observer_thought_scenario.py +++ b/skyvern/client/types/thought_scenario.py @@ -2,7 +2,7 @@ import typing -ObserverThoughtScenario = typing.Union[ +ThoughtScenario = typing.Union[ typing.Literal[ "generate_plan", "user_goal_check", diff --git a/skyvern/client/types/thought_type.py b/skyvern/client/types/thought_type.py new file mode 100644 index 00000000..56366ac2 --- /dev/null +++ b/skyvern/client/types/thought_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ThoughtType = typing.Union[typing.Literal["plan", "metadata", "user_goal_check", "internal_plan"], typing.Any] diff --git a/skyvern/client/types/upload_to_s_3_block.py b/skyvern/client/types/upload_to_s3block.py similarity index 100% rename from skyvern/client/types/upload_to_s_3_block.py rename to skyvern/client/types/upload_to_s3block.py diff --git a/skyvern/client/types/url_block.py b/skyvern/client/types/url_block.py index c2c3c2c6..e82aecbb 100644 --- a/skyvern/client/types/url_block.py +++ b/skyvern/client/types/url_block.py @@ -1,6 +1,5 @@ # 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 @@ -9,7 +8,6 @@ from .url_block_data_schema import UrlBlockDataSchema from .url_block_parameters_item import UrlBlockParametersItem from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -from ..core.pydantic_utilities import update_forward_refs class UrlBlock(UniversalBaseModel): @@ -33,6 +31,7 @@ class UrlBlock(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -42,6 +41,3 @@ class UrlBlock(UniversalBaseModel): frozen = True smart_union = True extra = pydantic.Extra.allow - - -update_forward_refs(ContextParameter, UrlBlock=UrlBlock) diff --git a/skyvern/client/types/url_block_parameters_item.py b/skyvern/client/types/url_block_parameters_item.py index 7b102249..af20e42c 100644 --- a/skyvern/client/types/url_block_parameters_item.py +++ b/skyvern/client/types/url_block_parameters_item.py @@ -6,7 +6,7 @@ import typing import datetime as dt from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -from .context_parameter_value import ContextParameterValue +from .value import Value from .workflow_parameter_type import WorkflowParameterType from .workflow_parameter_default_value import WorkflowParameterDefaultValue from ..core.pydantic_utilities import update_forward_refs @@ -67,8 +67,9 @@ class UrlBlockParametersItem_BitwardenLoginCredential(UniversalBaseModel): 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 + url_parameter_key: typing.Optional[str] = None bitwarden_collection_id: typing.Optional[str] = None + bitwarden_item_id: typing.Optional[str] = None created_at: dt.datetime modified_at: dt.datetime deleted_at: typing.Optional[dt.datetime] = None @@ -113,8 +114,8 @@ class UrlBlockParametersItem_Context(UniversalBaseModel): parameter_type: typing.Literal["context"] = "context" key: str description: typing.Optional[str] = None - source: "ContextParameterSource" - value: typing.Optional[ContextParameterValue] = None + source: "Source" + value: typing.Optional[Value] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -127,7 +128,28 @@ class UrlBlockParametersItem_Context(UniversalBaseModel): from .context_parameter import ContextParameter # noqa: E402 -from .context_parameter_source import ContextParameterSource # noqa: E402 +from .source import Source # noqa: E402 + + +class UrlBlockParametersItem_Credential(UniversalBaseModel): + parameter_type: typing.Literal["credential"] = "credential" + key: str + description: typing.Optional[str] = None + credential_parameter_id: str + workflow_id: str + credential_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 UrlBlockParametersItem_Output(UniversalBaseModel): @@ -178,8 +200,8 @@ UrlBlockParametersItem = typing.Union[ UrlBlockParametersItem_BitwardenLoginCredential, UrlBlockParametersItem_BitwardenSensitiveInformation, UrlBlockParametersItem_Context, + UrlBlockParametersItem_Credential, UrlBlockParametersItem_Output, UrlBlockParametersItem_Workflow, ] -update_forward_refs(ContextParameter, UrlBlockParametersItem_Context=UrlBlockParametersItem_Context) update_forward_refs(UrlBlockParametersItem_Context) diff --git a/skyvern/client/types/validation_block.py b/skyvern/client/types/validation_block.py index 04606af2..9caaa0bb 100644 --- a/skyvern/client/types/validation_block.py +++ b/skyvern/client/types/validation_block.py @@ -1,6 +1,5 @@ # 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 @@ -9,7 +8,6 @@ from .validation_block_data_schema import ValidationBlockDataSchema from .validation_block_parameters_item import ValidationBlockParametersItem from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -from ..core.pydantic_utilities import update_forward_refs class ValidationBlock(UniversalBaseModel): @@ -33,6 +31,7 @@ class ValidationBlock(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -42,6 +41,3 @@ class ValidationBlock(UniversalBaseModel): frozen = True smart_union = True extra = pydantic.Extra.allow - - -update_forward_refs(ContextParameter, ValidationBlock=ValidationBlock) diff --git a/skyvern/client/types/validation_block_parameters_item.py b/skyvern/client/types/validation_block_parameters_item.py index 7f3bbd6f..63efc92b 100644 --- a/skyvern/client/types/validation_block_parameters_item.py +++ b/skyvern/client/types/validation_block_parameters_item.py @@ -6,7 +6,7 @@ import typing import datetime as dt from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -from .context_parameter_value import ContextParameterValue +from .value import Value from .workflow_parameter_type import WorkflowParameterType from .workflow_parameter_default_value import WorkflowParameterDefaultValue from ..core.pydantic_utilities import update_forward_refs @@ -67,8 +67,9 @@ class ValidationBlockParametersItem_BitwardenLoginCredential(UniversalBaseModel) 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 + url_parameter_key: typing.Optional[str] = None bitwarden_collection_id: typing.Optional[str] = None + bitwarden_item_id: typing.Optional[str] = None created_at: dt.datetime modified_at: dt.datetime deleted_at: typing.Optional[dt.datetime] = None @@ -113,8 +114,8 @@ class ValidationBlockParametersItem_Context(UniversalBaseModel): parameter_type: typing.Literal["context"] = "context" key: str description: typing.Optional[str] = None - source: "ContextParameterSource" - value: typing.Optional[ContextParameterValue] = None + source: "Source" + value: typing.Optional[Value] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -127,7 +128,28 @@ class ValidationBlockParametersItem_Context(UniversalBaseModel): from .context_parameter import ContextParameter # noqa: E402 -from .context_parameter_source import ContextParameterSource # noqa: E402 +from .source import Source # noqa: E402 + + +class ValidationBlockParametersItem_Credential(UniversalBaseModel): + parameter_type: typing.Literal["credential"] = "credential" + key: str + description: typing.Optional[str] = None + credential_parameter_id: str + workflow_id: str + credential_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 ValidationBlockParametersItem_Output(UniversalBaseModel): @@ -178,8 +200,8 @@ ValidationBlockParametersItem = typing.Union[ ValidationBlockParametersItem_BitwardenLoginCredential, ValidationBlockParametersItem_BitwardenSensitiveInformation, ValidationBlockParametersItem_Context, + ValidationBlockParametersItem_Credential, ValidationBlockParametersItem_Output, ValidationBlockParametersItem_Workflow, ] -update_forward_refs(ContextParameter, ValidationBlockParametersItem_Context=ValidationBlockParametersItem_Context) update_forward_refs(ValidationBlockParametersItem_Context) diff --git a/skyvern/client/types/context_parameter_value.py b/skyvern/client/types/value.py similarity index 83% rename from skyvern/client/types/context_parameter_value.py rename to skyvern/client/types/value.py index 40c7452d..42e285e1 100644 --- a/skyvern/client/types/context_parameter_value.py +++ b/skyvern/client/types/value.py @@ -2,6 +2,6 @@ import typing -ContextParameterValue = typing.Union[ +Value = typing.Union[ str, int, float, bool, typing.Dict[str, typing.Optional[typing.Any]], typing.List[typing.Optional[typing.Any]] ] diff --git a/skyvern/client/types/wait_block.py b/skyvern/client/types/wait_block.py index 124f9e49..3bd642bd 100644 --- a/skyvern/client/types/wait_block.py +++ b/skyvern/client/types/wait_block.py @@ -1,6 +1,5 @@ # 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 @@ -8,7 +7,6 @@ import typing from .wait_block_parameters_item import WaitBlockParametersItem from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -from ..core.pydantic_utilities import update_forward_refs class WaitBlock(UniversalBaseModel): @@ -26,6 +24,3 @@ class WaitBlock(UniversalBaseModel): frozen = True smart_union = True extra = pydantic.Extra.allow - - -update_forward_refs(ContextParameter, WaitBlock=WaitBlock) diff --git a/skyvern/client/types/wait_block_parameters_item.py b/skyvern/client/types/wait_block_parameters_item.py index 327b6cde..984f8cfc 100644 --- a/skyvern/client/types/wait_block_parameters_item.py +++ b/skyvern/client/types/wait_block_parameters_item.py @@ -6,7 +6,7 @@ import typing import datetime as dt from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -from .context_parameter_value import ContextParameterValue +from .value import Value from .workflow_parameter_type import WorkflowParameterType from .workflow_parameter_default_value import WorkflowParameterDefaultValue from ..core.pydantic_utilities import update_forward_refs @@ -67,8 +67,9 @@ class WaitBlockParametersItem_BitwardenLoginCredential(UniversalBaseModel): 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 + url_parameter_key: typing.Optional[str] = None bitwarden_collection_id: typing.Optional[str] = None + bitwarden_item_id: typing.Optional[str] = None created_at: dt.datetime modified_at: dt.datetime deleted_at: typing.Optional[dt.datetime] = None @@ -113,8 +114,8 @@ class WaitBlockParametersItem_Context(UniversalBaseModel): parameter_type: typing.Literal["context"] = "context" key: str description: typing.Optional[str] = None - source: "ContextParameterSource" - value: typing.Optional[ContextParameterValue] = None + source: "Source" + value: typing.Optional[Value] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -127,7 +128,28 @@ class WaitBlockParametersItem_Context(UniversalBaseModel): from .context_parameter import ContextParameter # noqa: E402 -from .context_parameter_source import ContextParameterSource # noqa: E402 +from .source import Source # noqa: E402 + + +class WaitBlockParametersItem_Credential(UniversalBaseModel): + parameter_type: typing.Literal["credential"] = "credential" + key: str + description: typing.Optional[str] = None + credential_parameter_id: str + workflow_id: str + credential_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 WaitBlockParametersItem_Output(UniversalBaseModel): @@ -178,8 +200,8 @@ WaitBlockParametersItem = typing.Union[ WaitBlockParametersItem_BitwardenLoginCredential, WaitBlockParametersItem_BitwardenSensitiveInformation, WaitBlockParametersItem_Context, + WaitBlockParametersItem_Credential, WaitBlockParametersItem_Output, WaitBlockParametersItem_Workflow, ] -update_forward_refs(ContextParameter, WaitBlockParametersItem_Context=WaitBlockParametersItem_Context) update_forward_refs(WaitBlockParametersItem_Context) diff --git a/skyvern/client/types/workflow.py b/skyvern/client/types/workflow.py index 6027c15e..2632be63 100644 --- a/skyvern/client/types/workflow.py +++ b/skyvern/client/types/workflow.py @@ -1,6 +1,5 @@ # 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 .for_loop_block import ForLoopBlock @@ -11,7 +10,6 @@ from .workflow_status import WorkflowStatus import datetime as dt from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -from ..core.pydantic_utilities import update_forward_refs class Workflow(UniversalBaseModel): @@ -41,7 +39,3 @@ class Workflow(UniversalBaseModel): frozen = True smart_union = True extra = pydantic.Extra.allow - - -update_forward_refs(ContextParameter, Workflow=Workflow) -update_forward_refs(ForLoopBlock, Workflow=Workflow) diff --git a/skyvern/client/types/workflow_definition.py b/skyvern/client/types/workflow_definition.py index fb5feca1..ab9117f4 100644 --- a/skyvern/client/types/workflow_definition.py +++ b/skyvern/client/types/workflow_definition.py @@ -1,6 +1,5 @@ # 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 .for_loop_block import ForLoopBlock @@ -9,7 +8,6 @@ from .workflow_definition_parameters_item import WorkflowDefinitionParametersIte from .workflow_definition_blocks_item import WorkflowDefinitionBlocksItem from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -from ..core.pydantic_utilities import update_forward_refs class WorkflowDefinition(UniversalBaseModel): @@ -24,7 +22,3 @@ class WorkflowDefinition(UniversalBaseModel): frozen = True smart_union = True extra = pydantic.Extra.allow - - -update_forward_refs(ContextParameter, WorkflowDefinition=WorkflowDefinition) -update_forward_refs(ForLoopBlock, WorkflowDefinition=WorkflowDefinition) diff --git a/skyvern/client/types/workflow_definition_blocks_item.py b/skyvern/client/types/workflow_definition_blocks_item.py index 7eda2ad1..b24f5e0e 100644 --- a/skyvern/client/types/workflow_definition_blocks_item.py +++ b/skyvern/client/types/workflow_definition_blocks_item.py @@ -14,6 +14,9 @@ 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_storage_type import FileStorageType +import typing_extensions +from ..core.serialization import FieldMetadata from .file_type import FileType from .for_loop_block_loop_over import ForLoopBlockLoopOver from .url_block_data_schema import UrlBlockDataSchema @@ -54,6 +57,7 @@ class WorkflowDefinitionBlocksItem_Action(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -122,6 +126,7 @@ class WorkflowDefinitionBlocksItem_Extraction(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -155,6 +160,29 @@ class WorkflowDefinitionBlocksItem_FileDownload(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: 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 WorkflowDefinitionBlocksItem_FileUpload(UniversalBaseModel): + block_type: typing.Literal["file_upload"] = "file_upload" + label: str + output_parameter: OutputParameter + continue_on_failure: typing.Optional[bool] = None + storage_type: typing.Optional[FileStorageType] = None + s3bucket: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="s3_bucket")] = None + aws_access_key_id: typing.Optional[str] = None + aws_secret_access_key: typing.Optional[str] = None + region_name: typing.Optional[str] = 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 @@ -230,6 +258,7 @@ class WorkflowDefinitionBlocksItem_GotoUrl(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -263,6 +292,7 @@ class WorkflowDefinitionBlocksItem_Login(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -296,6 +326,7 @@ class WorkflowDefinitionBlocksItem_Navigation(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -372,6 +403,7 @@ class WorkflowDefinitionBlocksItem_Task(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -393,6 +425,7 @@ class WorkflowDefinitionBlocksItem_TaskV2(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None max_iterations: typing.Optional[int] = None + max_steps: typing.Optional[int] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -463,6 +496,7 @@ class WorkflowDefinitionBlocksItem_Validation(UniversalBaseModel): totp_verification_url: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None cache_actions: typing.Optional[bool] = None + complete_verification: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -498,6 +532,7 @@ WorkflowDefinitionBlocksItem = typing.Union[ WorkflowDefinitionBlocksItem_DownloadToS3, WorkflowDefinitionBlocksItem_Extraction, WorkflowDefinitionBlocksItem_FileDownload, + WorkflowDefinitionBlocksItem_FileUpload, WorkflowDefinitionBlocksItem_FileUrlParser, WorkflowDefinitionBlocksItem_ForLoop, WorkflowDefinitionBlocksItem_GotoUrl, @@ -512,19 +547,4 @@ WorkflowDefinitionBlocksItem = typing.Union[ WorkflowDefinitionBlocksItem_Validation, WorkflowDefinitionBlocksItem_Wait, ] -update_forward_refs(ContextParameter, WorkflowDefinitionBlocksItem_Action=WorkflowDefinitionBlocksItem_Action) -update_forward_refs(ContextParameter, WorkflowDefinitionBlocksItem_Code=WorkflowDefinitionBlocksItem_Code) -update_forward_refs(ContextParameter, WorkflowDefinitionBlocksItem_Extraction=WorkflowDefinitionBlocksItem_Extraction) -update_forward_refs( - ContextParameter, WorkflowDefinitionBlocksItem_FileDownload=WorkflowDefinitionBlocksItem_FileDownload -) -update_forward_refs(ContextParameter, WorkflowDefinitionBlocksItem_ForLoop=WorkflowDefinitionBlocksItem_ForLoop) -update_forward_refs(ForLoopBlock, WorkflowDefinitionBlocksItem_ForLoop=WorkflowDefinitionBlocksItem_ForLoop) update_forward_refs(WorkflowDefinitionBlocksItem_ForLoop) -update_forward_refs(ContextParameter, WorkflowDefinitionBlocksItem_GotoUrl=WorkflowDefinitionBlocksItem_GotoUrl) -update_forward_refs(ContextParameter, WorkflowDefinitionBlocksItem_Login=WorkflowDefinitionBlocksItem_Login) -update_forward_refs(ContextParameter, WorkflowDefinitionBlocksItem_Navigation=WorkflowDefinitionBlocksItem_Navigation) -update_forward_refs(ContextParameter, WorkflowDefinitionBlocksItem_Task=WorkflowDefinitionBlocksItem_Task) -update_forward_refs(ContextParameter, WorkflowDefinitionBlocksItem_TextPrompt=WorkflowDefinitionBlocksItem_TextPrompt) -update_forward_refs(ContextParameter, WorkflowDefinitionBlocksItem_Validation=WorkflowDefinitionBlocksItem_Validation) -update_forward_refs(ContextParameter, WorkflowDefinitionBlocksItem_Wait=WorkflowDefinitionBlocksItem_Wait) diff --git a/skyvern/client/types/workflow_definition_parameters_item.py b/skyvern/client/types/workflow_definition_parameters_item.py index 1acca593..e8d89342 100644 --- a/skyvern/client/types/workflow_definition_parameters_item.py +++ b/skyvern/client/types/workflow_definition_parameters_item.py @@ -6,7 +6,7 @@ import typing import datetime as dt from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -from .context_parameter_value import ContextParameterValue +from .value import Value from .workflow_parameter_type import WorkflowParameterType from .workflow_parameter_default_value import WorkflowParameterDefaultValue from ..core.pydantic_utilities import update_forward_refs @@ -67,8 +67,9 @@ class WorkflowDefinitionParametersItem_BitwardenLoginCredential(UniversalBaseMod 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 + url_parameter_key: typing.Optional[str] = None bitwarden_collection_id: typing.Optional[str] = None + bitwarden_item_id: typing.Optional[str] = None created_at: dt.datetime modified_at: dt.datetime deleted_at: typing.Optional[dt.datetime] = None @@ -113,8 +114,8 @@ class WorkflowDefinitionParametersItem_Context(UniversalBaseModel): parameter_type: typing.Literal["context"] = "context" key: str description: typing.Optional[str] = None - source: "ContextParameterSource" - value: typing.Optional[ContextParameterValue] = None + source: "Source" + value: typing.Optional[Value] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -127,7 +128,28 @@ class WorkflowDefinitionParametersItem_Context(UniversalBaseModel): from .context_parameter import ContextParameter # noqa: E402 -from .context_parameter_source import ContextParameterSource # noqa: E402 +from .source import Source # noqa: E402 + + +class WorkflowDefinitionParametersItem_Credential(UniversalBaseModel): + parameter_type: typing.Literal["credential"] = "credential" + key: str + description: typing.Optional[str] = None + credential_parameter_id: str + workflow_id: str + credential_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 WorkflowDefinitionParametersItem_Output(UniversalBaseModel): @@ -178,8 +200,8 @@ WorkflowDefinitionParametersItem = typing.Union[ WorkflowDefinitionParametersItem_BitwardenLoginCredential, WorkflowDefinitionParametersItem_BitwardenSensitiveInformation, WorkflowDefinitionParametersItem_Context, + WorkflowDefinitionParametersItem_Credential, WorkflowDefinitionParametersItem_Output, WorkflowDefinitionParametersItem_Workflow, ] -update_forward_refs(ContextParameter, WorkflowDefinitionParametersItem_Context=WorkflowDefinitionParametersItem_Context) update_forward_refs(WorkflowDefinitionParametersItem_Context) diff --git a/skyvern/client/types/workflow_parameter_type.py b/skyvern/client/types/workflow_parameter_type.py index 15948800..f1b98b1a 100644 --- a/skyvern/client/types/workflow_parameter_type.py +++ b/skyvern/client/types/workflow_parameter_type.py @@ -3,5 +3,5 @@ import typing WorkflowParameterType = typing.Union[ - typing.Literal["string", "integer", "float", "boolean", "json", "file_url"], typing.Any + typing.Literal["string", "integer", "float", "boolean", "json", "file_url", "credential_id"], typing.Any ] diff --git a/skyvern/client/types/workflow_run.py b/skyvern/client/types/workflow_run.py index 6b7724e8..de44106a 100644 --- a/skyvern/client/types/workflow_run.py +++ b/skyvern/client/types/workflow_run.py @@ -21,6 +21,7 @@ class WorkflowRun(UniversalBaseModel): totp_identifier: typing.Optional[str] = None failure_reason: typing.Optional[str] = None parent_workflow_run_id: typing.Optional[str] = None + workflow_title: typing.Optional[str] = None created_at: dt.datetime modified_at: dt.datetime diff --git a/skyvern/client/types/workflow_run_block.py b/skyvern/client/types/workflow_run_block.py index b3ee243f..305765c1 100644 --- a/skyvern/client/types/workflow_run_block.py +++ b/skyvern/client/types/workflow_run_block.py @@ -3,7 +3,7 @@ from ..core.pydantic_utilities import UniversalBaseModel import typing from .block_type import BlockType -from .workflow_run_block_output import WorkflowRunBlockOutput +from .output import Output from .workflow_run_block_navigation_payload import WorkflowRunBlockNavigationPayload from .workflow_run_block_data_schema import WorkflowRunBlockDataSchema from .action import Action @@ -22,7 +22,7 @@ class WorkflowRunBlock(UniversalBaseModel): block_type: BlockType label: typing.Optional[str] = None status: typing.Optional[str] = None - output: typing.Optional[WorkflowRunBlockOutput] = None + output: typing.Optional[Output] = None continue_on_failure: typing.Optional[bool] = None failure_reason: typing.Optional[str] = None task_id: typing.Optional[str] = None diff --git a/skyvern/client/types/workflow_run_status_response.py b/skyvern/client/types/workflow_run_response.py similarity index 86% rename from skyvern/client/types/workflow_run_status_response.py rename to skyvern/client/types/workflow_run_response.py index ea76b68b..c72242a5 100644 --- a/skyvern/client/types/workflow_run_status_response.py +++ b/skyvern/client/types/workflow_run_response.py @@ -5,7 +5,8 @@ from .workflow_run_status import WorkflowRunStatus import typing from .proxy_location import ProxyLocation import datetime as dt -from .observer_task import ObserverTask +from .file_info import FileInfo +from .task_v2 import TaskV2 from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic @@ -24,11 +25,13 @@ class WorkflowRunResponse(UniversalBaseModel): parameters: typing.Dict[str, typing.Optional[typing.Any]] screenshot_urls: typing.Optional[typing.List[str]] = None recording_url: typing.Optional[str] = None + downloaded_files: typing.Optional[typing.List[FileInfo]] = None downloaded_file_urls: typing.Optional[typing.List[str]] = None outputs: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None total_steps: typing.Optional[int] = None total_cost: typing.Optional[float] = None - observer_task: typing.Optional[ObserverTask] = None + task_v2: typing.Optional[TaskV2] = None + workflow_title: typing.Optional[str] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/skyvern/client/types/workflow_run_timeline.py b/skyvern/client/types/workflow_run_timeline.py index c9535200..0e09e458 100644 --- a/skyvern/client/types/workflow_run_timeline.py +++ b/skyvern/client/types/workflow_run_timeline.py @@ -5,7 +5,7 @@ from ..core.pydantic_utilities import UniversalBaseModel from .workflow_run_timeline_type import WorkflowRunTimelineType import typing from .workflow_run_block import WorkflowRunBlock -from .observer_thought import ObserverThought +from .thought import Thought import datetime as dt from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic @@ -15,7 +15,7 @@ from ..core.pydantic_utilities import update_forward_refs class WorkflowRunTimeline(UniversalBaseModel): type: WorkflowRunTimelineType block: typing.Optional[WorkflowRunBlock] = None - thought: typing.Optional[ObserverThought] = None + thought: typing.Optional[Thought] = None children: typing.Optional[typing.List["WorkflowRunTimeline"]] = None created_at: dt.datetime modified_at: dt.datetime