@peopl-health/nexus 2.1.5 → 2.1.6

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.
@@ -3,6 +3,8 @@ const { Thread } = require('../models/threadModel');
3
3
  const { getLastNMessages } = require('../helpers/assistantHelper');
4
4
  const { createProvider } = require('../providers/createProvider');
5
5
 
6
+ const DEFAULT_MAX_HISTORICAL_MESSAGES = parseInt(process.env.MAX_HISTORICAL_MESSAGES || '50', 10);
7
+
6
8
  /**
7
9
  * Flexible base assistant implementation that integrates with OpenAI Threads
8
10
  * and supports dynamic tool registration.
@@ -165,7 +167,7 @@ class BaseAssistant {
165
167
 
166
168
  const whatsappId = context?.whatsapp_id || code;
167
169
  if (whatsappId) {
168
- this.lastMessages = await getLastNMessages(whatsappId, 20);
170
+ this.lastMessages = await getLastNMessages(whatsappId, DEFAULT_MAX_HISTORICAL_MESSAGES);
169
171
  }
170
172
 
171
173
  const provider = createProvider({ variant: process.env.VARIANT || 'assistants' });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peopl-health/nexus",
3
- "version": "2.1.5",
3
+ "version": "2.1.6",
4
4
  "description": "Core messaging and assistant library for WhatsApp communication platforms",
5
5
  "keywords": [
6
6
  "whatsapp",