This commit is contained in:
Xi Yan 2025-02-12 20:12:28 -08:00
parent bf11cc0450
commit 1e975e88ec
4 changed files with 6 additions and 4 deletions

View file

@ -765,7 +765,7 @@
]
}
},
"/v1/models/{model_id}": {
"/v1/models/{model_id:path}": {
"get": {
"responses": {
"200": {

View file

@ -460,7 +460,7 @@ paths:
required: true
schema:
type: string
/v1/models/{model_id}:
/v1/models/{model_id:path}:
get:
responses:
'200':

View file

@ -130,6 +130,8 @@ class _FormatParameterExtractor:
def _get_route_parameters(route: str) -> List[str]:
extractor = _FormatParameterExtractor()
# Replace all occurrences of ":path" with empty string
route = route.replace(":path", "")
route.format_map(extractor)
return extractor.keys

View file

@ -62,7 +62,7 @@ class Models(Protocol):
@webmethod(route="/models", method="GET")
async def list_models(self) -> ListModelsResponse: ...
@webmethod(route="/models/{model_id}", method="GET")
@webmethod(route="/models/{model_id:path}", method="GET")
async def get_model(
self,
model_id: str,
@ -78,7 +78,7 @@ class Models(Protocol):
model_type: Optional[ModelType] = None,
) -> Model: ...
@webmethod(route="/models/{model_id}", method="DELETE")
@webmethod(route="/models/{model_id:path}", method="DELETE")
async def unregister_model(
self,
model_id: str,