@peopl-health/nexus 3.7.2 → 3.7.3

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.
@@ -8,7 +8,6 @@ const predictionMetricsSchema = new mongoose.Schema({
8
8
  message_id: { type: String, required: true, index: true },
9
9
  numero: { type: String, required: true, index: true },
10
10
  assistant_id: { type: String, required: true, index: true },
11
- thread_id: { type: String },
12
11
  prediction_time_ms: { type: Number },
13
12
  retry_count: { type: Number, default: 1 },
14
13
  completed: { type: Boolean, default: true },
@@ -20,6 +19,12 @@ const predictionMetricsSchema = new mongoose.Schema({
20
19
  total_tokens: { type: Number, default: 0 },
21
20
  model: { type: String },
22
21
  },
22
+ prompt_config: { type: Object, default: null },
23
+ response_id: { type: String, default: null, index: true },
24
+ context_message_count: { type: Number, default: null },
25
+ resolved_prompt: { type: String, default: null },
26
+ snippet_ids: { type: [String], default: [] },
27
+ tool_ids: { type: [String], default: [] },
23
28
  source: { type: String, default: () => process.env.USER_DB_MONGO }
24
29
  }, { timestamps: true });
25
30
 
@@ -291,6 +291,9 @@ const replyAssistantCore = async (code, message_ = null, thread_ = null, runOpti
291
291
  completed: completed,
292
292
  timing_breakdown: timings,
293
293
  token_usage: tokenUsage,
294
+ prompt_config: prompt || null,
295
+ response_id: response_id || null,
296
+ context_message_count: lastMessage?.length || null,
294
297
  }).catch(err => logger.error('[replyAssistant] Failed to store metrics', { error: err.message }));
295
298
 
296
299
  const alertThreshold = parseInt(process.env.TOKEN_ALERT_THRESHOLD, 10);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peopl-health/nexus",
3
- "version": "3.7.2",
3
+ "version": "3.7.3",
4
4
  "description": "Core messaging and assistant library for WhatsApp communication platforms",
5
5
  "keywords": [
6
6
  "whatsapp",