Proactive
Check for and manage character-initiated actions.
Proactive
Proactive actions are character-initiated behaviors that occur without user input. The emotion engine can trigger actions based on attachment needs, unmet psychological needs, or emotional overflow. This enables characters that reach out on their own rather than only responding to the user.
Proactive behavior is disabled by default. You must explicitly opt in per session.
Check Proactive Actions
Check for pending proactive actions in a session. Returns an array of actions the character wants to initiate based on its current emotional and psychological state.
Headers
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer YOUR_API_KEY |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
sessionId | string | The session ID to check |
Response
Returns an array of proactive action objects:
| Field | Type | Description |
|---|---|---|
id | string | Unique action identifier |
type | string | Action type (see below) |
message | string | Suggested message or action description |
priority | string | Priority level: "low", "medium", or "high" |
metadata | object | Additional context about what triggered the action |
Action Types
| Type | Description |
|---|---|
attachment_seeking | Character seeks connection due to absence or attachment needs |
need_deficit | A psychological need (belonging, competence, autonomy) is unmet |
emotional_overflow | Emotion intensity has exceeded the character's coping threshold |
Examples
curl
JavaScript
Python
Errors
| Code | Status | Description |
|---|---|---|
UNAUTHORIZED | 401 | Invalid or missing API key |
NOT_FOUND | 404 | Session not found |
Configure Proactive Preferences
Enable or disable proactive behavior and configure which trigger types are active for a session. By default, all proactive behavior is disabled.
Headers
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer YOUR_API_KEY |
Content-Type | string | Yes | application/json |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
sessionId | string | The session ID to configure |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
enabled | boolean | Yes | Master switch for proactive behavior |
triggers | object | No | Per-trigger-type toggles |
triggers.attachment_seeking | boolean | No | Enable attachment-seeking actions (default: true when enabled) |
triggers.need_deficit | boolean | No | Enable need-deficit actions (default: true when enabled) |
triggers.emotional_overflow | boolean | No | Enable emotional overflow actions (default: true when enabled) |
cooldown_hours | number | No | Minimum hours between proactive actions (default: 4) |
Response
| Field | Type | Description |
|---|---|---|
sessionId | string | The session ID |
preferences | object | The updated preferences object |
Examples
curl
Enable proactive behavior with only attachment-seeking and emotional overflow triggers:
JavaScript
Python
Errors
| Code | Status | Description |
|---|---|---|
UNAUTHORIZED | 401 | Invalid or missing API key |
VALIDATION_ERROR | 400 | Invalid preferences configuration |
NOT_FOUND | 404 | Session not found |
RATE_LIMIT | 429 | Too many requests |