Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/invoke.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ You can invoke your app by making a `POST` request to Kernel's API or via the CL

For long running jobs, use asynchronous invocations to trigger Kernel actions without waiting for the result. You can then poll its [status](/apps/status) for the result.

<Info>Asynchronous invocations time out after 15 minutes.</Info>

<AsyncInvocation />

## Via CLI
Expand Down
2 changes: 1 addition & 1 deletion reference/cli/apps.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Invoke a specific app action by its name. Generates an Invocation.
| `--payload <payload_data>`, `-p` | Stringified JSON object (max 64 KB). Optional. |
| `--sync`, `-s` | Invoke synchronously (default false). Optional. |

<Info>Synchronous invocations open a long-lived HTTP POST that times out after 60 seconds. Press `ctrl-c` to terminate a running invocation; associated browsers are destroyed.</Info>
<Info>Synchronous invocations open a long-lived HTTP POST that times out after 60 seconds. Asynchronous invocations time out after 15 minutes. Press `ctrl-c` to terminate a running invocation; associated browsers are destroyed.</Info>

## `kernel app list`
List deployed application versions.
Expand Down
12 changes: 7 additions & 5 deletions snippets/openapi/get-deployments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ const client = new Kernel({
apiKey: 'My API Key',
});

const deployments = await client.deployments.list();

console.log(deployments);
// Automatically fetches more pages as needed.
for await (const deploymentListResponse of client.deployments.list()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Medium Logic

The code change appears inconsistent with other list API examples in this project. The for await...of loop assumes the client returns an async iterator, but other examples (like get-browsers.mdx, get-apps.mdx, get-profiles.mdx) use a simple await client.resource.list() pattern. This change breaks the consistency unless the deployments API specifically behaves differently from other list endpoints. Please verify this API behavior and ensure consistency across all list examples.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the issue with making changes to this and is if we regenerate this, it'll be overwritten.

I think this auto-generated snippet list may be overkill and we may just revert back to manually written code snippets. It seems difficult to use and we have more custom code we write on our docs than the snippets we use...

console.log(deploymentListResponse.id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Medium Logic

Accessing deploymentListResponse.id assumes each item in the iterator has an id property, but this should be deploymentListResponse represents individual deployment objects. The variable name suggests this might be a response object rather than a deployment. Consider renaming to deployment for clarity and verify the correct property access pattern.

}
```


Expand All @@ -18,7 +19,8 @@ from kernel import Kernel
client = Kernel(
api_key="My API Key",
)
deployments = client.deployments.list()
print(deployments)
page = client.deployments.list()
page = page.items[0]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Medium Logic

The Python example has a logic error. Line 22 assigns the result of client.deployments.list() to page, but line 23 reassigns page to page.items[0] (assuming it's a paginated response with an items array). This overwrites the page object with a single item. If the goal is to access the first deployment's ID, this should be two separate variables: page = client.deployments.list() and deployment = page.items[0], then print(deployment.id).

print(page.id)
```
</CodeGroup>