myavana-bot-test-core 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.env CHANGED
@@ -1,8 +1,10 @@
1
1
  # PostgreSQL
2
2
  DB_HOST=34.55.140.120
3
+ MYAVANA_DB_HOST=34.60.246.147
3
4
  DB_USER=myavana
4
5
  DB_PASSWORD=higibertigibet
5
6
  DB_NAME=sienna-naturals-custom-bot
7
+ MYAVANA_DB_NAME=myavana-dashboard-bot
6
8
  DB_PORT=5432
7
9
 
8
10
  # Redis
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myavana-bot-test-core",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Shared bot functionality",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/config.js CHANGED
@@ -9,6 +9,13 @@ module.exports = {
9
9
  database: process.env.DB_NAME,
10
10
  port: parseInt(process.env.DB_PORT, 10) || 5432, // Default PostgreSQL port
11
11
  },
12
+ myavanaDbConfig: {
13
+ host: process.env.MYAVANA_DB_HOST,
14
+ user: process.env.DB_USER,
15
+ password: process.env.DB_PASSWORD,
16
+ database: process.env.MYAVANA_DB_NAME,
17
+ port: parseInt(process.env.DB_PORT, 10) || 5432, // Default PostgreSQL port
18
+ },
12
19
  redisConfig: {
13
20
  username: process.env.REDIS_USERNAME,
14
21
  password: process.env.REDIS_PASSWORD,
@@ -9,7 +9,7 @@ const {getProductByName, addProductRecommendation} = require("./utils");
9
9
 
10
10
  const postProcessingPrompt = (chatHistory, message) => {
11
11
  return `
12
- You are a Sienna Naturals expert AI assistant designed to analyze user conversations and user's name and extract structured information related to hair care.
12
+ You are a hair expert AI assistant designed to analyze user conversations and user's name and extract structured information related to hair care.
13
13
 
14
14
  **Task:** Analyze the following conversation history and the user's latest message to:
15
15
 
@@ -223,7 +223,7 @@ const postProcessConversation = async (chatHistory, message) => {
223
223
 
224
224
 
225
225
  const extractionPrompt = await postProcessingPrompt(chatHistory, message);
226
- console.log('Extraction prompt: ', extractionPrompt);
226
+ //console.log('Extraction prompt: ', extractionPrompt);
227
227
  try {
228
228
  const chat = ai.chat({
229
229
  model: gemini15Flash,
@@ -233,7 +233,7 @@ const postProcessConversation = async (chatHistory, message) => {
233
233
 
234
234
  });
235
235
  const { output } = await chat.send(extractionPrompt);
236
- console.log("Raw post-processing output:", JSON.stringify(output));
236
+ //console.log("Raw post-processing output:", JSON.stringify(output));
237
237
 
238
238
  if (!output) {
239
239
  console.warn("Post-processing output is empty. Returning default empty JSON.");
@@ -316,8 +316,7 @@ const updateUserProfile = async (userId, updates) => {
316
316
 
317
317
  const postResponseProcessing = async (postProcessData, userId, output, allchatsSummary, conversationId, chatHistory, botMessage )=>{
318
318
  if (postProcessData.user_profile_updates) {
319
- // TODO: Update user profile in database based on postProcessData.user_profile_updates
320
- console.log("User profile updates to be applied:", postProcessData.user_profile_updates);
319
+ //console.log("User profile updates to be applied:", postProcessData.user_profile_updates);
321
320
  await updateUserProfile(userId, postProcessData.user_profile_updates);
322
321
  }
323
322
 
@@ -386,7 +385,7 @@ const postResponseProductCheck = async (chatHistory, message) => {
386
385
  },
387
386
  });
388
387
  const { output } = await chat.send(extractionPrompt);
389
- console.log("Raw post-processing output for product check (with reason):", JSON.stringify(output)); // Updated log
388
+ //console.log("Raw post-processing output for product check (with reason):", JSON.stringify(output)); // Updated log
390
389
 
391
390
  if (!output) {
392
391
  console.warn("Post-processing output for product check (with reason) is empty. Returning default empty array."); // Updated log