mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-17 18:12:43 +00:00
Add version to REST API url
This commit is contained in:
parent
7693786322
commit
c73fe390ad
18 changed files with 32837 additions and 6032 deletions
|
|
@ -12,6 +12,8 @@ import uuid
|
|||
from dataclasses import dataclass
|
||||
from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, Tuple, Union
|
||||
|
||||
from llama_stack.distribution.stack import LLAMA_STACK_API_VERSION
|
||||
|
||||
from termcolor import colored
|
||||
|
||||
from ..strong_typing.inspection import (
|
||||
|
|
@ -111,9 +113,12 @@ class EndpointOperation:
|
|||
|
||||
def get_route(self) -> str:
|
||||
if self.route is not None:
|
||||
return self.route
|
||||
assert (
|
||||
"_" not in self.route
|
||||
), f"route should not contain underscores: {self.route}"
|
||||
return "/".join(["", LLAMA_STACK_API_VERSION, self.route.lstrip("/")])
|
||||
|
||||
route_parts = ["", self.name]
|
||||
route_parts = ["", LLAMA_STACK_API_VERSION, self.name]
|
||||
for param_name, _ in self.path_params:
|
||||
route_parts.append("{" + param_name + "}")
|
||||
return "/".join(route_parts)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue