FIX: api key header error (#839)

* FIX: api key header error

* FIX: remove unnecessary headers

* FIX: a error

* FEATURE: Add both headers

---------

Co-authored-by: 耗子 <i@haozi.net>
This commit is contained in:
Rafael dos Santos Silva 2024-10-16 15:57:36 -03:00 committed by GitHub
parent 25cc03809a
commit decf1bb49d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -18,6 +18,7 @@ module ::DiscourseAi
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
conn = Faraday.new { |f| f.adapter FinalDestination::FaradayAdapter }
@ -44,6 +45,7 @@ module ::DiscourseAi
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
conn = Faraday.new { |f| f.adapter FinalDestination::FaradayAdapter }