mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2026-04-29 12:10:28 +00:00
91 lines
2.5 KiB
Text
91 lines
2.5 KiB
Text
---
|
|
title: "get_run_artifacts"
|
|
slug: sdk-reference/tasks/get-run-artifacts
|
|
---
|
|
|
|
Get all artifacts (screenshots, recordings, generated code, etc.) for a run.
|
|
|
|
<CodeGroup>
|
|
```python Python
|
|
artifacts = await client.get_run_artifacts("tsk_v2_486305187432193504")
|
|
for artifact in artifacts:
|
|
print(f"{artifact.artifact_type}: {artifact.uri}")
|
|
```
|
|
|
|
```typescript TypeScript
|
|
const artifacts = await skyvern.getRunArtifacts("tsk_v2_486305187432193504");
|
|
for (const artifact of artifacts) {
|
|
console.log(`${artifact.artifact_type}: ${artifact.uri}`);
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
Filter by type to get specific artifacts:
|
|
|
|
<CodeGroup>
|
|
```python Python
|
|
# Get only the generated Playwright scripts
|
|
scripts = await client.get_run_artifacts(
|
|
"tsk_v2_486305187432193504",
|
|
artifact_type=["script_file"],
|
|
)
|
|
```
|
|
|
|
```typescript TypeScript
|
|
const scripts = await skyvern.getRunArtifacts(
|
|
"tsk_v2_486305187432193504",
|
|
{ artifact_type: ["script_file"] },
|
|
);
|
|
```
|
|
</CodeGroup>
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
|-----------|------|----------|-------------|
|
|
| `run_id` | `str` | Yes | The run ID. |
|
|
| `artifact_type` | `ArtifactType \| list[ArtifactType]` | No | Filter by artifact type. |
|
|
| `request_options` | `RequestOptions` | No | Per-request configuration (see below). |
|
|
|
|
### Returns `list[Artifact]`
|
|
|
|
---
|
|
|
|
### Request options
|
|
|
|
|
|
Override timeout, retries, or headers for this call by passing `request_options` (Python) or a second options argument (TypeScript).
|
|
|
|
<CodeGroup>
|
|
```python Python
|
|
from skyvern.client.core import RequestOptions
|
|
|
|
request_options=RequestOptions(
|
|
timeout_in_seconds=120,
|
|
max_retries=3,
|
|
additional_headers={"x-custom-header": "value"},
|
|
)
|
|
```
|
|
|
|
```typescript TypeScript
|
|
// Pass as second argument to any method
|
|
{
|
|
timeoutInSeconds: 120,
|
|
maxRetries: 3,
|
|
headers: { "x-custom-header": "value" },
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
| Option (Python) | Option (TypeScript) | Type | Description |
|
|
|-----------------|---------------------|------|-------------|
|
|
| `timeout_in_seconds` | `timeoutInSeconds` | `int` / `number` | HTTP timeout in seconds. |
|
|
| `max_retries` | `maxRetries` | `int` / `number` | Retry count. |
|
|
| `additional_headers` | `headers` | `dict` / `Record<string, string>` | Extra headers. |
|
|
| `additional_query_parameters` | - | `dict` | Extra query parameters. |
|
|
| `additional_body_parameters` | - | `dict` | Extra body parameters. |
|
|
| - | `abortSignal` | `AbortSignal` | Signal to cancel the request. |
|
|
| - | `apiKey` | `string` | Override API key. |
|
|
|
|
|
|
---
|