@peopl-health/nexus 2.0.2 → 2.0.4

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.
@@ -269,7 +269,7 @@ class BaseAssistant {
269
269
  this.thread = {
270
270
  ...conversation,
271
271
  thread_id: conversation?.id,
272
- assistant_id: this.assistantId.startsWith('assistant') ? this.assistantId : null,
272
+ assistant_id: this.assistantId.startsWith('asst') ? this.assistantId : null,
273
273
  prompt_id: this.assistantId.startsWith('pmpt') ? this.assistantId : null,
274
274
  code,
275
275
  };
@@ -221,7 +221,7 @@ const createAssistant = async (code, assistant_id, messages=[], force=false) =>
221
221
  // Define new thread data
222
222
  const thread = {
223
223
  code: code,
224
- assistant_id: assistant_id.startsWith('assistant') ? assistant_id : null,
224
+ assistant_id: assistant_id.startsWith('asst') ? assistant_id : null,
225
225
  thread_id: initialThread.id.startsWith('thread') ? initialThread.id : null,
226
226
  conversation_id: initialThread.id.startsWith('conv') ? initialThread.id : null,
227
227
  prompt_id: assistant_id.startsWith('pmpt') ? assistant_id : null,
@@ -350,7 +350,7 @@ const replyAssistant = async function (code, message_ = null, thread_ = null, ru
350
350
  try {
351
351
  let thread = thread_ || await getThread(code);
352
352
  console.log('THREAD STOPPED', code, thread?.active);
353
- if (!thread || !thread.active) return null;
353
+ if (!thread || !thread.active || thread.stopped) return null;
354
354
 
355
355
  const patientReply = await getLastMessages(code);
356
356
  if (!patientReply) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peopl-health/nexus",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "Core messaging and assistant library for WhatsApp communication platforms",
5
5
  "keywords": [
6
6
  "whatsapp",