Merge branch 'develop' into chore/notification-logging
This commit is contained in:
@@ -77,8 +77,12 @@ class Integrations::OpenaiBaseService
|
||||
response = HTTParty.post(API_URL, headers: headers, body: body)
|
||||
Rails.logger.info("OpenAI API response: #{response.body}")
|
||||
|
||||
return { error: response.parsed_response, error_code: response.code } unless response.success?
|
||||
|
||||
choices = JSON.parse(response.body)['choices']
|
||||
|
||||
choices.present? ? choices.first['message']['content'] : nil
|
||||
return { message: choices.first['message']['content'] } if choices.present?
|
||||
|
||||
{ message: nil }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -54,6 +54,10 @@ module Linear::Queries
|
||||
title
|
||||
description
|
||||
identifier
|
||||
state {
|
||||
name
|
||||
color
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ module Redis::RedisKeys
|
||||
LATEST_CHATWOOT_VERSION = 'LATEST_CHATWOOT_VERSION'.freeze
|
||||
# Check if a message create with same source-id is in progress?
|
||||
MESSAGE_SOURCE_KEY = 'MESSAGE_SOURCE_KEY::%<id>s'.freeze
|
||||
OPENAI_CONVERSATION_KEY = 'OPEN_AI_CONVERSATION_KEY::%<event_name>s::%<conversation_id>d::%<updated_at>d'.freeze
|
||||
OPENAI_CONVERSATION_KEY = 'OPEN_AI_CONVERSATION_KEY::v1::%<event_name>s::%<conversation_id>d::%<updated_at>d'.freeze
|
||||
|
||||
## Sempahores / Locks
|
||||
# We don't want to process messages from the same sender concurrently to prevent creating double conversations
|
||||
|
||||
Reference in New Issue
Block a user