@peopl-health/nexus 5.10.0-dev.1045 → 5.10.0-dev.1048
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const { Anthropic } = require('@anthropic-ai/sdk');
|
|
2
2
|
|
|
3
|
+
const { OPERATOR_TURN_PREFIX } = require('../memory/DefaultMemoryManager');
|
|
3
4
|
const { appendCall } = require('../services/llmAuditService');
|
|
4
5
|
const { composePrompt } = require('../services/promptComposerService');
|
|
5
6
|
const { retryWithBackoff } = require('../../utils/retryUtils');
|
|
@@ -384,6 +385,15 @@ class AnthropicProvider extends BaseLLMProvider {
|
|
|
384
385
|
return typeof output === 'string' ? output : JSON.stringify(output ?? '');
|
|
385
386
|
}
|
|
386
387
|
|
|
388
|
+
// Split placement: the inline copy carries recency on single-round turns, the hoisted developer
|
|
389
|
+
// turn persists once tool results are appended after it on multi-round turns.
|
|
390
|
+
_buildInput({ additionalInstructions, ...rest }) {
|
|
391
|
+
const input = super._buildInput({ additionalInstructions, ...rest });
|
|
392
|
+
if (!additionalInstructions) return input;
|
|
393
|
+
const { content } = this._operatorInstructionTurn(additionalInstructions);
|
|
394
|
+
return [...input, { role: 'user', content: `${OPERATOR_TURN_PREFIX} ${content}`, type: 'message' }];
|
|
395
|
+
}
|
|
396
|
+
|
|
387
397
|
_mapModelConfig(modelConfig) {
|
|
388
398
|
const mapped = { ...(modelConfig || {}) };
|
|
389
399
|
if (mapped.max_tokens == null && mapped.max_output_tokens != null) mapped.max_tokens = mapped.max_output_tokens;
|