Spaces:
Sleeping
Sleeping
Update private_gpt/launcher.py
Browse files- private_gpt/launcher.py +3 -3
private_gpt/launcher.py
CHANGED
@@ -105,9 +105,9 @@ def create_app(root_injector: Injector) -> FastAPI:
|
|
105 |
return {"message": f"Model switched to {new_model}"}
|
106 |
|
107 |
# Define a new APIRouter for the model_list
|
108 |
-
model_list_router = APIRouter(prefix="/v1
|
109 |
|
110 |
-
@model_list_router.get("/", response_model=list[dict])
|
111 |
async def model_list(current_user: dict = Depends(get_current_user)):
|
112 |
"""
|
113 |
Get a list of models with their details.
|
@@ -172,7 +172,7 @@ def create_app(root_injector: Injector) -> FastAPI:
|
|
172 |
#db_dependency = Annotated[Session, Depends(get_db)]
|
173 |
#user_dependency = Annotated[dict, Depends(get_current_user)]
|
174 |
|
175 |
-
@app.get("/v1/", status_code=status.HTTP_200_OK)
|
176 |
async def user(current_user: dict = Depends(get_current_user)):
|
177 |
if current_user is None:
|
178 |
raise HTTPException(status_code=401, detail="Authentication Failed")
|
|
|
105 |
return {"message": f"Model switched to {new_model}"}
|
106 |
|
107 |
# Define a new APIRouter for the model_list
|
108 |
+
model_list_router = APIRouter(prefix="/v1", dependencies=[Depends(get_current_user)])
|
109 |
|
110 |
+
@model_list_router.get("/models_list", response_model=list[dict])
|
111 |
async def model_list(current_user: dict = Depends(get_current_user)):
|
112 |
"""
|
113 |
Get a list of models with their details.
|
|
|
172 |
#db_dependency = Annotated[Session, Depends(get_db)]
|
173 |
#user_dependency = Annotated[dict, Depends(get_current_user)]
|
174 |
|
175 |
+
@app.get("/v1/me", status_code=status.HTTP_200_OK)
|
176 |
async def user(current_user: dict = Depends(get_current_user)):
|
177 |
if current_user is None:
|
178 |
raise HTTPException(status_code=401, detail="Authentication Failed")
|