mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-05 19:11:52 +00:00
feat(ChatKnowledge): ChatKnowledge Support Keyword Retrieve (#1624)
Co-authored-by: Fangyin Cheng <staneyffer@gmail.com>
This commit is contained in:
@@ -66,24 +66,24 @@ async def check_api_key(
|
||||
if request.url.path.startswith(f"/api/v1"):
|
||||
return None
|
||||
|
||||
if service.config.api_keys:
|
||||
api_keys = _parse_api_keys(service.config.api_keys)
|
||||
if auth is None or (token := auth.credentials) not in api_keys:
|
||||
raise HTTPException(
|
||||
status_code=401,
|
||||
detail={
|
||||
"error": {
|
||||
"message": "",
|
||||
"type": "invalid_request_error",
|
||||
"param": None,
|
||||
"code": "invalid_api_key",
|
||||
}
|
||||
},
|
||||
)
|
||||
return token
|
||||
else:
|
||||
# api_keys not set; allow all
|
||||
return None
|
||||
# if service.config.api_keys:
|
||||
# api_keys = _parse_api_keys(service.config.api_keys)
|
||||
# if auth is None or (token := auth.credentials) not in api_keys:
|
||||
# raise HTTPException(
|
||||
# status_code=401,
|
||||
# detail={
|
||||
# "error": {
|
||||
# "message": "",
|
||||
# "type": "invalid_request_error",
|
||||
# "param": None,
|
||||
# "code": "invalid_api_key",
|
||||
# }
|
||||
# },
|
||||
# )
|
||||
# return token
|
||||
# else:
|
||||
# # api_keys not set; allow all
|
||||
# return None
|
||||
|
||||
|
||||
@router.get("/health")
|
||||
|
Reference in New Issue
Block a user