@peopl-health/nexus 3.2.11 → 3.2.12
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.
|
@@ -16,7 +16,7 @@ const isThreadNotFoundError = (error) => {
|
|
|
16
16
|
const recreateThread = async (thread, variant = 'assistants') => {
|
|
17
17
|
const provider = createProvider({ variant });
|
|
18
18
|
const newConversation = await provider.createConversation({
|
|
19
|
-
metadata: { phoneNumber: thread.code
|
|
19
|
+
metadata: { phoneNumber: thread.code }
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
await Thread.updateOne(
|
|
@@ -290,11 +290,13 @@ class OpenAIResponsesProvider {
|
|
|
290
290
|
let totalRetries = 0;
|
|
291
291
|
let allToolsExecuted = [];
|
|
292
292
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
293
|
+
const devRecord = await getRecordByFilter(Config_ID, 'responses', `{prompt_id} = "${assistantId}"`);
|
|
294
|
+
let devContent = devRecord?.[0]?.content || '';
|
|
295
|
+
if (promptVariables) devContent = devContent.replace(/\{\{(\w+)\}\}/g, (_, key) => promptVariables[key] ?? '');
|
|
296
|
+
|
|
297
|
+
const messages = (context || this._convertItemsToApiFormat(additionalMessages))
|
|
298
|
+
.filter(item => item.type !== 'function_call' && item.type !== 'function_call_output');
|
|
299
|
+
const input = [{ role: 'developer', content: devContent }, ...messages];
|
|
298
300
|
|
|
299
301
|
const promptConfig = { id: assistantId };
|
|
300
302
|
if (promptVariables) promptConfig.variables = promptVariables;
|