Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1345f67966 | ||
|
|
ecd4892a23 | ||
|
|
457430e8d9 | ||
|
|
0f914fa2ab | ||
|
|
59663dd558 |
+1
-1
@@ -1 +1 @@
|
||||
4.10.0
|
||||
4.10.1
|
||||
|
||||
@@ -10,10 +10,7 @@ class Whatsapp::IncomingMessageWhatsappCloudService < Whatsapp::IncomingMessageB
|
||||
|
||||
def download_attachment_file(attachment_payload)
|
||||
url_response = HTTParty.get(
|
||||
inbox.channel.media_url(
|
||||
attachment_payload[:id],
|
||||
inbox.channel.provider_config['phone_number_id']
|
||||
),
|
||||
inbox.channel.media_url(attachment_payload[:id]),
|
||||
headers: inbox.channel.api_headers
|
||||
)
|
||||
# This url response will be failure if the access token has expired.
|
||||
|
||||
@@ -75,10 +75,8 @@ class Whatsapp::Providers::WhatsappCloudService < Whatsapp::Providers::BaseServi
|
||||
csat_template_service.get_template_status(template_name)
|
||||
end
|
||||
|
||||
def media_url(media_id, phone_number_id = nil)
|
||||
url = "#{api_base_path}/v13.0/#{media_id}"
|
||||
url += "?phone_number_id=#{phone_number_id}" if phone_number_id
|
||||
url
|
||||
def media_url(media_id)
|
||||
"#{api_base_path}/v13.0/#{media_id}"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
shared: &shared
|
||||
version: '4.10.0'
|
||||
version: '4.10.1'
|
||||
|
||||
development:
|
||||
<<: *shared
|
||||
|
||||
@@ -96,10 +96,6 @@ class Integrations::LlmBaseService
|
||||
end
|
||||
end
|
||||
|
||||
# User configuration errors that should not be reported to Sentry
|
||||
# Only UnauthorizedError is included as it clearly indicates an invalid API key
|
||||
USER_ERRORS = %w[RubyLLM::UnauthorizedError].freeze
|
||||
|
||||
def execute_ruby_llm_request(parsed_body)
|
||||
messages = parsed_body['messages']
|
||||
model = parsed_body['model']
|
||||
@@ -109,15 +105,10 @@ class Integrations::LlmBaseService
|
||||
setup_chat_with_messages(chat, messages)
|
||||
end
|
||||
rescue StandardError => e
|
||||
# Don't report user configuration errors (invalid API key, etc.) to Sentry
|
||||
ChatwootExceptionTracker.new(e, account: hook.account).capture_exception unless user_configuration_error?(e)
|
||||
ChatwootExceptionTracker.new(e, account: hook.account).capture_exception
|
||||
build_error_response_from_exception(e, messages)
|
||||
end
|
||||
|
||||
def user_configuration_error?(error)
|
||||
USER_ERRORS.include?(error.class.name)
|
||||
end
|
||||
|
||||
def setup_chat_with_messages(chat, messages)
|
||||
apply_system_instructions(chat, messages)
|
||||
response = send_conversation_messages(chat, messages)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@chatwoot/chatwoot",
|
||||
"version": "4.10.0",
|
||||
"version": "4.10.1",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"eslint": "eslint app/**/*.{js,vue}",
|
||||
|
||||
@@ -41,10 +41,7 @@ describe Whatsapp::IncomingMessageWhatsappCloudService do
|
||||
it 'increments reauthorization count if fetching attachment fails' do
|
||||
stub_request(
|
||||
:get,
|
||||
whatsapp_channel.media_url(
|
||||
'b1c68f38-8734-4ad3-b4a1-ef0c10d683',
|
||||
whatsapp_channel.provider_config['phone_number_id']
|
||||
)
|
||||
whatsapp_channel.media_url('b1c68f38-8734-4ad3-b4a1-ef0c10d683')
|
||||
).to_return(
|
||||
status: 401
|
||||
)
|
||||
@@ -112,10 +109,7 @@ describe Whatsapp::IncomingMessageWhatsappCloudService do
|
||||
def stub_media_url_request
|
||||
stub_request(
|
||||
:get,
|
||||
whatsapp_channel.media_url(
|
||||
'b1c68f38-8734-4ad3-b4a1-ef0c10d683',
|
||||
whatsapp_channel.provider_config['phone_number_id']
|
||||
)
|
||||
whatsapp_channel.media_url('b1c68f38-8734-4ad3-b4a1-ef0c10d683')
|
||||
).to_return(
|
||||
status: 200,
|
||||
body: {
|
||||
|
||||
Reference in New Issue
Block a user