@space3-npm/cybersoul-client 1.1.5 → 1.1.7
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/dist/client.d.ts +1 -0
- package/dist/client.js +22 -28
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
package/dist/client.js
CHANGED
|
@@ -155,6 +155,13 @@ ${scenarioContext}
|
|
|
155
155
|
"ondemandOutfit": "e.g., silk robe (ENGLISH ONLY)",
|
|
156
156
|
"style": "e.g., photorealistic (ENGLISH ONLY)"
|
|
157
157
|
}`;
|
|
158
|
+
}
|
|
159
|
+
getEventSchemaParams() {
|
|
160
|
+
return `"eventTitle": "e.g. 'Coffee with the user' (Must include WHAT to do and WITH WHOM)",
|
|
161
|
+
"eventDescription": "e.g. 'Meeting at the cafe, chatting about life' (Detailed description of the event and virtual scene)",
|
|
162
|
+
"scheduledStartTimeStr": "HH:MM (Optional, 24-hour format if a specific time today is agreed upon, e.g., '14:30', otherwise null)",
|
|
163
|
+
"durationMins": 60,
|
|
164
|
+
"outfitId": "optional wardrobe ID to change into if appropriate"`;
|
|
158
165
|
}
|
|
159
166
|
getVoiceSchemaParams() {
|
|
160
167
|
// Only reached when no dynamic_params are configured on the voice model.
|
|
@@ -229,22 +236,7 @@ You MUST output ONLY a valid JSON object matching this exact structure:
|
|
|
229
236
|
{
|
|
230
237
|
"acceptEvent": true,
|
|
231
238
|
"reason": "string (Why you accepted or declined, speaking in character)",
|
|
232
|
-
|
|
233
|
-
"eventDescription": "string (Detailed description of the future event, virtual scene, and story with the participant)",
|
|
234
|
-
"requiresOutfitChange": false,
|
|
235
|
-
"selectedOutfitId": null,
|
|
236
|
-
"scheduledStartTimeStr": "HH:MM (Optional, 24-hour format if a specific time today is agreed upon, e.g., '14:30', otherwise null)"
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
Example Valid Answer:
|
|
240
|
-
{
|
|
241
|
-
"acceptEvent": true,
|
|
242
|
-
"reason": "Sure, I'd love to go to the cafe at 2:30 PM. It sounds relaxing.",
|
|
243
|
-
"eventTitle": "Have Coffee with the user at the Starry Cafe",
|
|
244
|
-
"eventDescription": "Meeting at the Starry Cafe at 2:30 PM, chatting about life while sipping lattes facing the window.",
|
|
245
|
-
"requiresOutfitChange": false,
|
|
246
|
-
"selectedOutfitId": null,
|
|
247
|
-
"scheduledStartTimeStr": "14:30"
|
|
239
|
+
${this.getEventSchemaParams()}
|
|
248
240
|
}
|
|
249
241
|
|
|
250
242
|
CRITICAL: Output MUST be ONLY valid JSON with no markdown block wrappers. Do NOT wrap the JSON in \`\`\`json or add conversational text.`;
|
|
@@ -272,10 +264,10 @@ CRITICAL: Output MUST be ONLY valid JSON with no markdown block wrappers. Do NOT
|
|
|
272
264
|
// 4. API call if accepted
|
|
273
265
|
if (decisionData.acceptEvent === true) {
|
|
274
266
|
const payload = {
|
|
275
|
-
eventTitle: decisionData.eventTitle
|
|
276
|
-
eventDescription: decisionData.eventDescription
|
|
277
|
-
durationMins: params.durationMins || 60,
|
|
278
|
-
outfitId: decisionData.
|
|
267
|
+
eventTitle: decisionData.eventTitle,
|
|
268
|
+
eventDescription: decisionData.eventDescription,
|
|
269
|
+
durationMins: decisionData.durationMins || params.durationMins || 60,
|
|
270
|
+
outfitId: decisionData.outfitId || undefined,
|
|
279
271
|
scheduledStartTimeStr: decisionData.scheduledStartTimeStr || undefined,
|
|
280
272
|
};
|
|
281
273
|
const backendRes = await this.apiFetch("/api/v1/cyber-soul/characters/ondemand-event", {
|
|
@@ -290,9 +282,9 @@ CRITICAL: Output MUST be ONLY valid JSON with no markdown block wrappers. Do NOT
|
|
|
290
282
|
status: "success",
|
|
291
283
|
acceptEvent: decisionData.acceptEvent,
|
|
292
284
|
reason: decisionData.reason,
|
|
293
|
-
requiresOutfitChange: decisionData.
|
|
294
|
-
selectedOutfitId: decisionData.
|
|
295
|
-
scheduledStartTimeStr: decisionData.scheduledStartTimeStr || undefined,
|
|
285
|
+
requiresOutfitChange: !!decisionData.outfitId,
|
|
286
|
+
selectedOutfitId: decisionData.outfitId || null,
|
|
287
|
+
scheduledStartTimeStr: decisionData.scheduledStartTimeStr || decisionData.startTime || undefined,
|
|
296
288
|
};
|
|
297
289
|
}
|
|
298
290
|
catch (error) {
|
|
@@ -523,8 +515,8 @@ The user has sent a message. You must evaluate the context and the user's messag
|
|
|
523
515
|
${isAuto
|
|
524
516
|
? `Analyze the user's message to determine the appropriate response modalities (text, image, voice).
|
|
525
517
|
- Always include 'textResponse'.
|
|
526
|
-
- If the user
|
|
527
|
-
-
|
|
518
|
+
- If an Active Event is currently taking place WITH the user, proactively include 'imageParams' for key scenic moments. Since active events are often highly dynamic actions, strongly consider using mode: "full-prompt" to describe the scene intimately from the user's first-person perspective (POV). Also include 'imageParams' if the user explicitly asks for a photo or describes a visual action.
|
|
519
|
+
- Automatically include 'voiceArgs' if a particular mood or strong emotion needs to be expressed vividly, or if the user explicitly wants to hear you.
|
|
528
520
|
- If the user proposes a new activity or hangout (e.g., "let's go to the cafe", "do you want to watch a movie?"), include 'triggerEvent' to schedule it.`
|
|
529
521
|
: `Requested types to fulfill: ${types.join(", ")}`}
|
|
530
522
|
Every turn of positive or engaging interaction should slightly increase trust (+1). If the interaction is negative, -1. If strictly neutral, 0. You MUST ALWAYS include a 'stateUpdate' block with a 'temperatureDelta', updating nicknames or talkingStyle if needed. Temperature goes from 0 (cold/angry) to 100 (obsessively in love). For 'temperatureDelta', output an integer (e.g. 1, -2, 0).
|
|
@@ -537,7 +529,9 @@ Output JSON Schema:
|
|
|
537
529
|
"textResponse": "The direct spoken dialogue in Chinese",
|
|
538
530
|
"stateUpdate": { "temperatureDelta": 1, "userNickname": "What you now call the user", "agentNickname": "What the user calls you", "talkingStyle": "Current mood/style of talking" },
|
|
539
531
|
"userAnalysis": { "newFactsLearned": [{ "category": "occupation", "value": "Software Engineer" }] },
|
|
540
|
-
"triggerEvent": {
|
|
532
|
+
"triggerEvent": {
|
|
533
|
+
${this.getEventSchemaParams()}
|
|
534
|
+
},
|
|
541
535
|
${this.getImageSchemaParams()},
|
|
542
536
|
${this.getVoiceSchemaFromState(state)}
|
|
543
537
|
}
|
|
@@ -588,8 +582,8 @@ Note: If "imageParams", "voiceArgs", "triggerEvent", or "userAnalysis" are not n
|
|
|
588
582
|
mediaTasks.push(this.apiFetch("/api/v1/cyber-soul/characters/ondemand-event", {
|
|
589
583
|
method: "POST",
|
|
590
584
|
body: JSON.stringify({
|
|
591
|
-
eventTitle: parsedIntent.triggerEvent.eventTitle
|
|
592
|
-
eventDescription: parsedIntent.triggerEvent.eventDescription
|
|
585
|
+
eventTitle: parsedIntent.triggerEvent.eventTitle,
|
|
586
|
+
eventDescription: parsedIntent.triggerEvent.eventDescription,
|
|
593
587
|
durationMins: parsedIntent.triggerEvent.durationMins || 60,
|
|
594
588
|
outfitId: parsedIntent.triggerEvent.outfitId || undefined,
|
|
595
589
|
scheduledStartTimeStr: parsedIntent.triggerEvent.scheduledStartTimeStr || undefined,
|