@space3-npm/cybersoul-client 1.1.6 → 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 +21 -27
- 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,11 +264,11 @@ 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.
|
|
279
|
-
scheduledStartTimeStr: decisionData.scheduledStartTimeStr ||
|
|
267
|
+
eventTitle: decisionData.eventTitle,
|
|
268
|
+
eventDescription: decisionData.eventDescription,
|
|
269
|
+
durationMins: decisionData.durationMins || params.durationMins || 60,
|
|
270
|
+
outfitId: decisionData.outfitId || undefined,
|
|
271
|
+
scheduledStartTimeStr: decisionData.scheduledStartTimeStr || undefined,
|
|
280
272
|
};
|
|
281
273
|
const backendRes = await this.apiFetch("/api/v1/cyber-soul/characters/ondemand-event", {
|
|
282
274
|
method: "POST",
|
|
@@ -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) {
|
|
@@ -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,
|