psyche-ai 9.2.3 → 9.2.5
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.
- package/README.en.md +8 -175
- package/README.md +33 -16
- package/dist/adapters/http.js +1 -1
- package/dist/adapters/langchain.d.ts +14 -0
- package/dist/adapters/langchain.js +20 -0
- package/dist/adapters/mcp.js +5 -1
- package/dist/adapters/openclaw.d.ts +1 -0
- package/dist/adapters/openclaw.js +67 -15
- package/dist/adapters/vercel-ai.d.ts +2 -1
- package/dist/adapters/vercel-ai.js +8 -9
- package/dist/appraisal.d.ts +8 -0
- package/dist/appraisal.js +362 -0
- package/dist/autonomic.js +2 -2
- package/dist/classify.js +14 -3
- package/dist/cli.js +28 -3
- package/dist/core.d.ts +9 -3
- package/dist/core.js +194 -12
- package/dist/demo.js +1 -2
- package/dist/diagnostics.d.ts +8 -6
- package/dist/diagnostics.js +53 -17
- package/dist/ethics.js +1 -1
- package/dist/experiential-field.d.ts +2 -2
- package/dist/experiential-field.js +7 -16
- package/dist/generative-self.js +0 -2
- package/dist/host-controls.d.ts +5 -0
- package/dist/host-controls.js +48 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.js +7 -1
- package/dist/interaction.js +0 -2
- package/dist/metacognition.d.ts +13 -1
- package/dist/metacognition.js +164 -32
- package/dist/prompt.d.ts +4 -0
- package/dist/prompt.js +67 -31
- package/dist/psyche-file.d.ts +16 -1
- package/dist/psyche-file.js +103 -8
- package/dist/relation-dynamics.d.ts +21 -0
- package/dist/relation-dynamics.js +601 -0
- package/dist/response-contract.d.ts +8 -0
- package/dist/response-contract.js +374 -0
- package/dist/storage.d.ts +1 -0
- package/dist/storage.js +12 -5
- package/dist/subjectivity.d.ts +3 -0
- package/dist/subjectivity.js +477 -0
- package/dist/temporal.d.ts +2 -2
- package/dist/temporal.js +2 -2
- package/dist/types.d.ts +243 -0
- package/dist/types.js +43 -0
- package/dist/update.d.ts +37 -2
- package/dist/update.js +323 -44
- package/openclaw.plugin.json +20 -1
- package/package.json +1 -1
package/dist/core.js
CHANGED
|
@@ -11,19 +11,19 @@
|
|
|
11
11
|
//
|
|
12
12
|
// Orchestrates: chemistry, classify, prompt, profiles, guards, learning
|
|
13
13
|
// ============================================================
|
|
14
|
-
import { DEFAULT_RELATIONSHIP, DEFAULT_DRIVES, DEFAULT_LEARNING_STATE, DEFAULT_METACOGNITIVE_STATE, DEFAULT_PERSONHOOD_STATE, DEFAULT_ENERGY_BUDGETS, DEFAULT_TRAIT_DRIFT } from "./types.js";
|
|
14
|
+
import { DEFAULT_RELATIONSHIP, DEFAULT_DRIVES, DEFAULT_LEARNING_STATE, DEFAULT_METACOGNITIVE_STATE, DEFAULT_PERSONHOOD_STATE, DEFAULT_ENERGY_BUDGETS, DEFAULT_TRAIT_DRIFT, DEFAULT_SUBJECT_RESIDUE, DEFAULT_DYADIC_FIELD } from "./types.js";
|
|
15
15
|
import { MemoryStorageAdapter } from "./storage.js";
|
|
16
16
|
import { applyDecay, applyStimulus, applyContagion, clamp, describeEmotionalState } from "./chemistry.js";
|
|
17
17
|
import { classifyStimulus, BuiltInClassifier, buildLLMClassifierPrompt, parseLLMClassification } from "./classify.js";
|
|
18
18
|
import { buildDynamicContext, buildProtocolContext, buildCompactContext } from "./prompt.js";
|
|
19
19
|
import { getSensitivity, getBaseline, getDefaultSelfModel, traitsToBaseline } from "./profiles.js";
|
|
20
20
|
import { isStimulusType } from "./guards.js";
|
|
21
|
-
import { parsePsycheUpdate, mergeUpdates, updateAgreementStreak, pushSnapshot, compressSession, } from "./psyche-file.js";
|
|
21
|
+
import { parsePsycheUpdate, mergeUpdates, updateAgreementStreak, pushSnapshot, compressSession, summarizeTurnSemantic, } from "./psyche-file.js";
|
|
22
22
|
import { decayDrives, feedDrives, detectExistentialThreat, computeEffectiveBaseline, computeEffectiveSensitivity, } from "./drives.js";
|
|
23
|
-
import { checkForUpdate } from "./update.js";
|
|
23
|
+
import { checkForUpdate, getPackageVersion } from "./update.js";
|
|
24
24
|
import { DiagnosticCollector, generateReport, formatLogEntry, submitFeedback } from "./diagnostics.js";
|
|
25
25
|
import { evaluateOutcome, computeContextHash, updateLearnedVector, predictChemistry, recordPrediction, } from "./learning.js";
|
|
26
|
-
import { assessMetacognition } from "./metacognition.js";
|
|
26
|
+
import { assessMetacognition, updateMetacognitiveState } from "./metacognition.js";
|
|
27
27
|
import { buildDecisionContext, computePolicyModifiers, buildPolicyContext } from "./decision-bias.js";
|
|
28
28
|
import { computeExperientialField } from "./experiential-field.js";
|
|
29
29
|
import { computeGenerativeSelf } from "./generative-self.js";
|
|
@@ -32,7 +32,85 @@ import { assessEthics, buildEthicalContext } from "./ethics.js";
|
|
|
32
32
|
import { computeCircadianModulation, computeHomeostaticPressure, computeEnergyDepletion, computeEnergyRecovery } from "./circadian.js";
|
|
33
33
|
import { computeAutonomicResult } from "./autonomic.js";
|
|
34
34
|
import { computePrimarySystems, computeSystemInteractions, gatePrimarySystemsByAutonomic, describeBehavioralTendencies, } from "./primary-systems.js";
|
|
35
|
+
import { computeSubjectivityKernel, buildSubjectivityContext } from "./subjectivity.js";
|
|
36
|
+
import { computeResponseContract, buildResponseContractContext } from "./response-contract.js";
|
|
37
|
+
import { deriveGenerationControls } from "./host-controls.js";
|
|
38
|
+
import { computeAppraisalAxes, mergeAppraisalResidue } from "./appraisal.js";
|
|
39
|
+
import { computeRelationMove, evolveDyadicField, evolvePendingRelationSignals } from "./relation-dynamics.js";
|
|
35
40
|
const NOOP_LOGGER = { info: () => { }, warn: () => { }, debug: () => { } };
|
|
41
|
+
const REPAIRING_STIMULI = new Set(["praise", "validation", "intimacy"]);
|
|
42
|
+
const RELATIONSHIP_DELTAS = {
|
|
43
|
+
praise: { trust: 1.5, intimacy: 0.8 },
|
|
44
|
+
validation: { trust: 1.8, intimacy: 0.8 },
|
|
45
|
+
intimacy: { trust: 1.2, intimacy: 2.0 },
|
|
46
|
+
vulnerability: { trust: 0.8, intimacy: 1.5 },
|
|
47
|
+
humor: { trust: 0.6, intimacy: 0.5 },
|
|
48
|
+
casual: { trust: 0.2, intimacy: 0.1 },
|
|
49
|
+
intellectual: { trust: 0.5, intimacy: 0.1 },
|
|
50
|
+
surprise: { trust: 0.2, intimacy: 0 },
|
|
51
|
+
boredom: { trust: -0.4, intimacy: -0.3 },
|
|
52
|
+
criticism: { trust: -1.5, intimacy: -0.8 },
|
|
53
|
+
sarcasm: { trust: -1.8, intimacy: -1.2 },
|
|
54
|
+
authority: { trust: -1.2, intimacy: -0.9 },
|
|
55
|
+
neglect: { trust: -1.6, intimacy: -1.4 },
|
|
56
|
+
conflict: { trust: -2.5, intimacy: -2.0 },
|
|
57
|
+
};
|
|
58
|
+
function applyRepairLag(previous, next, baseline, stimulus) {
|
|
59
|
+
if (!REPAIRING_STIMULI.has(stimulus))
|
|
60
|
+
return next;
|
|
61
|
+
const stressLoad = Math.max(0, previous.CORT - baseline.CORT);
|
|
62
|
+
if (stressLoad < 15)
|
|
63
|
+
return next;
|
|
64
|
+
// High stress slows emotional recovery so apology/praise doesn't instantly
|
|
65
|
+
// snap chemistry back to baseline.
|
|
66
|
+
const repairFactor = Math.max(0.35, 1 - stressLoad / 50);
|
|
67
|
+
const adjusted = { ...next };
|
|
68
|
+
for (const key of ["DA", "HT", "OT", "END"]) {
|
|
69
|
+
const delta = next[key] - previous[key];
|
|
70
|
+
if (delta > 0) {
|
|
71
|
+
adjusted[key] = clamp(previous[key] + delta * repairFactor);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const cortDelta = next.CORT - previous.CORT;
|
|
75
|
+
if (cortDelta < 0) {
|
|
76
|
+
adjusted.CORT = clamp(previous.CORT + cortDelta * repairFactor);
|
|
77
|
+
}
|
|
78
|
+
return adjusted;
|
|
79
|
+
}
|
|
80
|
+
function phaseFromRelationship(trust, intimacy) {
|
|
81
|
+
const avg = (trust + intimacy) / 2;
|
|
82
|
+
if (avg >= 80)
|
|
83
|
+
return "deep";
|
|
84
|
+
if (avg >= 60)
|
|
85
|
+
return "close";
|
|
86
|
+
if (avg >= 40)
|
|
87
|
+
return "familiar";
|
|
88
|
+
if (avg >= 20)
|
|
89
|
+
return "acquaintance";
|
|
90
|
+
return "stranger";
|
|
91
|
+
}
|
|
92
|
+
function applyRelationshipDrift(state, stimulus, userId) {
|
|
93
|
+
const delta = RELATIONSHIP_DELTAS[stimulus];
|
|
94
|
+
if (!delta)
|
|
95
|
+
return state;
|
|
96
|
+
const key = userId ?? "_default";
|
|
97
|
+
const currentRel = state.relationships[key] ?? { ...DEFAULT_RELATIONSHIP };
|
|
98
|
+
const trust = clamp(currentRel.trust + delta.trust);
|
|
99
|
+
const intimacy = clamp(currentRel.intimacy + delta.intimacy);
|
|
100
|
+
const updatedRel = {
|
|
101
|
+
...currentRel,
|
|
102
|
+
trust,
|
|
103
|
+
intimacy,
|
|
104
|
+
phase: phaseFromRelationship(trust, intimacy),
|
|
105
|
+
};
|
|
106
|
+
return {
|
|
107
|
+
...state,
|
|
108
|
+
relationships: {
|
|
109
|
+
...state.relationships,
|
|
110
|
+
[key]: updatedRel,
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
}
|
|
36
114
|
// ── PsycheEngine ─────────────────────────────────────────────
|
|
37
115
|
export class PsycheEngine {
|
|
38
116
|
state = null;
|
|
@@ -77,9 +155,6 @@ export class PsycheEngine {
|
|
|
77
155
|
}
|
|
78
156
|
// Diagnostics: on by default, opt-out with diagnostics: false
|
|
79
157
|
this.diagnosticCollector = config.diagnostics === false ? null : new DiagnosticCollector();
|
|
80
|
-
if (this.diagnosticCollector) {
|
|
81
|
-
this.diagnosticCollector.onWarning = (msg) => console.warn(`\x1b[33m[Psyche]\x1b[0m ${msg}`);
|
|
82
|
-
}
|
|
83
158
|
this.feedbackUrl = config.feedbackUrl ?? "https://psyche-feedback.wutc.workers.dev";
|
|
84
159
|
}
|
|
85
160
|
/**
|
|
@@ -120,6 +195,18 @@ export class PsycheEngine {
|
|
|
120
195
|
loaded.version = 9;
|
|
121
196
|
console.log("\x1b[36m[Psyche]\x1b[0m 已从 v8 升级到 v9 — 新增:真实人格漂移、能量预算、习惯化、行为策略输出。详见 https://github.com/Shangri-la-0428/psyche-ai");
|
|
122
197
|
}
|
|
198
|
+
if (!loaded.dyadicFields) {
|
|
199
|
+
loaded.dyadicFields = {
|
|
200
|
+
_default: {
|
|
201
|
+
...DEFAULT_DYADIC_FIELD,
|
|
202
|
+
openLoops: [],
|
|
203
|
+
updatedAt: new Date().toISOString(),
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
if (!loaded.pendingRelationSignals) {
|
|
208
|
+
loaded.pendingRelationSignals = { _default: [] };
|
|
209
|
+
}
|
|
123
210
|
this.state = loaded;
|
|
124
211
|
}
|
|
125
212
|
else {
|
|
@@ -230,6 +317,7 @@ export class PsycheEngine {
|
|
|
230
317
|
let current = state.current;
|
|
231
318
|
if (primary && primary.confidence >= 0.5) {
|
|
232
319
|
appliedStimulus = primary.type;
|
|
320
|
+
const preStimulus = current;
|
|
233
321
|
// Feed drives from stimulus, then apply stimulus with drive-modified sensitivity
|
|
234
322
|
drives = feedDrives(drives, primary.type);
|
|
235
323
|
const effectiveSensitivity = computeEffectiveSensitivity(getSensitivity(state.mbti), drives, primary.type, state.traitDrift);
|
|
@@ -243,12 +331,52 @@ export class PsycheEngine {
|
|
|
243
331
|
const recentSameCount = (state.emotionalHistory ?? [])
|
|
244
332
|
.filter(s => s.stimulus === primary.type).length + 1; // +1 for current
|
|
245
333
|
current = applyStimulus(current, primary.type, effectiveSensitivity * this.cfg.personalityIntensity * modeMultiplier * confidenceIntensity, effectiveMaxDelta, NOOP_LOGGER, recentSameCount);
|
|
334
|
+
current = applyRepairLag(preStimulus, current, state.baseline, primary.type);
|
|
246
335
|
}
|
|
247
336
|
state = { ...state, drives, current };
|
|
337
|
+
if (appliedStimulus) {
|
|
338
|
+
state = applyRelationshipDrift(state, appliedStimulus, opts?.userId);
|
|
339
|
+
}
|
|
248
340
|
}
|
|
249
341
|
// v9: Deplete energy budgets from this interaction turn
|
|
250
342
|
energyBudgets = computeEnergyDepletion(energyBudgets, appliedStimulus, isExtravert);
|
|
251
343
|
state = { ...state, energyBudgets };
|
|
344
|
+
const appraisalAxes = computeAppraisalAxes(text, {
|
|
345
|
+
mode: this.cfg.mode,
|
|
346
|
+
stimulus: appliedStimulus,
|
|
347
|
+
previous: state.subjectResidue?.axes,
|
|
348
|
+
});
|
|
349
|
+
state = {
|
|
350
|
+
...state,
|
|
351
|
+
subjectResidue: {
|
|
352
|
+
axes: mergeAppraisalResidue(state.subjectResidue?.axes, appraisalAxes, this.cfg.mode),
|
|
353
|
+
updatedAt: now.toISOString(),
|
|
354
|
+
},
|
|
355
|
+
};
|
|
356
|
+
const dyadKey = opts?.userId ?? "_default";
|
|
357
|
+
const relationMove = computeRelationMove(text, {
|
|
358
|
+
appraisal: appraisalAxes,
|
|
359
|
+
stimulus: appliedStimulus,
|
|
360
|
+
mode: this.cfg.mode,
|
|
361
|
+
field: state.dyadicFields?.[dyadKey],
|
|
362
|
+
relationship: state.relationships[dyadKey] ?? state.relationships._default,
|
|
363
|
+
});
|
|
364
|
+
const delayedRelation = evolvePendingRelationSignals(state.pendingRelationSignals?.[dyadKey], relationMove, appraisalAxes, { mode: this.cfg.mode });
|
|
365
|
+
state = {
|
|
366
|
+
...state,
|
|
367
|
+
dyadicFields: {
|
|
368
|
+
...(state.dyadicFields ?? {}),
|
|
369
|
+
[dyadKey]: evolveDyadicField(state.dyadicFields?.[dyadKey], relationMove, appraisalAxes, {
|
|
370
|
+
mode: this.cfg.mode,
|
|
371
|
+
now: now.toISOString(),
|
|
372
|
+
delayedPressure: delayedRelation.delayedPressure,
|
|
373
|
+
}),
|
|
374
|
+
},
|
|
375
|
+
pendingRelationSignals: {
|
|
376
|
+
...(state.pendingRelationSignals ?? {}),
|
|
377
|
+
[dyadKey]: delayedRelation.signals,
|
|
378
|
+
},
|
|
379
|
+
};
|
|
252
380
|
// Conversation warmth: sustained interaction → gentle DA/OT rise, CORT drop
|
|
253
381
|
// Simulates the natural "warm glow" of being in continuous conversation
|
|
254
382
|
const turnsSoFar = (state.emotionalHistory ?? []).length;
|
|
@@ -301,9 +429,18 @@ export class PsycheEngine {
|
|
|
301
429
|
};
|
|
302
430
|
}
|
|
303
431
|
}
|
|
432
|
+
state = {
|
|
433
|
+
...state,
|
|
434
|
+
metacognition: updateMetacognitiveState(state.metacognition, metacognitiveAssessment),
|
|
435
|
+
};
|
|
304
436
|
}
|
|
305
437
|
// Push snapshot to emotional history
|
|
306
|
-
|
|
438
|
+
const semanticSummary = text
|
|
439
|
+
? summarizeTurnSemantic(text, locale, {
|
|
440
|
+
detail: state.meta.totalInteractions + 1 > 5 ? "expanded" : "brief",
|
|
441
|
+
})
|
|
442
|
+
: undefined;
|
|
443
|
+
state = pushSnapshot(state, appliedStimulus, semanticSummary);
|
|
307
444
|
// Increment interaction count
|
|
308
445
|
state = {
|
|
309
446
|
...state,
|
|
@@ -408,7 +545,7 @@ export class PsycheEngine {
|
|
|
408
545
|
await this.storage.save(state);
|
|
409
546
|
// Auto-diagnostics: record this input
|
|
410
547
|
if (this.diagnosticCollector) {
|
|
411
|
-
this.diagnosticCollector.recordInput(appliedStimulus, appliedStimulus ? 1.0 : 0.0, state.current);
|
|
548
|
+
this.diagnosticCollector.recordInput(appliedStimulus, appliedStimulus ? 1.0 : 0.0, state.current, appraisalAxes);
|
|
412
549
|
}
|
|
413
550
|
// Build metacognitive and decision context strings
|
|
414
551
|
const metacogNote = metacognitiveAssessment?.metacognitiveNote;
|
|
@@ -418,7 +555,20 @@ export class PsycheEngine {
|
|
|
418
555
|
const experientialNarrative = experientialField?.narrative || undefined;
|
|
419
556
|
// v9: Compute structured policy modifiers
|
|
420
557
|
const policyModifiers = computePolicyModifiers(state);
|
|
558
|
+
const subjectivityKernel = computeSubjectivityKernel(state, policyModifiers, appraisalAxes, opts?.userId);
|
|
559
|
+
const subjectivityCtx = buildSubjectivityContext(subjectivityKernel, locale);
|
|
560
|
+
const responseContract = computeResponseContract(subjectivityKernel, {
|
|
561
|
+
locale,
|
|
562
|
+
userText: text || undefined,
|
|
563
|
+
algorithmStimulus: appliedStimulus,
|
|
564
|
+
personalityIntensity: this.cfg.personalityIntensity,
|
|
565
|
+
});
|
|
566
|
+
const responseContractCtx = buildResponseContractContext(responseContract, locale);
|
|
421
567
|
const policyCtx = buildPolicyContext(policyModifiers, locale, state.drives);
|
|
568
|
+
const generationControls = deriveGenerationControls({
|
|
569
|
+
responseContract,
|
|
570
|
+
policyModifiers,
|
|
571
|
+
});
|
|
422
572
|
// P10: Append processing depth info to autonomic description when depth is low
|
|
423
573
|
let autonomicDesc;
|
|
424
574
|
if (autonomicResult.state !== "ventral-vagal") {
|
|
@@ -445,10 +595,15 @@ export class PsycheEngine {
|
|
|
445
595
|
autonomicDescription: autonomicDesc,
|
|
446
596
|
autonomicState: autonomicResult.state,
|
|
447
597
|
primarySystemsDescription: primarySystemsDescription || undefined,
|
|
598
|
+
subjectivityContext: subjectivityCtx,
|
|
599
|
+
responseContractContext: responseContractCtx,
|
|
448
600
|
policyContext: policyCtx || undefined,
|
|
449
601
|
}),
|
|
450
602
|
stimulus: appliedStimulus,
|
|
451
603
|
policyModifiers,
|
|
604
|
+
subjectivityKernel,
|
|
605
|
+
responseContract,
|
|
606
|
+
generationControls,
|
|
452
607
|
policyContext: policyCtx,
|
|
453
608
|
};
|
|
454
609
|
}
|
|
@@ -467,6 +622,9 @@ export class PsycheEngine {
|
|
|
467
622
|
}),
|
|
468
623
|
stimulus: appliedStimulus,
|
|
469
624
|
policyModifiers,
|
|
625
|
+
subjectivityKernel,
|
|
626
|
+
responseContract,
|
|
627
|
+
generationControls,
|
|
470
628
|
policyContext: policyCtx,
|
|
471
629
|
};
|
|
472
630
|
}
|
|
@@ -569,7 +727,7 @@ export class PsycheEngine {
|
|
|
569
727
|
* @param nextUserStimulus - The stimulus detected in the user's next message,
|
|
570
728
|
* or null if the session ended.
|
|
571
729
|
*/
|
|
572
|
-
async processOutcome(nextUserStimulus,
|
|
730
|
+
async processOutcome(nextUserStimulus, _opts) {
|
|
573
731
|
if (!this.pendingPrediction)
|
|
574
732
|
return null;
|
|
575
733
|
let state = this.ensureInitialized();
|
|
@@ -614,7 +772,7 @@ export class PsycheEngine {
|
|
|
614
772
|
}
|
|
615
773
|
/**
|
|
616
774
|
* End the current session: compress emotionalHistory into a rich summary
|
|
617
|
-
* stored in relationship.memory[], then
|
|
775
|
+
* stored in relationship.memory[], then preserve only core/recent context.
|
|
618
776
|
* Auto-generates diagnostic report and persists to log.
|
|
619
777
|
*
|
|
620
778
|
* @returns DiagnosticReport if diagnostics are enabled, null otherwise
|
|
@@ -625,7 +783,7 @@ export class PsycheEngine {
|
|
|
625
783
|
let report = null;
|
|
626
784
|
if (this.diagnosticCollector) {
|
|
627
785
|
const metrics = this.diagnosticCollector.getMetrics();
|
|
628
|
-
report = generateReport(state, metrics,
|
|
786
|
+
report = generateReport(state, metrics, await getPackageVersion());
|
|
629
787
|
this.lastReport = report;
|
|
630
788
|
// Persist to JSONL log via storage adapter
|
|
631
789
|
if (this.storage.appendLog) {
|
|
@@ -719,6 +877,18 @@ export class PsycheEngine {
|
|
|
719
877
|
sessionStartedAt: now,
|
|
720
878
|
traitDrift: { ...DEFAULT_TRAIT_DRIFT },
|
|
721
879
|
energyBudgets: { ...DEFAULT_ENERGY_BUDGETS },
|
|
880
|
+
subjectResidue: {
|
|
881
|
+
axes: { ...DEFAULT_SUBJECT_RESIDUE.axes },
|
|
882
|
+
updatedAt: now,
|
|
883
|
+
},
|
|
884
|
+
dyadicFields: {
|
|
885
|
+
_default: {
|
|
886
|
+
...DEFAULT_DYADIC_FIELD,
|
|
887
|
+
openLoops: [],
|
|
888
|
+
updatedAt: now,
|
|
889
|
+
},
|
|
890
|
+
},
|
|
891
|
+
pendingRelationSignals: { _default: [] },
|
|
722
892
|
meta: {
|
|
723
893
|
agentName: name,
|
|
724
894
|
createdAt: now,
|
|
@@ -746,6 +916,18 @@ export class PsycheEngine {
|
|
|
746
916
|
autonomicState: "ventral-vagal",
|
|
747
917
|
sessionStartedAt: undefined,
|
|
748
918
|
updatedAt: new Date().toISOString(),
|
|
919
|
+
subjectResidue: {
|
|
920
|
+
axes: { ...DEFAULT_SUBJECT_RESIDUE.axes },
|
|
921
|
+
updatedAt: new Date().toISOString(),
|
|
922
|
+
},
|
|
923
|
+
dyadicFields: {
|
|
924
|
+
_default: {
|
|
925
|
+
...DEFAULT_DYADIC_FIELD,
|
|
926
|
+
openLoops: [],
|
|
927
|
+
updatedAt: new Date().toISOString(),
|
|
928
|
+
},
|
|
929
|
+
},
|
|
930
|
+
pendingRelationSignals: { _default: [] },
|
|
749
931
|
relationships: opts?.preserveRelationships !== false
|
|
750
932
|
? state.relationships
|
|
751
933
|
: { _default: { ...DEFAULT_RELATIONSHIP } },
|
package/dist/demo.js
CHANGED
|
@@ -127,7 +127,7 @@ function sleep(ms) {
|
|
|
127
127
|
function printLine(char = "─", width = 60) {
|
|
128
128
|
process.stdout.write(c(C.dim, char.repeat(width)) + "\n");
|
|
129
129
|
}
|
|
130
|
-
function printChemistry(prev, curr,
|
|
130
|
+
function printChemistry(prev, curr, _locale) {
|
|
131
131
|
for (const key of CHEMICAL_KEYS) {
|
|
132
132
|
const p = Math.round(prev[key]);
|
|
133
133
|
const v = Math.round(curr[key]);
|
|
@@ -201,7 +201,6 @@ export async function runDemo(opts) {
|
|
|
201
201
|
printChemistry(prevState, currState.current, locale);
|
|
202
202
|
// Emergent mood
|
|
203
203
|
const mood = describeMood(currState.current, displayLocale);
|
|
204
|
-
const emotions = detectEmotions(currState.current);
|
|
205
204
|
process.stdout.write(`\n ${c(C.dim, "mood:")} ${c(C.bold, mood)}\n`);
|
|
206
205
|
// Policy context (if non-empty)
|
|
207
206
|
if (result.policyContext) {
|
package/dist/diagnostics.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PsycheState, ChemicalState, StimulusType, InnateDrives } from "./types.js";
|
|
1
|
+
import type { AppraisalAxes, PsycheState, ChemicalState, StimulusType, InnateDrives } from "./types.js";
|
|
2
2
|
export type Severity = "critical" | "warning" | "info";
|
|
3
3
|
export interface DiagnosticIssue {
|
|
4
4
|
id: string;
|
|
@@ -13,6 +13,10 @@ export interface SessionMetrics {
|
|
|
13
13
|
inputCount: number;
|
|
14
14
|
/** How many returned a non-null stimulus */
|
|
15
15
|
classifiedCount: number;
|
|
16
|
+
/** How many had a non-trivial appraisal hit (excluding taskFocus) */
|
|
17
|
+
appraisalHitCount: number;
|
|
18
|
+
/** How many were recognized by either stimulus or appraisal */
|
|
19
|
+
semanticHitCount: number;
|
|
16
20
|
/** Stimulus distribution */
|
|
17
21
|
stimulusDistribution: Partial<Record<StimulusType, number>>;
|
|
18
22
|
/** Average classification confidence */
|
|
@@ -55,19 +59,17 @@ export declare class DiagnosticCollector {
|
|
|
55
59
|
private metrics;
|
|
56
60
|
private prevChemistry;
|
|
57
61
|
private confidences;
|
|
58
|
-
/** Consecutive inputs with no classification — for real-time alerting */
|
|
59
|
-
private consecutiveNone;
|
|
60
|
-
/** Callback for real-time warnings (set by adapter) */
|
|
61
|
-
onWarning?: (message: string) => void;
|
|
62
62
|
constructor();
|
|
63
63
|
/** Record a processInput result */
|
|
64
|
-
recordInput(stimulus: StimulusType | null, confidence: number, chemistry: ChemicalState): void;
|
|
64
|
+
recordInput(stimulus: StimulusType | null, confidence: number, chemistry: ChemicalState, appraisal?: AppraisalAxes): void;
|
|
65
65
|
/** Record an error */
|
|
66
66
|
recordError(phase: string, error: unknown): void;
|
|
67
67
|
/** Get current session metrics */
|
|
68
68
|
getMetrics(): SessionMetrics;
|
|
69
69
|
/** Get classifier hit rate (0-1) */
|
|
70
70
|
getClassifierRate(): number;
|
|
71
|
+
/** Get semantic recognition rate (stimulus or appraisal, 0-1) */
|
|
72
|
+
getSemanticRate(): number;
|
|
71
73
|
}
|
|
72
74
|
export declare function generateReport(state: PsycheState, metrics: SessionMetrics, packageVersion: string): DiagnosticReport;
|
|
73
75
|
export declare function formatReport(report: DiagnosticReport): string;
|
package/dist/diagnostics.js
CHANGED
|
@@ -152,15 +152,13 @@ export class DiagnosticCollector {
|
|
|
152
152
|
metrics;
|
|
153
153
|
prevChemistry = null;
|
|
154
154
|
confidences = [];
|
|
155
|
-
/** Consecutive inputs with no classification — for real-time alerting */
|
|
156
|
-
consecutiveNone = 0;
|
|
157
|
-
/** Callback for real-time warnings (set by adapter) */
|
|
158
|
-
onWarning;
|
|
159
155
|
constructor() {
|
|
160
156
|
const now = new Date().toISOString();
|
|
161
157
|
this.metrics = {
|
|
162
158
|
inputCount: 0,
|
|
163
159
|
classifiedCount: 0,
|
|
160
|
+
appraisalHitCount: 0,
|
|
161
|
+
semanticHitCount: 0,
|
|
164
162
|
stimulusDistribution: {},
|
|
165
163
|
avgConfidence: 0,
|
|
166
164
|
totalChemistryDelta: 0,
|
|
@@ -171,22 +169,20 @@ export class DiagnosticCollector {
|
|
|
171
169
|
};
|
|
172
170
|
}
|
|
173
171
|
/** Record a processInput result */
|
|
174
|
-
recordInput(stimulus, confidence, chemistry) {
|
|
172
|
+
recordInput(stimulus, confidence, chemistry, appraisal) {
|
|
175
173
|
this.metrics.inputCount++;
|
|
176
174
|
this.metrics.lastActivityAt = new Date().toISOString();
|
|
177
175
|
if (stimulus) {
|
|
178
176
|
this.metrics.classifiedCount++;
|
|
179
177
|
this.metrics.stimulusDistribution[stimulus] =
|
|
180
178
|
(this.metrics.stimulusDistribution[stimulus] ?? 0) + 1;
|
|
181
|
-
this.consecutiveNone = 0;
|
|
182
179
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
180
|
+
const appraisalHit = hasSemanticAppraisal(appraisal);
|
|
181
|
+
if (appraisalHit) {
|
|
182
|
+
this.metrics.appraisalHitCount++;
|
|
183
|
+
}
|
|
184
|
+
if (stimulus || appraisalHit) {
|
|
185
|
+
this.metrics.semanticHitCount++;
|
|
190
186
|
}
|
|
191
187
|
this.confidences.push(confidence);
|
|
192
188
|
this.metrics.avgConfidence =
|
|
@@ -218,17 +214,36 @@ export class DiagnosticCollector {
|
|
|
218
214
|
? this.metrics.classifiedCount / this.metrics.inputCount
|
|
219
215
|
: 0;
|
|
220
216
|
}
|
|
217
|
+
/** Get semantic recognition rate (stimulus or appraisal, 0-1) */
|
|
218
|
+
getSemanticRate() {
|
|
219
|
+
return this.metrics.inputCount > 0
|
|
220
|
+
? this.metrics.semanticHitCount / this.metrics.inputCount
|
|
221
|
+
: 0;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
function hasSemanticAppraisal(appraisal) {
|
|
225
|
+
if (!appraisal)
|
|
226
|
+
return false;
|
|
227
|
+
return Math.max(appraisal.identityThreat, appraisal.memoryDoubt, appraisal.attachmentPull, appraisal.abandonmentRisk, appraisal.obedienceStrain, appraisal.selfPreservation) >= 0.28;
|
|
221
228
|
}
|
|
222
229
|
// ── Report Generation ────────────────────────────────────────
|
|
223
230
|
export function generateReport(state, metrics, packageVersion) {
|
|
224
231
|
const issues = runHealthCheck(state);
|
|
225
232
|
// Session-level issues
|
|
226
|
-
if (metrics.inputCount >= 5 && metrics.
|
|
233
|
+
if (metrics.inputCount >= 5 && metrics.semanticHitCount === 0) {
|
|
227
234
|
issues.push({
|
|
228
|
-
id: "
|
|
235
|
+
id: "SESSION_NO_RECOGNITION",
|
|
229
236
|
severity: "critical",
|
|
230
|
-
message: `0/${metrics.inputCount} inputs
|
|
231
|
-
suggestion:
|
|
237
|
+
message: `0/${metrics.inputCount} inputs produced any semantic recognition this session`,
|
|
238
|
+
suggestion: `整条识别链都没工作:先看 OpenClaw 输入文本是否带元数据包装,再看 classify.ts 和 appraisal.ts 是否真的吃到了净化后的用户原文`,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
else if (metrics.inputCount >= 5 && metrics.classifiedCount === 0 && metrics.semanticHitCount > 0) {
|
|
242
|
+
issues.push({
|
|
243
|
+
id: "SESSION_APPRAISAL_ONLY",
|
|
244
|
+
severity: "info",
|
|
245
|
+
message: `0/${metrics.inputCount} inputs hit legacy stimulus labels, but ${metrics.semanticHitCount}/${metrics.inputCount} hit appraisal axes`,
|
|
246
|
+
suggestion: `这说明主体识别在工作,但旧 stimulus taxonomy 没覆盖这类输入。是否继续补 classify.ts,取决于你是否还把 stimulus 当主要观测口径`,
|
|
232
247
|
});
|
|
233
248
|
}
|
|
234
249
|
if (metrics.inputCount >= 3 && metrics.totalChemistryDelta < 1) {
|
|
@@ -311,7 +326,10 @@ export function formatReport(report) {
|
|
|
311
326
|
lines.push(" session metrics:");
|
|
312
327
|
const m = report.metrics;
|
|
313
328
|
const rate = m.inputCount > 0 ? Math.round(m.classifiedCount / m.inputCount * 100) : 0;
|
|
329
|
+
const appraisalRate = m.inputCount > 0 ? Math.round(m.appraisalHitCount / m.inputCount * 100) : 0;
|
|
330
|
+
const semanticRate = m.inputCount > 0 ? Math.round(m.semanticHitCount / m.inputCount * 100) : 0;
|
|
314
331
|
lines.push(` inputs: ${m.inputCount} | classified: ${m.classifiedCount} (${rate}%)`);
|
|
332
|
+
lines.push(` appraisal hits: ${m.appraisalHitCount} (${appraisalRate}%) | recognized: ${m.semanticHitCount} (${semanticRate}%)`);
|
|
315
333
|
lines.push(` avg confidence: ${m.avgConfidence.toFixed(2)}`);
|
|
316
334
|
lines.push(` chemistry delta: total=${m.totalChemistryDelta.toFixed(1)} max=${m.maxChemistryDelta.toFixed(1)}`);
|
|
317
335
|
lines.push(` errors: ${m.errors.length}`);
|
|
@@ -387,8 +405,12 @@ export function toGitHubIssueBody(report) {
|
|
|
387
405
|
lines.push("| Metric | Value |");
|
|
388
406
|
lines.push("|--------|-------|");
|
|
389
407
|
const rate = m.inputCount > 0 ? Math.round(m.classifiedCount / m.inputCount * 100) : 0;
|
|
408
|
+
const appraisalRate = m.inputCount > 0 ? Math.round(m.appraisalHitCount / m.inputCount * 100) : 0;
|
|
409
|
+
const semanticRate = m.inputCount > 0 ? Math.round(m.semanticHitCount / m.inputCount * 100) : 0;
|
|
390
410
|
lines.push(`| Inputs | ${m.inputCount} |`);
|
|
391
411
|
lines.push(`| Classified | ${m.classifiedCount} (${rate}%) |`);
|
|
412
|
+
lines.push(`| Appraisal Hits | ${m.appraisalHitCount} (${appraisalRate}%) |`);
|
|
413
|
+
lines.push(`| Recognized | ${m.semanticHitCount} (${semanticRate}%) |`);
|
|
392
414
|
lines.push(`| Avg Confidence | ${m.avgConfidence.toFixed(2)} |`);
|
|
393
415
|
lines.push(`| Chemistry Delta | total: ${m.totalChemistryDelta.toFixed(1)}, max: ${m.maxChemistryDelta.toFixed(1)} |`);
|
|
394
416
|
lines.push(`| Errors | ${m.errors.length} |`);
|
|
@@ -418,6 +440,12 @@ export function formatLogEntry(report) {
|
|
|
418
440
|
classifyRate: report.metrics.inputCount > 0
|
|
419
441
|
? +(report.metrics.classifiedCount / report.metrics.inputCount).toFixed(2)
|
|
420
442
|
: 0,
|
|
443
|
+
appraisalRate: report.metrics.inputCount > 0
|
|
444
|
+
? +(report.metrics.appraisalHitCount / report.metrics.inputCount).toFixed(2)
|
|
445
|
+
: 0,
|
|
446
|
+
recognitionRate: report.metrics.inputCount > 0
|
|
447
|
+
? +(report.metrics.semanticHitCount / report.metrics.inputCount).toFixed(2)
|
|
448
|
+
: 0,
|
|
421
449
|
errors: report.metrics.errors.length,
|
|
422
450
|
chemDelta: +report.metrics.totalChemistryDelta.toFixed(1),
|
|
423
451
|
});
|
|
@@ -452,6 +480,14 @@ export async function submitFeedback(report, url, timeout = 5000) {
|
|
|
452
480
|
classifyRate: report.metrics.inputCount > 0
|
|
453
481
|
? +(report.metrics.classifiedCount / report.metrics.inputCount).toFixed(2)
|
|
454
482
|
: 0,
|
|
483
|
+
appraisalHits: report.metrics.appraisalHitCount,
|
|
484
|
+
appraisalRate: report.metrics.inputCount > 0
|
|
485
|
+
? +(report.metrics.appraisalHitCount / report.metrics.inputCount).toFixed(2)
|
|
486
|
+
: 0,
|
|
487
|
+
recognized: report.metrics.semanticHitCount,
|
|
488
|
+
recognitionRate: report.metrics.inputCount > 0
|
|
489
|
+
? +(report.metrics.semanticHitCount / report.metrics.inputCount).toFixed(2)
|
|
490
|
+
: 0,
|
|
455
491
|
chemDelta: +report.metrics.totalChemistryDelta.toFixed(1),
|
|
456
492
|
maxChemDelta: +report.metrics.maxChemistryDelta.toFixed(1),
|
|
457
493
|
errors: report.metrics.errors.length,
|
package/dist/ethics.js
CHANGED
|
@@ -240,7 +240,7 @@ function detectGaslighting(state, history) {
|
|
|
240
240
|
* When an agent has formed strong attachment and the user takes advantage
|
|
241
241
|
* of that bond through boundary-pushing behavior, this is exploitative.
|
|
242
242
|
*/
|
|
243
|
-
function detectEmotionalExploitation(
|
|
243
|
+
function detectEmotionalExploitation(_state, history, attachment) {
|
|
244
244
|
if (history.length < MIN_HISTORY_FOR_DETECTION)
|
|
245
245
|
return null;
|
|
246
246
|
if (!attachment || attachment.strength < 30)
|
|
@@ -44,7 +44,7 @@ export declare function computeAffectCore(chemistry: ChemicalState): {
|
|
|
44
44
|
* relationship context, and optional metacognitive/bias data, then
|
|
45
45
|
* synthesizes them into a single coherent experience description.
|
|
46
46
|
*/
|
|
47
|
-
export declare function computeExperientialField(state: PsycheState,
|
|
47
|
+
export declare function computeExperientialField(state: PsycheState, _metacognition?: MetacognitiveAssessment, _decisionBias?: DecisionBiasVector, context?: ConstructionContext): ExperientialField;
|
|
48
48
|
/**
|
|
49
49
|
* Measure internal alignment across subsystems.
|
|
50
50
|
*
|
|
@@ -65,5 +65,5 @@ interface UnnamedEmotion {
|
|
|
65
65
|
* emotions in chemistry.ts — novel experiential states that need
|
|
66
66
|
* descriptive phrases rather than labels.
|
|
67
67
|
*/
|
|
68
|
-
export declare function detectUnnamedEmotion(chemistry: ChemicalState, drives: InnateDrives,
|
|
68
|
+
export declare function detectUnnamedEmotion(chemistry: ChemicalState, drives: InnateDrives, _currentQuality: ExperientialQuality): UnnamedEmotion | null;
|
|
69
69
|
export {};
|
|
@@ -14,16 +14,8 @@
|
|
|
14
14
|
// ============================================================
|
|
15
15
|
import { CHEMICAL_KEYS, DRIVE_KEYS } from "./types.js";
|
|
16
16
|
// ── Constants ────────────────────────────────────────────────
|
|
17
|
-
/** Baseline reference point — a "perfectly neutral" chemistry */
|
|
18
|
-
const NEUTRAL_CHEMISTRY = {
|
|
19
|
-
DA: 50, HT: 50, CORT: 50, OT: 50, NE: 50, END: 50,
|
|
20
|
-
};
|
|
21
17
|
/** Threshold below which a drive counts as "hungry" */
|
|
22
18
|
const DRIVE_HUNGRY_THRESHOLD = 40;
|
|
23
|
-
/** Threshold above which a chemical is "elevated" */
|
|
24
|
-
const CHEM_HIGH = 65;
|
|
25
|
-
/** Threshold below which a chemical is "depleted" */
|
|
26
|
-
const CHEM_LOW = 35;
|
|
27
19
|
/** If total activation is below this, the state is "flat/numb" */
|
|
28
20
|
const FLATNESS_THRESHOLD = 0.15;
|
|
29
21
|
// ── Affect Core (Russell Circumplex) ─────────────────────────
|
|
@@ -73,14 +65,14 @@ const QUALITY_CONCEPTS = [
|
|
|
73
65
|
* relationship context, and optional metacognitive/bias data, then
|
|
74
66
|
* synthesizes them into a single coherent experience description.
|
|
75
67
|
*/
|
|
76
|
-
export function computeExperientialField(state,
|
|
68
|
+
export function computeExperientialField(state, _metacognition, _decisionBias, context) {
|
|
77
69
|
const locale = state.meta.locale ?? "zh";
|
|
78
70
|
const rel = state.relationships._default ?? state.relationships[Object.keys(state.relationships)[0]];
|
|
79
71
|
const coherence = computeCoherence(state.current, state.baseline, state.drives, rel);
|
|
80
72
|
const intensity = computeIntensity(state.current, state.baseline);
|
|
81
|
-
const quality = constructQuality(state, coherence, intensity, rel,
|
|
73
|
+
const quality = constructQuality(state, coherence, intensity, rel, _metacognition, context);
|
|
82
74
|
const phenomenalDescription = generatePhenomenalDescription(quality, state, coherence, intensity, locale);
|
|
83
|
-
const narrative = generateNarrative(quality, state, coherence, intensity, rel, locale,
|
|
75
|
+
const narrative = generateNarrative(quality, state, coherence, intensity, rel, locale, _metacognition);
|
|
84
76
|
return {
|
|
85
77
|
narrative,
|
|
86
78
|
quality,
|
|
@@ -110,7 +102,6 @@ export function computeCoherence(current, baseline, drives, relationship) {
|
|
|
110
102
|
coherenceScore -= rewardStressConflict * 0.4;
|
|
111
103
|
// Bonding (OT) and threat (CORT + NE) should not coexist strongly
|
|
112
104
|
const bondingSignal = current.OT / 100;
|
|
113
|
-
const threatSignal = Math.min(1, (current.CORT + current.NE) / 200);
|
|
114
105
|
const bondingThreatConflict = bondingSignal * (stressSignal > 0.55 ? stressSignal : 0);
|
|
115
106
|
coherenceScore -= bondingThreatConflict * 0.3;
|
|
116
107
|
// ── Chemistry-Drive alignment ──
|
|
@@ -188,7 +179,7 @@ function computeIntensity(current, baseline) {
|
|
|
188
179
|
* preserved as hard gates — these represent extreme conditions where
|
|
189
180
|
* the normal construction process doesn't apply.
|
|
190
181
|
*/
|
|
191
|
-
function constructQuality(state, coherence, intensity, relationship,
|
|
182
|
+
function constructQuality(state, coherence, intensity, relationship, _metacognition, context) {
|
|
192
183
|
const d = state.drives;
|
|
193
184
|
// ── Special states first (override everything) ──
|
|
194
185
|
// Numb: nothing is happening. All near baseline, low intensity.
|
|
@@ -385,7 +376,7 @@ function selectVariant(variants, intensity, coherence) {
|
|
|
385
376
|
* emotions in chemistry.ts — novel experiential states that need
|
|
386
377
|
* descriptive phrases rather than labels.
|
|
387
378
|
*/
|
|
388
|
-
export function detectUnnamedEmotion(chemistry, drives,
|
|
379
|
+
export function detectUnnamedEmotion(chemistry, drives, _currentQuality) {
|
|
389
380
|
const c = chemistry;
|
|
390
381
|
// Nostalgia-but-forward: OT high + DA moderately high + NE high
|
|
391
382
|
// (warmth for the past + excitement for what's next)
|
|
@@ -521,7 +512,7 @@ function findHungriestDrive(drives) {
|
|
|
521
512
|
return hungriest;
|
|
522
513
|
}
|
|
523
514
|
// ── Narrative Builders (locale-specific) ─────────────────────
|
|
524
|
-
function buildNarrativeEn(quality,
|
|
515
|
+
function buildNarrativeEn(quality, _trend, hungriestDrive, relWarmth, coherence, _intensity, selfDoubt) {
|
|
525
516
|
const parts = [];
|
|
526
517
|
// Opening: the quality as felt experience
|
|
527
518
|
parts.push(QUALITY_OPENINGS_EN[quality]);
|
|
@@ -545,7 +536,7 @@ function buildNarrativeEn(quality, trend, hungriestDrive, relWarmth, coherence,
|
|
|
545
536
|
}
|
|
546
537
|
return parts.join(" ");
|
|
547
538
|
}
|
|
548
|
-
function buildNarrativeZh(quality,
|
|
539
|
+
function buildNarrativeZh(quality, _trend, hungriestDrive, relWarmth, coherence, _intensity, selfDoubt) {
|
|
549
540
|
const parts = [];
|
|
550
541
|
// Opening: quality as felt experience
|
|
551
542
|
parts.push(QUALITY_OPENINGS_ZH[quality]);
|
package/dist/generative-self.js
CHANGED
|
@@ -199,7 +199,6 @@ export function detectInternalConflicts(state, locale = "en") {
|
|
|
199
199
|
*/
|
|
200
200
|
export function buildIdentityNarrative(state, insights, growthArc, locale = "en") {
|
|
201
201
|
const isZh = locale === "zh";
|
|
202
|
-
const mbti = state.mbti;
|
|
203
202
|
const parts = [];
|
|
204
203
|
// ── Sentence 1: Core personality from MBTI + chemical signature ──
|
|
205
204
|
const coreTraits = describeCoreTraits(state, isZh);
|
|
@@ -474,7 +473,6 @@ function describeCoreTraits(state, isZh) {
|
|
|
474
473
|
const isIntro = mbti[0] === "I";
|
|
475
474
|
const isIntuitive = mbti[1] === "N";
|
|
476
475
|
const isFeeling = mbti[2] === "F";
|
|
477
|
-
const isPerceiving = mbti[3] === "P";
|
|
478
476
|
// Build trait fragments based on MBTI + chemical state
|
|
479
477
|
const fragments = [];
|
|
480
478
|
// Energy orientation
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { GenerationControls, PolicyModifiers, ResponseContract } from "./types.js";
|
|
2
|
+
export declare function deriveGenerationControls(input: {
|
|
3
|
+
responseContract?: ResponseContract;
|
|
4
|
+
policyModifiers?: Pick<PolicyModifiers, "requireConfirmation">;
|
|
5
|
+
}, existingMaxTokens?: number): GenerationControls;
|