feat(ChatKnowledge): ChatKnowledge Support Keyword Retrieve (#1624)

Co-authored-by: Fangyin Cheng <staneyffer@gmail.com>
This commit is contained in:
Aries-ckt
2024-06-13 13:49:17 +08:00
committed by GitHub
parent 162e2c9b1c
commit 58d08780d6
86 changed files with 948 additions and 440 deletions

View File

@@ -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")