Skip to content

Commit bcf0e4f

Browse files
feat: Add App Version to Invocation and add filtering on App Version
1 parent 044e1ee commit bcf0e4f

File tree

8 files changed

+27
-2
lines changed

8 files changed

+27
-2
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 51
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-bfdb7e3d38870a8ba1628f4f83a3a719d470bf4f7fbecb67a6fad110447c9b6a.yml
3-
openapi_spec_hash: fed29c80f9c25f8a7216b8c6de2051ab
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-da8bfd5cfb5a6d9ccb7e4edd123b49284f4eccb32fc9b6fb7165548535122e12.yml
3+
openapi_spec_hash: fd6ded34689331831b5c077f71b5f08f
44
config_hash: 49c2ff978aaa5ccb4ce324a72f116010

src/kernel/resources/invocations.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ def list(
197197
offset: int | Omit = omit,
198198
since: str | Omit = omit,
199199
status: Literal["queued", "running", "succeeded", "failed"] | Omit = omit,
200+
version: str | Omit = omit,
200201
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
201202
# The extra values given here take precedence over values defined on the client or passed to this method.
202203
extra_headers: Headers | None = None,
@@ -225,6 +226,8 @@ def list(
225226
226227
status: Filter results by invocation status.
227228
229+
version: Filter results by application version.
230+
228231
extra_headers: Send extra headers
229232
230233
extra_query: Add additional query parameters to the request
@@ -250,6 +253,7 @@ def list(
250253
"offset": offset,
251254
"since": since,
252255
"status": status,
256+
"version": version,
253257
},
254258
invocation_list_params.InvocationListParams,
255259
),
@@ -506,6 +510,7 @@ def list(
506510
offset: int | Omit = omit,
507511
since: str | Omit = omit,
508512
status: Literal["queued", "running", "succeeded", "failed"] | Omit = omit,
513+
version: str | Omit = omit,
509514
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
510515
# The extra values given here take precedence over values defined on the client or passed to this method.
511516
extra_headers: Headers | None = None,
@@ -534,6 +539,8 @@ def list(
534539
535540
status: Filter results by invocation status.
536541
542+
version: Filter results by application version.
543+
537544
extra_headers: Send extra headers
538545
539546
extra_query: Add additional query parameters to the request
@@ -559,6 +566,7 @@ def list(
559566
"offset": offset,
560567
"since": since,
561568
"status": status,
569+
"version": version,
562570
},
563571
invocation_list_params.InvocationListParams,
564572
),

src/kernel/types/invocation_list_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ class InvocationListParams(TypedDict, total=False):
3131

3232
status: Literal["queued", "running", "succeeded", "failed"]
3333
"""Filter results by invocation status."""
34+
35+
version: str
36+
"""Filter results by application version."""

src/kernel/types/invocation_list_response.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ class InvocationListResponse(BaseModel):
2525
status: Literal["queued", "running", "succeeded", "failed"]
2626
"""Status of the invocation"""
2727

28+
version: str
29+
"""Version label for the application"""
30+
2831
finished_at: Optional[datetime] = None
2932
"""
3033
RFC 3339 Nanoseconds timestamp when the invocation finished (null if still

src/kernel/types/invocation_retrieve_response.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ class InvocationRetrieveResponse(BaseModel):
2525
status: Literal["queued", "running", "succeeded", "failed"]
2626
"""Status of the invocation"""
2727

28+
version: str
29+
"""Version label for the application"""
30+
2831
finished_at: Optional[datetime] = None
2932
"""
3033
RFC 3339 Nanoseconds timestamp when the invocation finished (null if still

src/kernel/types/invocation_state_event.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ class Invocation(BaseModel):
2525
status: Literal["queued", "running", "succeeded", "failed"]
2626
"""Status of the invocation"""
2727

28+
version: str
29+
"""Version label for the application"""
30+
2831
finished_at: Optional[datetime] = None
2932
"""
3033
RFC 3339 Nanoseconds timestamp when the invocation finished (null if still

src/kernel/types/invocation_update_response.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ class InvocationUpdateResponse(BaseModel):
2525
status: Literal["queued", "running", "succeeded", "failed"]
2626
"""Status of the invocation"""
2727

28+
version: str
29+
"""Version label for the application"""
30+
2831
finished_at: Optional[datetime] = None
2932
"""
3033
RFC 3339 Nanoseconds timestamp when the invocation finished (null if still

tests/api_resources/test_invocations.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ def test_method_list_with_all_params(self, client: Kernel) -> None:
190190
offset=0,
191191
since="2025-06-20T12:00:00Z",
192192
status="queued",
193+
version="version",
193194
)
194195
assert_matches_type(SyncOffsetPagination[InvocationListResponse], invocation, path=["response"])
195196

@@ -480,6 +481,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncKernel) -> N
480481
offset=0,
481482
since="2025-06-20T12:00:00Z",
482483
status="queued",
484+
version="version",
483485
)
484486
assert_matches_type(AsyncOffsetPagination[InvocationListResponse], invocation, path=["response"])
485487

0 commit comments

Comments
 (0)