mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-05 04:17:32 +00:00
chore(api): make version prefix optional
This commit is contained in:
parent
5c873d53db
commit
f991f9ff1c
2 changed files with 6 additions and 1 deletions
|
@ -60,7 +60,9 @@ def get_all_api_routes(
|
|||
# The __webmethod__ attribute is dynamically added by the @webmethod decorator
|
||||
# mypy doesn't know about this dynamic attribute, so we ignore the attr-defined error
|
||||
webmethod = method.__webmethod__ # type: ignore[attr-defined]
|
||||
path = f"/{LLAMA_STACK_API_VERSION}/{webmethod.route.lstrip('/')}"
|
||||
path = webmethod.route.lstrip("/")
|
||||
if webmethod.add_version:
|
||||
path = f"/{LLAMA_STACK_API_VERSION}/{path}"
|
||||
if webmethod.method == hdrs.METH_GET:
|
||||
http_method = hdrs.METH_GET
|
||||
elif webmethod.method == hdrs.METH_DELETE:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue