Skip to content

Commit 9a269ec

Browse files
authored
fix: use path converter for model ID routes in analytics to support slashes (open-webui#22382)
1 parent d7efdcc commit 9a269ec

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

backend/open_webui/routers/analytics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ class ModelChatsResponse(BaseModel):
278278
total: int
279279

280280

281-
@router.get("/models/{model_id}/chats", response_model=ModelChatsResponse)
281+
@router.get("/models/{model_id:path}/chats", response_model=ModelChatsResponse)
282282
async def get_model_chats(
283283
model_id: str,
284284
start_date: Optional[int] = Query(None),
@@ -367,7 +367,7 @@ class ModelOverviewResponse(BaseModel):
367367
tags: list[TagEntry]
368368

369369

370-
@router.get("/models/{model_id}/overview", response_model=ModelOverviewResponse)
370+
@router.get("/models/{model_id:path}/overview", response_model=ModelOverviewResponse)
371371
async def get_model_overview(
372372
model_id: str,
373373
days: int = Query(30, description="Number of days of history (0 for all)"),

0 commit comments

Comments
 (0)