From 99057fdc74bafdf54479674ba75b447cd4681cb6 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 5 Feb 2026 21:21:18 +0000
Subject: [PATCH 1/2] feat!: improve consistency of post-training API endpoints
---
.stats.yml | 6 +-
api.md | 6 +-
.../resources/alpha/post_training/job.py | 120 ++++++++++++++++--
.../alpha/post_training/test_job.py | 114 ++++++++++++++---
4 files changed, 210 insertions(+), 36 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 48be7ae8..88fc8a23 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 108
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/llamastack%2Fllama-stack-client-958e990011d6b4c27513743a151ec4c80c3103650a80027380d15f1d6b108e32.yml
-openapi_spec_hash: 5b49d825dbc2a26726ca752914a65114
-config_hash: 19b84a0a93d566334ae134dafc71991f
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/llamastack%2Fllama-stack-client-7082771a4cef842834c167a755a9eafb9e9f412349e06abae9ee0331adcc8c49.yml
+openapi_spec_hash: 711015fd57cb31962ee3683ea7dafe32
+config_hash: 07e70c7f1980785685ea4f2618dfde62
diff --git a/api.md b/api.md
index 172529a0..e4ada90b 100644
--- a/api.md
+++ b/api.md
@@ -474,9 +474,9 @@ from llama_stack_client.types.alpha.post_training import (
Methods:
- client.alpha.post_training.job.list() -> JobListResponse
-- client.alpha.post_training.job.artifacts() -> JobArtifactsResponse
-- client.alpha.post_training.job.cancel() -> None
-- client.alpha.post_training.job.status() -> JobStatusResponse
+- client.alpha.post_training.job.artifacts(job_uuid) -> JobArtifactsResponse
+- client.alpha.post_training.job.cancel(job_uuid) -> None
+- client.alpha.post_training.job.status(job_uuid) -> JobStatusResponse
## Benchmarks
diff --git a/src/llama_stack_client/resources/alpha/post_training/job.py b/src/llama_stack_client/resources/alpha/post_training/job.py
index db72ec67..cf949615 100644
--- a/src/llama_stack_client/resources/alpha/post_training/job.py
+++ b/src/llama_stack_client/resources/alpha/post_training/job.py
@@ -75,6 +75,7 @@ def list(
def artifacts(
self,
+ job_uuid: str,
*,
# 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.
@@ -83,9 +84,24 @@ def artifacts(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> JobArtifactsResponse:
- """Get the artifacts of a training job."""
+ """
+ Get the artifacts of a training job.
+
+ Args:
+ job_uuid: The UUID of the job to get the artifacts of.
+
+ 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
+ """
+ if not job_uuid:
+ raise ValueError(f"Expected a non-empty value for `job_uuid` but received {job_uuid!r}")
return self._get(
- "/v1alpha/post-training/job/artifacts",
+ f"/v1alpha/post-training/jobs/{job_uuid}/artifacts",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -94,6 +110,7 @@ def artifacts(
def cancel(
self,
+ job_uuid: str,
*,
# 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.
@@ -102,10 +119,25 @@ def cancel(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> None:
- """Cancel a training job."""
+ """
+ Cancel a training job.
+
+ Args:
+ job_uuid: The UUID of the job to cancel.
+
+ 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
+ """
+ if not job_uuid:
+ raise ValueError(f"Expected a non-empty value for `job_uuid` but received {job_uuid!r}")
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return self._post(
- "/v1alpha/post-training/job/cancel",
+ f"/v1alpha/post-training/jobs/{job_uuid}/cancel",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -114,6 +146,7 @@ def cancel(
def status(
self,
+ job_uuid: str,
*,
# 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.
@@ -122,9 +155,24 @@ def status(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> JobStatusResponse:
- """Get the status of a training job."""
+ """
+ Get the status of a training job.
+
+ Args:
+ job_uuid: The UUID of the job to get the status of.
+
+ 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
+ """
+ if not job_uuid:
+ raise ValueError(f"Expected a non-empty value for `job_uuid` but received {job_uuid!r}")
return self._get(
- "/v1alpha/post-training/job/status",
+ f"/v1alpha/post-training/jobs/{job_uuid}/status",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -177,6 +225,7 @@ async def list(
async def artifacts(
self,
+ job_uuid: str,
*,
# 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.
@@ -185,9 +234,24 @@ async def artifacts(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> JobArtifactsResponse:
- """Get the artifacts of a training job."""
+ """
+ Get the artifacts of a training job.
+
+ Args:
+ job_uuid: The UUID of the job to get the artifacts of.
+
+ 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
+ """
+ if not job_uuid:
+ raise ValueError(f"Expected a non-empty value for `job_uuid` but received {job_uuid!r}")
return await self._get(
- "/v1alpha/post-training/job/artifacts",
+ f"/v1alpha/post-training/jobs/{job_uuid}/artifacts",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -196,6 +260,7 @@ async def artifacts(
async def cancel(
self,
+ job_uuid: str,
*,
# 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.
@@ -204,10 +269,25 @@ async def cancel(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> None:
- """Cancel a training job."""
+ """
+ Cancel a training job.
+
+ Args:
+ job_uuid: The UUID of the job to cancel.
+
+ 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
+ """
+ if not job_uuid:
+ raise ValueError(f"Expected a non-empty value for `job_uuid` but received {job_uuid!r}")
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return await self._post(
- "/v1alpha/post-training/job/cancel",
+ f"/v1alpha/post-training/jobs/{job_uuid}/cancel",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -216,6 +296,7 @@ async def cancel(
async def status(
self,
+ job_uuid: str,
*,
# 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.
@@ -224,9 +305,24 @@ async def status(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> JobStatusResponse:
- """Get the status of a training job."""
+ """
+ Get the status of a training job.
+
+ Args:
+ job_uuid: The UUID of the job to get the status of.
+
+ 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
+ """
+ if not job_uuid:
+ raise ValueError(f"Expected a non-empty value for `job_uuid` but received {job_uuid!r}")
return await self._get(
- "/v1alpha/post-training/job/status",
+ f"/v1alpha/post-training/jobs/{job_uuid}/status",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
diff --git a/tests/api_resources/alpha/post_training/test_job.py b/tests/api_resources/alpha/post_training/test_job.py
index 7d56b7f0..8bf91c22 100644
--- a/tests/api_resources/alpha/post_training/test_job.py
+++ b/tests/api_resources/alpha/post_training/test_job.py
@@ -50,12 +50,16 @@ def test_streaming_response_list(self, client: LlamaStackClient) -> None:
@parametrize
def test_method_artifacts(self, client: LlamaStackClient) -> None:
- job = client.alpha.post_training.job.artifacts()
+ job = client.alpha.post_training.job.artifacts(
+ "job_uuid",
+ )
assert_matches_type(JobArtifactsResponse, job, path=["response"])
@parametrize
def test_raw_response_artifacts(self, client: LlamaStackClient) -> None:
- response = client.alpha.post_training.job.with_raw_response.artifacts()
+ response = client.alpha.post_training.job.with_raw_response.artifacts(
+ "job_uuid",
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -64,7 +68,9 @@ def test_raw_response_artifacts(self, client: LlamaStackClient) -> None:
@parametrize
def test_streaming_response_artifacts(self, client: LlamaStackClient) -> None:
- with client.alpha.post_training.job.with_streaming_response.artifacts() as response:
+ with client.alpha.post_training.job.with_streaming_response.artifacts(
+ "job_uuid",
+ ) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -73,14 +79,25 @@ def test_streaming_response_artifacts(self, client: LlamaStackClient) -> None:
assert cast(Any, response.is_closed) is True
+ @parametrize
+ def test_path_params_artifacts(self, client: LlamaStackClient) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_uuid` but received ''"):
+ client.alpha.post_training.job.with_raw_response.artifacts(
+ "",
+ )
+
@parametrize
def test_method_cancel(self, client: LlamaStackClient) -> None:
- job = client.alpha.post_training.job.cancel()
+ job = client.alpha.post_training.job.cancel(
+ "job_uuid",
+ )
assert job is None
@parametrize
def test_raw_response_cancel(self, client: LlamaStackClient) -> None:
- response = client.alpha.post_training.job.with_raw_response.cancel()
+ response = client.alpha.post_training.job.with_raw_response.cancel(
+ "job_uuid",
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -89,7 +106,9 @@ def test_raw_response_cancel(self, client: LlamaStackClient) -> None:
@parametrize
def test_streaming_response_cancel(self, client: LlamaStackClient) -> None:
- with client.alpha.post_training.job.with_streaming_response.cancel() as response:
+ with client.alpha.post_training.job.with_streaming_response.cancel(
+ "job_uuid",
+ ) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -98,14 +117,25 @@ def test_streaming_response_cancel(self, client: LlamaStackClient) -> None:
assert cast(Any, response.is_closed) is True
+ @parametrize
+ def test_path_params_cancel(self, client: LlamaStackClient) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_uuid` but received ''"):
+ client.alpha.post_training.job.with_raw_response.cancel(
+ "",
+ )
+
@parametrize
def test_method_status(self, client: LlamaStackClient) -> None:
- job = client.alpha.post_training.job.status()
+ job = client.alpha.post_training.job.status(
+ "job_uuid",
+ )
assert_matches_type(JobStatusResponse, job, path=["response"])
@parametrize
def test_raw_response_status(self, client: LlamaStackClient) -> None:
- response = client.alpha.post_training.job.with_raw_response.status()
+ response = client.alpha.post_training.job.with_raw_response.status(
+ "job_uuid",
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -114,7 +144,9 @@ def test_raw_response_status(self, client: LlamaStackClient) -> None:
@parametrize
def test_streaming_response_status(self, client: LlamaStackClient) -> None:
- with client.alpha.post_training.job.with_streaming_response.status() as response:
+ with client.alpha.post_training.job.with_streaming_response.status(
+ "job_uuid",
+ ) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -123,6 +155,13 @@ def test_streaming_response_status(self, client: LlamaStackClient) -> None:
assert cast(Any, response.is_closed) is True
+ @parametrize
+ def test_path_params_status(self, client: LlamaStackClient) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_uuid` but received ''"):
+ client.alpha.post_training.job.with_raw_response.status(
+ "",
+ )
+
class TestAsyncJob:
parametrize = pytest.mark.parametrize(
@@ -156,12 +195,16 @@ async def test_streaming_response_list(self, async_client: AsyncLlamaStackClient
@parametrize
async def test_method_artifacts(self, async_client: AsyncLlamaStackClient) -> None:
- job = await async_client.alpha.post_training.job.artifacts()
+ job = await async_client.alpha.post_training.job.artifacts(
+ "job_uuid",
+ )
assert_matches_type(JobArtifactsResponse, job, path=["response"])
@parametrize
async def test_raw_response_artifacts(self, async_client: AsyncLlamaStackClient) -> None:
- response = await async_client.alpha.post_training.job.with_raw_response.artifacts()
+ response = await async_client.alpha.post_training.job.with_raw_response.artifacts(
+ "job_uuid",
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -170,7 +213,9 @@ async def test_raw_response_artifacts(self, async_client: AsyncLlamaStackClient)
@parametrize
async def test_streaming_response_artifacts(self, async_client: AsyncLlamaStackClient) -> None:
- async with async_client.alpha.post_training.job.with_streaming_response.artifacts() as response:
+ async with async_client.alpha.post_training.job.with_streaming_response.artifacts(
+ "job_uuid",
+ ) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -179,14 +224,25 @@ async def test_streaming_response_artifacts(self, async_client: AsyncLlamaStackC
assert cast(Any, response.is_closed) is True
+ @parametrize
+ async def test_path_params_artifacts(self, async_client: AsyncLlamaStackClient) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_uuid` but received ''"):
+ await async_client.alpha.post_training.job.with_raw_response.artifacts(
+ "",
+ )
+
@parametrize
async def test_method_cancel(self, async_client: AsyncLlamaStackClient) -> None:
- job = await async_client.alpha.post_training.job.cancel()
+ job = await async_client.alpha.post_training.job.cancel(
+ "job_uuid",
+ )
assert job is None
@parametrize
async def test_raw_response_cancel(self, async_client: AsyncLlamaStackClient) -> None:
- response = await async_client.alpha.post_training.job.with_raw_response.cancel()
+ response = await async_client.alpha.post_training.job.with_raw_response.cancel(
+ "job_uuid",
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -195,7 +251,9 @@ async def test_raw_response_cancel(self, async_client: AsyncLlamaStackClient) ->
@parametrize
async def test_streaming_response_cancel(self, async_client: AsyncLlamaStackClient) -> None:
- async with async_client.alpha.post_training.job.with_streaming_response.cancel() as response:
+ async with async_client.alpha.post_training.job.with_streaming_response.cancel(
+ "job_uuid",
+ ) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -204,14 +262,25 @@ async def test_streaming_response_cancel(self, async_client: AsyncLlamaStackClie
assert cast(Any, response.is_closed) is True
+ @parametrize
+ async def test_path_params_cancel(self, async_client: AsyncLlamaStackClient) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_uuid` but received ''"):
+ await async_client.alpha.post_training.job.with_raw_response.cancel(
+ "",
+ )
+
@parametrize
async def test_method_status(self, async_client: AsyncLlamaStackClient) -> None:
- job = await async_client.alpha.post_training.job.status()
+ job = await async_client.alpha.post_training.job.status(
+ "job_uuid",
+ )
assert_matches_type(JobStatusResponse, job, path=["response"])
@parametrize
async def test_raw_response_status(self, async_client: AsyncLlamaStackClient) -> None:
- response = await async_client.alpha.post_training.job.with_raw_response.status()
+ response = await async_client.alpha.post_training.job.with_raw_response.status(
+ "job_uuid",
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -220,7 +289,9 @@ async def test_raw_response_status(self, async_client: AsyncLlamaStackClient) ->
@parametrize
async def test_streaming_response_status(self, async_client: AsyncLlamaStackClient) -> None:
- async with async_client.alpha.post_training.job.with_streaming_response.status() as response:
+ async with async_client.alpha.post_training.job.with_streaming_response.status(
+ "job_uuid",
+ ) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -228,3 +299,10 @@ async def test_streaming_response_status(self, async_client: AsyncLlamaStackClie
assert_matches_type(JobStatusResponse, job, path=["response"])
assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_status(self, async_client: AsyncLlamaStackClient) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_uuid` but received ''"):
+ await async_client.alpha.post_training.job.with_raw_response.status(
+ "",
+ )
From 8b2ff312fa0a44d3e41c34687fa1d71a900f3a69 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 5 Feb 2026 21:28:49 +0000
Subject: [PATCH 2/2] release: 0.5.0-alpha.3
---
.release-please-manifest.json | 2 +-
CHANGELOG.md | 17 +++++++++++++++++
pyproject.toml | 2 +-
src/llama_stack_client/_version.py | 2 +-
4 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 3c0b29c9..44fc7fc2 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.5.0-alpha.2"
+ ".": "0.5.0-alpha.3"
}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d2df5fe0..15557ba3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,22 @@
# Changelog
+## 0.5.0-alpha.3 (2026-02-05)
+
+Full Changelog: [v0.5.0-alpha.2...v0.5.0-alpha.3](https://github.com/llamastack/llama-stack-client-python/compare/v0.5.0-alpha.2...v0.5.0-alpha.3)
+
+### ⚠ BREAKING CHANGES
+
+* improve consistency of post-training API endpoints
+
+### Features
+
+* improve consistency of post-training API endpoints ([99057fd](https://github.com/llamastack/llama-stack-client-python/commit/99057fdc74bafdf54479674ba75b447cd4681cb6))
+
+
+### Bug Fixes
+
+* Enabled models list works ([#314](https://github.com/llamastack/llama-stack-client-python/issues/314)) ([acd5e64](https://github.com/llamastack/llama-stack-client-python/commit/acd5e64a9e82083192a31f85f9c810291cabcadb))
+
## 0.5.0-alpha.2 (2026-02-05)
Full Changelog: [v0.5.0-alpha.1...v0.5.0-alpha.2](https://github.com/llamastack/llama-stack-client-python/compare/v0.5.0-alpha.1...v0.5.0-alpha.2)
diff --git a/pyproject.toml b/pyproject.toml
index 929b382e..3def294d 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "llama_stack_client"
-version = "0.5.0-alpha.2"
+version = "0.5.0-alpha.3"
description = "The official Python library for the llama-stack-client API"
dynamic = ["readme"]
license = "MIT"
diff --git a/src/llama_stack_client/_version.py b/src/llama_stack_client/_version.py
index 65b0d9fb..6e88fc0c 100644
--- a/src/llama_stack_client/_version.py
+++ b/src/llama_stack_client/_version.py
@@ -7,4 +7,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
__title__ = "llama_stack_client"
-__version__ = "0.5.0-alpha.2" # x-release-please-version
+__version__ = "0.5.0-alpha.3" # x-release-please-version