feat: introduce API leveling, post_training to v1alpha

Rather than have a single `LLAMA_STACK_VERSION`, we need to have a `_V1`, `_V1ALPHA`, and `_V1BETA` constant.

This also necessitated addition of `level` to the `WebMethod` so that routing can be handeled properly.

move post_training to `v1alpha` as it is under heavy development and not near its final state

Signed-off-by: Charlie Doern <cdoern@redhat.com>
This commit is contained in:
Charlie Doern 2025-09-12 13:23:57 -04:00
parent 6b855af96f
commit 8095602697
9 changed files with 37 additions and 29 deletions

View file

@ -13,6 +13,7 @@ from .strong_typing.schema import json_schema_type, register_schema # noqa: F40
@dataclass
class WebMethod:
level: str | None = "v1"
route: str | None = None
public: bool = False
request_examples: list[Any] | None = None
@ -31,6 +32,7 @@ T = TypeVar("T", bound=Callable[..., Any])
def webmethod(
route: str | None = None,
method: str | None = None,
level: str | None = "v1",
public: bool | None = False,
request_examples: list[Any] | None = None,
response_examples: list[Any] | None = None,
@ -54,6 +56,7 @@ def webmethod(
func.__webmethod__ = WebMethod( # type: ignore
route=route,
method=method,
level=level,
public=public or False,
request_examples=request_examples,
response_examples=response_examples,