@peopl-health/nexus 5.56.38 → 5.56.39
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,6 +4,7 @@ const { OPERATOR_TURN_PREFIX } = require('../memory/DefaultMemoryManager');
|
|
|
4
4
|
const { ROUTING_SKILL } = require('../helpers/clinicalWorkflowGuard');
|
|
5
5
|
const { appendCall } = require('../services/llmAuditService');
|
|
6
6
|
const { composePrompt } = require('../services/promptComposerService');
|
|
7
|
+
const { RISK_HEADLINE_MARKER, RISK_HEADLINE_DISCLAIMER } = require('../services/riskHeadlineService');
|
|
7
8
|
const { isConversationalDraftReuseLive } = require('../flags/turnEfficiencyFlags');
|
|
8
9
|
const { retryWithBackoff } = require('../../utils/retryUtils');
|
|
9
10
|
const { withTiming } = require('../../utils/tracingDecorator');
|
|
@@ -475,9 +476,8 @@ class AnthropicProvider extends BaseLLMProvider {
|
|
|
475
476
|
// turn persists once tool results are appended after it on multi-round turns.
|
|
476
477
|
_buildInput({ additionalInstructions, ...rest }) {
|
|
477
478
|
const input = super._buildInput({ additionalInstructions, ...rest });
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
const ordered = [...input.filter(i => !i[TAIL_PLACEMENT]), ...input.filter(i => i[TAIL_PLACEMENT])];
|
|
479
|
+
const pinned = { role: 'developer', content: `${RISK_HEADLINE_MARKER}\n${RISK_HEADLINE_DISCLAIMER}` };
|
|
480
|
+
const ordered = [...input.filter(i => !i[TAIL_PLACEMENT]), pinned, ...input.filter(i => i[TAIL_PLACEMENT])];
|
|
481
481
|
if (!additionalInstructions) return ordered;
|
|
482
482
|
const { content } = this._operatorInstructionTurn(additionalInstructions);
|
|
483
483
|
return [...ordered, { role: 'user', content: `${OPERATOR_TURN_PREFIX} ${content}`, type: 'message' }];
|
|
@@ -429,7 +429,9 @@ class BaseLLMProvider {
|
|
|
429
429
|
parts.push(`## Síntomas recientes\n${symptoms}`);
|
|
430
430
|
}
|
|
431
431
|
if (parts.length === 0) return [];
|
|
432
|
-
|
|
432
|
+
// Refreshed most turns (symptoms, risks); ahead of the history it rewrote the whole cached
|
|
433
|
+
// conversation. Informational only, so it rides behind it like the clock. Directives stay in system.
|
|
434
|
+
return [{ role: 'developer', content: parts.join('\n\n'), [TAIL_PLACEMENT]: true }];
|
|
433
435
|
}
|
|
434
436
|
|
|
435
437
|
_clinicalText(value, field) {
|