@peopl-health/nexus 2.0.8 → 2.0.10
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.
|
@@ -4,7 +4,7 @@ const { INTERACTION_QUALITY_VALUES } = require('../config/interactionConfig');
|
|
|
4
4
|
const { addRecord, getRecordByFilter } = require('../services/airtableService');
|
|
5
5
|
const { Logging_ID } = require('../config/airtableConfig');
|
|
6
6
|
|
|
7
|
-
async function logInteractionToAirtable(messageIds, whatsapp_id, voter_username) {
|
|
7
|
+
async function logInteractionToAirtable(messageIds, whatsapp_id, voter_username, description) {
|
|
8
8
|
try {
|
|
9
9
|
const messageObjects = await Message.find({ _id: { $in: messageIds } }).sort({ createdAt: -1 });
|
|
10
10
|
|
|
@@ -27,7 +27,8 @@ async function logInteractionToAirtable(messageIds, whatsapp_id, voter_username)
|
|
|
27
27
|
const airtableData = {
|
|
28
28
|
patient_id: patientId ? [patientId] : undefined,
|
|
29
29
|
reporter: voter_username,
|
|
30
|
-
conversation
|
|
30
|
+
conversation,
|
|
31
|
+
description
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
await addRecord(Logging_ID, 'interactions', airtableData);
|
|
@@ -50,7 +51,7 @@ const addInteractionController = async (req, res) => {
|
|
|
50
51
|
}
|
|
51
52
|
const interaction = await Interaction.create({ messages, whatsapp_id, voter_username, quality, description });
|
|
52
53
|
|
|
53
|
-
logInteractionToAirtable(messages, whatsapp_id, voter_username).catch(err =>
|
|
54
|
+
logInteractionToAirtable(messages, whatsapp_id, voter_username, description).catch(err =>
|
|
54
55
|
console.error('Background Airtable logging failed:', err)
|
|
55
56
|
);
|
|
56
57
|
|
|
@@ -16,7 +16,7 @@ const moment = require('moment-timezone');
|
|
|
16
16
|
const mode = process.env.NODE_ENV || 'dev';
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
async function checkRunStatus(assistant, thread_id, run_id, retryCount = 0, maxRetries =
|
|
19
|
+
async function checkRunStatus(assistant, thread_id, run_id, retryCount = 0, maxRetries = 100) {
|
|
20
20
|
try {
|
|
21
21
|
const provider = createProvider({ variant: process.env.VARIANT || 'assistants' });
|
|
22
22
|
const run = await provider.getRun({ threadId: thread_id, runId: run_id });
|