chore: Switch models to gpt-4o (#9458)

- Switch model to gpt-4o from gpt-4-turbo
This commit is contained in:
Sojan Jose
2024-05-13 13:32:11 -07:00
committed by GitHub
parent 9a8442fe0e
commit 07e33fd98a
2 changed files with 2 additions and 2 deletions

View File

@@ -66,7 +66,7 @@ module Enterprise::Concerns::Article
{ role: 'user', content: "title: #{title} \n description: #{description} \n content: #{content}" }
]
headers = { 'Content-Type' => 'application/json', 'Authorization' => "Bearer #{ENV.fetch('OPENAI_API_KEY', nil)}" }
body = { model: 'gpt-4-turbo', messages: messages, response_format: { type: 'json_object' } }.to_json
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('https://api.openai.com/v1/chat/completions', headers: headers, body: body)
Rails.logger.info "Chat GPT response: #{response.body}"

View File

@@ -4,7 +4,7 @@ class ChatGpt
end
def initialize(context_sections = '')
@model = 'gpt-4-0125-preview'
@model = 'gpt-4o'
@messages = [system_message(context_sections)]
end