Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.11.3"
".": "0.11.4"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 50
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-5ee2116982adf46664acf84b8ba4b56ba65780983506c63d9b005dab49def757.yml
openapi_spec_hash: 42a3a519301d0e2bb2b5a71018915b55
config_hash: 0d150b61cae2dc57d3648ceae7784966
configured_endpoints: 51
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-8b5a722e4964d2d1dcdc34afccb6d742e1c927cbbd622264c8734f132e31a0f5.yml
openapi_spec_hash: ed101ff177c2e962653ca65acf939336
config_hash: 49c2ff978aaa5ccb4ce324a72f116010
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.11.4 (2025-09-25)

Full Changelog: [v0.11.3...v0.11.4](https://github.com/onkernel/kernel-python-sdk/compare/v0.11.3...v0.11.4)

### Features

* getInvocations endpoint ([bb39872](https://github.com/onkernel/kernel-python-sdk/commit/bb39872703bd6ace1e588a54420f29a62140144b))

## 0.11.3 (2025-09-24)

Full Changelog: [v0.11.2...v0.11.3](https://github.com/onkernel/kernel-python-sdk/compare/v0.11.2...v0.11.3)
Expand Down
2 changes: 2 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ from kernel.types import (
InvocationCreateResponse,
InvocationRetrieveResponse,
InvocationUpdateResponse,
InvocationListResponse,
InvocationFollowResponse,
)
```
Expand All @@ -56,6 +57,7 @@ Methods:
- <code title="post /invocations">client.invocations.<a href="./src/kernel/resources/invocations.py">create</a>(\*\*<a href="src/kernel/types/invocation_create_params.py">params</a>) -> <a href="./src/kernel/types/invocation_create_response.py">InvocationCreateResponse</a></code>
- <code title="get /invocations/{id}">client.invocations.<a href="./src/kernel/resources/invocations.py">retrieve</a>(id) -> <a href="./src/kernel/types/invocation_retrieve_response.py">InvocationRetrieveResponse</a></code>
- <code title="patch /invocations/{id}">client.invocations.<a href="./src/kernel/resources/invocations.py">update</a>(id, \*\*<a href="src/kernel/types/invocation_update_params.py">params</a>) -> <a href="./src/kernel/types/invocation_update_response.py">InvocationUpdateResponse</a></code>
- <code title="get /invocations">client.invocations.<a href="./src/kernel/resources/invocations.py">list</a>(\*\*<a href="src/kernel/types/invocation_list_params.py">params</a>) -> <a href="./src/kernel/types/invocation_list_response.py">SyncOffsetPagination[InvocationListResponse]</a></code>
- <code title="delete /invocations/{id}/browsers">client.invocations.<a href="./src/kernel/resources/invocations.py">delete_browsers</a>(id) -> None</code>
- <code title="get /invocations/{id}/events">client.invocations.<a href="./src/kernel/resources/invocations.py">follow</a>(id, \*\*<a href="src/kernel/types/invocation_follow_params.py">params</a>) -> <a href="./src/kernel/types/invocation_follow_response.py">InvocationFollowResponse</a></code>

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "kernel"
version = "0.11.3"
version = "0.11.4"
description = "The official Python library for the kernel API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "kernel"
__version__ = "0.11.3" # x-release-please-version
__version__ = "0.11.4" # x-release-please-version
158 changes: 156 additions & 2 deletions src/kernel/resources/invocations.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import httpx

from ..types import invocation_create_params, invocation_follow_params, invocation_update_params
from ..types import invocation_list_params, invocation_create_params, invocation_follow_params, invocation_update_params
from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
Expand All @@ -19,7 +19,9 @@
async_to_streamed_response_wrapper,
)
from .._streaming import Stream, AsyncStream
from .._base_client import make_request_options
from ..pagination import SyncOffsetPagination, AsyncOffsetPagination
from .._base_client import AsyncPaginator, make_request_options
from ..types.invocation_list_response import InvocationListResponse
from ..types.invocation_create_response import InvocationCreateResponse
from ..types.invocation_follow_response import InvocationFollowResponse
from ..types.invocation_update_response import InvocationUpdateResponse
Expand Down Expand Up @@ -185,6 +187,76 @@ def update(
cast_to=InvocationUpdateResponse,
)

def list(
self,
*,
action_name: str | Omit = omit,
app_name: str | Omit = omit,
deployment_id: str | Omit = omit,
limit: int | Omit = omit,
offset: int | Omit = omit,
since: str | Omit = omit,
status: Literal["queued", "running", "succeeded", "failed"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncOffsetPagination[InvocationListResponse]:
"""List invocations.

Optionally filter by application name, action name, status,
deployment ID, or start time.

Args:
action_name: Filter results by action name.

app_name: Filter results by application name.

deployment_id: Filter results by deployment ID.

limit: Limit the number of invocations to return.

offset: Offset the number of invocations to return.

since: Show invocations that have started since the given time (RFC timestamps or
durations like 5m).

status: Filter results by invocation status.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return self._get_api_list(
"/invocations",
page=SyncOffsetPagination[InvocationListResponse],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{
"action_name": action_name,
"app_name": app_name,
"deployment_id": deployment_id,
"limit": limit,
"offset": offset,
"since": since,
"status": status,
},
invocation_list_params.InvocationListParams,
),
),
model=InvocationListResponse,
)

def delete_browsers(
self,
id: str,
Expand Down Expand Up @@ -424,6 +496,76 @@ async def update(
cast_to=InvocationUpdateResponse,
)

def list(
self,
*,
action_name: str | Omit = omit,
app_name: str | Omit = omit,
deployment_id: str | Omit = omit,
limit: int | Omit = omit,
offset: int | Omit = omit,
since: str | Omit = omit,
status: Literal["queued", "running", "succeeded", "failed"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[InvocationListResponse, AsyncOffsetPagination[InvocationListResponse]]:
"""List invocations.

Optionally filter by application name, action name, status,
deployment ID, or start time.

Args:
action_name: Filter results by action name.

app_name: Filter results by application name.

deployment_id: Filter results by deployment ID.

limit: Limit the number of invocations to return.

offset: Offset the number of invocations to return.

since: Show invocations that have started since the given time (RFC timestamps or
durations like 5m).

status: Filter results by invocation status.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return self._get_api_list(
"/invocations",
page=AsyncOffsetPagination[InvocationListResponse],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{
"action_name": action_name,
"app_name": app_name,
"deployment_id": deployment_id,
"limit": limit,
"offset": offset,
"since": since,
"status": status,
},
invocation_list_params.InvocationListParams,
),
),
model=InvocationListResponse,
)

async def delete_browsers(
self,
id: str,
Expand Down Expand Up @@ -519,6 +661,9 @@ def __init__(self, invocations: InvocationsResource) -> None:
self.update = to_raw_response_wrapper(
invocations.update,
)
self.list = to_raw_response_wrapper(
invocations.list,
)
self.delete_browsers = to_raw_response_wrapper(
invocations.delete_browsers,
)
Expand All @@ -540,6 +685,9 @@ def __init__(self, invocations: AsyncInvocationsResource) -> None:
self.update = async_to_raw_response_wrapper(
invocations.update,
)
self.list = async_to_raw_response_wrapper(
invocations.list,
)
self.delete_browsers = async_to_raw_response_wrapper(
invocations.delete_browsers,
)
Expand All @@ -561,6 +709,9 @@ def __init__(self, invocations: InvocationsResource) -> None:
self.update = to_streamed_response_wrapper(
invocations.update,
)
self.list = to_streamed_response_wrapper(
invocations.list,
)
self.delete_browsers = to_streamed_response_wrapper(
invocations.delete_browsers,
)
Expand All @@ -582,6 +733,9 @@ def __init__(self, invocations: AsyncInvocationsResource) -> None:
self.update = async_to_streamed_response_wrapper(
invocations.update,
)
self.list = async_to_streamed_response_wrapper(
invocations.list,
)
self.delete_browsers = async_to_streamed_response_wrapper(
invocations.delete_browsers,
)
Expand Down
2 changes: 2 additions & 0 deletions src/kernel/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from .proxy_create_response import ProxyCreateResponse as ProxyCreateResponse
from .deployment_list_params import DeploymentListParams as DeploymentListParams
from .deployment_state_event import DeploymentStateEvent as DeploymentStateEvent
from .invocation_list_params import InvocationListParams as InvocationListParams
from .invocation_state_event import InvocationStateEvent as InvocationStateEvent
from .browser_create_response import BrowserCreateResponse as BrowserCreateResponse
from .proxy_retrieve_response import ProxyRetrieveResponse as ProxyRetrieveResponse
Expand All @@ -32,6 +33,7 @@
from .deployment_list_response import DeploymentListResponse as DeploymentListResponse
from .invocation_create_params import InvocationCreateParams as InvocationCreateParams
from .invocation_follow_params import InvocationFollowParams as InvocationFollowParams
from .invocation_list_response import InvocationListResponse as InvocationListResponse
from .invocation_update_params import InvocationUpdateParams as InvocationUpdateParams
from .browser_persistence_param import BrowserPersistenceParam as BrowserPersistenceParam
from .browser_retrieve_response import BrowserRetrieveResponse as BrowserRetrieveResponse
Expand Down
33 changes: 33 additions & 0 deletions src/kernel/types/invocation_list_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import Literal, TypedDict

__all__ = ["InvocationListParams"]


class InvocationListParams(TypedDict, total=False):
action_name: str
"""Filter results by action name."""

app_name: str
"""Filter results by application name."""

deployment_id: str
"""Filter results by deployment ID."""

limit: int
"""Limit the number of invocations to return."""

offset: int
"""Offset the number of invocations to return."""

since: str
"""
Show invocations that have started since the given time (RFC timestamps or
durations like 5m).
"""

status: Literal["queued", "running", "succeeded", "failed"]
"""Filter results by invocation status."""
47 changes: 47 additions & 0 deletions src/kernel/types/invocation_list_response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional
from datetime import datetime
from typing_extensions import Literal

from .._models import BaseModel

__all__ = ["InvocationListResponse"]


class InvocationListResponse(BaseModel):
id: str
"""ID of the invocation"""

action_name: str
"""Name of the action invoked"""

app_name: str
"""Name of the application"""

started_at: datetime
"""RFC 3339 Nanoseconds timestamp when the invocation started"""

status: Literal["queued", "running", "succeeded", "failed"]
"""Status of the invocation"""

finished_at: Optional[datetime] = None
"""
RFC 3339 Nanoseconds timestamp when the invocation finished (null if still
running)
"""

output: Optional[str] = None
"""Output produced by the action, rendered as a JSON string.

This could be: string, number, boolean, array, object, or null.
"""

payload: Optional[str] = None
"""Payload provided to the invocation.

This is a string that can be parsed as JSON.
"""

status_reason: Optional[str] = None
"""Status reason"""
Loading