feat: use captain key for HC embedding
This commit is contained in:
@@ -65,7 +65,8 @@ module Enterprise::Concerns::Article
|
||||
{ role: 'system', content: article_to_search_terms_prompt },
|
||||
{ role: 'user', content: "title: #{title} \n description: #{description} \n content: #{content}" }
|
||||
]
|
||||
headers = { 'Content-Type' => 'application/json', 'Authorization' => "Bearer #{ENV.fetch('OPENAI_API_KEY', nil)}" }
|
||||
headers = { 'Content-Type' => 'application/json',
|
||||
'Authorization' => "Bearer #{InstallationConfig.find_by(name: 'CAPTAIN_OPEN_AI_API_KEY')&.value}" }
|
||||
body = { model: 'gpt-4o', messages: messages, response_format: { type: 'json_object' } }.to_json
|
||||
Rails.logger.info "Requesting Chat GPT with body: #{body}"
|
||||
response = HTTParty.post(openai_api_url, headers: headers, body: body)
|
||||
|
||||
Reference in New Issue
Block a user