FEATURE: Add both headers

This commit is contained in:
耗子 2024-05-11 10:37:46 +08:00 committed by GitHub
parent 9c056a44fd
commit 871a26336c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -17,6 +17,7 @@ module ::DiscourseAi
end
if SiteSetting.ai_hugging_face_tei_api_key.present?
headers["X-API-KEY"] = SiteSetting.ai_hugging_face_tei_api_key
headers["Authorization"] = "Bearer #{SiteSetting.ai_hugging_face_tei_api_key}"
end
@ -43,6 +44,7 @@ module ::DiscourseAi
end
if SiteSetting.ai_hugging_face_tei_reranker_api_key.present?
headers["X-API-KEY"] = SiteSetting.ai_hugging_face_tei_reranker_api_key
headers["Authorization"] = "Bearer #{SiteSetting.ai_hugging_face_tei_reranker_api_key}"
end