From be721c2b507623bc33b3bc23576df2066d6bf18b Mon Sep 17 00:00:00 2001 From: YashRaj <91825864+YashRajCodes@users.noreply.github.com> Date: Mon, 25 Aug 2025 11:33:00 +0530 Subject: [PATCH 01/58] feat: add config for embedding model (#12120) This PR adds the ability to modify the embedding model used by Captain AI.Previously, the embedding model was hardcoded which led to errors when you used a different API provider which did not support that specific embedding model. Co-authored-by: Shivam Mishra --- config/installation_config.yml | 4 ++++ enterprise/app/services/captain/llm/embedding_service.rb | 6 ++++-- lib/open_ai_constants.rb | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/config/installation_config.yml b/config/installation_config.yml index 01799e830..32cba36f5 100644 --- a/config/installation_config.yml +++ b/config/installation_config.yml @@ -175,6 +175,10 @@ display_title: 'OpenAI API Endpoint (optional)' description: 'The OpenAI endpoint configured for use in Captain AI. Default: https://api.openai.com/' locked: false +- name: CAPTAIN_EMBEDDING_MODEL + display_title: 'Embedding Model (optional)' + description: 'The embedding model configured for use in Captain AI. Default: text-embedding-3-small' + locked: false - name: CAPTAIN_FIRECRAWL_API_KEY display_title: 'FireCrawl API Key (optional)' description: 'The FireCrawl API key for the Captain AI service' diff --git a/enterprise/app/services/captain/llm/embedding_service.rb b/enterprise/app/services/captain/llm/embedding_service.rb index 74f3079bf..1dbb0ce5b 100644 --- a/enterprise/app/services/captain/llm/embedding_service.rb +++ b/enterprise/app/services/captain/llm/embedding_service.rb @@ -3,9 +3,11 @@ require 'openai' class Captain::Llm::EmbeddingService < Llm::BaseOpenAiService class EmbeddingsError < StandardError; end - DEFAULT_MODEL = 'text-embedding-3-small'.freeze + def self.embedding_model + @embedding_model = InstallationConfig.find_by(name: 'CAPTAIN_EMBEDDING_MODEL')&.value.presence || OpenAiConstants::DEFAULT_EMBEDDING_MODEL + end - def get_embedding(content, model: DEFAULT_MODEL) + def get_embedding(content, model: self.class.embedding_model) response = @client.embeddings( parameters: { model: model, diff --git a/lib/open_ai_constants.rb b/lib/open_ai_constants.rb index 2c87f3378..7b7a3ba5f 100644 --- a/lib/open_ai_constants.rb +++ b/lib/open_ai_constants.rb @@ -3,4 +3,5 @@ module OpenAiConstants DEFAULT_MODEL = 'gpt-4.1-mini' DEFAULT_ENDPOINT = 'https://api.openai.com' + DEFAULT_EMBEDDING_MODEL = 'text-embedding-3-small' end From f6062f992eeb489a25aad59aa4816716bc0a2c10 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Mon, 25 Aug 2025 16:13:44 +0530 Subject: [PATCH 02/58] fix: memory leak in vue-letter from fallback text content (#12212) --- .../dashboard/components-next/message/bubbles/Email/Index.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/javascript/dashboard/components-next/message/bubbles/Email/Index.vue b/app/javascript/dashboard/components-next/message/bubbles/Email/Index.vue index 63b5f8eef..07c6167f7 100644 --- a/app/javascript/dashboard/components-next/message/bubbles/Email/Index.vue +++ b/app/javascript/dashboard/components-next/message/bubbles/Email/Index.vue @@ -41,9 +41,7 @@ const originalEmailText = computed(() => { }); const originalEmailHtml = computed( - () => - contentAttributes?.value?.email?.htmlContent?.full ?? - originalEmailText.value + () => contentAttributes?.value?.email?.htmlContent?.full || '' ); const messageContent = computed(() => { From 19faa7fdfa0cf3e4db2bdfae852eb6d4955573ce Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Tue, 26 Aug 2025 15:20:53 +0530 Subject: [PATCH 03/58] refactor: Consolidate WhatsApp template components and improve naming (#12299) --- .../components/WhatsappTemplateParser.vue | 177 ------------------ .../whatsapp/WhatsAppTemplateParser.vue | 9 + .../conversation/WhatsappTemplates/Modal.vue | 6 +- ...teParser.vue => WhatsAppTemplateReply.vue} | 9 - 4 files changed, 12 insertions(+), 189 deletions(-) delete mode 100644 app/javascript/dashboard/components-next/NewConversation/components/WhatsappTemplateParser.vue rename app/javascript/dashboard/components/widgets/conversation/WhatsappTemplates/{TemplateParser.vue => WhatsAppTemplateReply.vue} (74%) diff --git a/app/javascript/dashboard/components-next/NewConversation/components/WhatsappTemplateParser.vue b/app/javascript/dashboard/components-next/NewConversation/components/WhatsappTemplateParser.vue deleted file mode 100644 index ce1520f79..000000000 --- a/app/javascript/dashboard/components-next/NewConversation/components/WhatsappTemplateParser.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - diff --git a/app/javascript/dashboard/components-next/whatsapp/WhatsAppTemplateParser.vue b/app/javascript/dashboard/components-next/whatsapp/WhatsAppTemplateParser.vue index aa28bcdd3..cf62a6d5d 100644 --- a/app/javascript/dashboard/components-next/whatsapp/WhatsAppTemplateParser.vue +++ b/app/javascript/dashboard/components-next/whatsapp/WhatsAppTemplateParser.vue @@ -1,4 +1,13 @@