feat: include contact verified status with each tool call (#13663)

Co-authored-by: aakashb95 <aakashbakhle@gmail.com>
This commit is contained in:
Shivam Mishra
2026-02-26 16:16:33 +05:30
committed by GitHub
parent 6b3f1114fd
commit 7c60ad9e28
7 changed files with 125 additions and 10 deletions

View File

@@ -71,6 +71,7 @@ module Concerns::Toolable
add_base_headers(headers, state)
add_conversation_headers(headers, state[:conversation]) if state[:conversation]
add_contact_headers(headers, state[:contact]) if state[:contact]
add_contact_inbox_headers(headers, state[:contact_inbox])
end
end
@@ -91,6 +92,11 @@ module Concerns::Toolable
headers['X-Chatwoot-Contact-Phone'] = contact[:phone_number].to_s if contact[:phone_number].present?
end
def add_contact_inbox_headers(headers, contact_inbox)
headers['X-Chatwoot-Contact-Inbox-Id'] = contact_inbox[:id].to_s if contact_inbox&.[](:id)
headers['X-Chatwoot-Contact-Inbox-Verified'] = (contact_inbox&.[](:hmac_verified) || false).to_s
end
def format_response(raw_response_body)
return raw_response_body if response_template.blank?