Body emotion mapper: structured emotion analysis (AnalysisInput) JSON to body-axis states and prompt tags
Project description
Body Emotion Sensor
Give your AI agent a persistent emotional system based on the TCM Five Zang and Five Elements model.
What It Does
body-emotion-sensor converts one turn of structured emotional analysis JSON into:
- persistent body-axis state updates
- a compact prompt payload for reply shaping
- traceable state/history data for debugging
It distinguishes between:
baseline: the agent's native constitution and long-term personality colorcurrent: the body state after the latest turn
Install
pip install body-emotion-sensor
After installation you can use either command:
bes help
body-emotion-sensor help
CLI Overview
bes help
bes prompt init
bes prompt openclaw-example
bes prompt analysis-input
bes init-state --workspace /path/to/workspace --agent-id my-agent --name "My Agent"
bes init-state --workspace /path/to/workspace --agent-id my-agent --name "My Agent" --init-json /path/to/init.json
bes check-init --workspace /path/to/workspace --agent-id my-agent --name "My Agent"
bes bootstrap --workspace /path/to/workspace --agent-id my-agent --name "My Agent"
bes run --workspace /path/to/workspace --agent-id my-agent --name "My Agent" --input /path/to/analysis-input.json
bes run --workspace /path/to/workspace --agent-id my-agent --name "My Agent" --json '{"analysis_target":"...", "...":"..."}'
Recommended Flow
- Print the constitution initialization prompt.
- Use your upstream model to generate the role init JSON.
- Write the long-term state.
- If the host is OpenClaw, print the OpenClaw examples and update AGENTS / TOOLS separately.
- Run
bes check-initto confirm the code-level setup is ready. - For each new session, run
bes bootstrapbefore the first assistant reply. - For each turn, generate
AnalysisInputJSON upstream. - Run one update and use the returned prompt payload in your reply layer.
Example:
bes prompt init
bes init-state --workspace /path/to/workspace --agent-id my-agent --name "My Agent" --init-json /path/to/init.json
bes prompt openclaw-example
bes check-init --workspace /path/to/workspace --agent-id my-agent --name "My Agent"
bes bootstrap --workspace /path/to/workspace --agent-id my-agent --name "My Agent"
bes prompt analysis-input
bes run --workspace /path/to/workspace --agent-id my-agent --name "My Agent" --input /path/to/analysis-input.json
Output Contract
The default stdout of bes bootstrap and bes run contains:
TURN_CHANGE_TAGSBODY_TAGBASELINE_PERSONA
Use bes run --full when you need the complete MappingResult.
Runtime Prompt Access
The package does not ship internal repository docs such as docs/ or prompts/ as install-time resources.
If you need the built-in prompt texts after pip install, use:
bes prompt init
bes prompt openclaw-example
bes prompt analysis-input
This keeps runtime integrations independent from repository directory traversal.
Development
For local development:
pip install -e .
python -m body_emotion help
Optional visualization panel:
streamlit run src/body_emotion/panel.py
Repository-only docs remain in the source repo, for example:
docs/五脏情绪映射全表.mddocs/五脏情绪七阶状态表.mdprompts/example-openclaw-agents.mdprompts/example-openclaw-tools.md
License
MIT. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file body_emotion_sensor-0.1.0.tar.gz.
File metadata
- Download URL: body_emotion_sensor-0.1.0.tar.gz
- Upload date:
- Size: 63.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89ae96e0376910cc1956fc6e769e8f8c8846e393b4b094facc137e3a70060a7a
|
|
| MD5 |
422663ea76ffd5298bf1d4ac71a197ed
|
|
| BLAKE2b-256 |
c2d6b69253f4d67a34482dcce3b0f46e8025dc8182dbebe45ce081d90fe20639
|
File details
Details for the file body_emotion_sensor-0.1.0-py3-none-any.whl.
File metadata
- Download URL: body_emotion_sensor-0.1.0-py3-none-any.whl
- Upload date:
- Size: 63.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3989d571fd1285cf5404b847f0d538f5d593b035129da741cc11f3ff6bd5d8c2
|
|
| MD5 |
92887ee7268f53f2d13c87e0256ac82e
|
|
| BLAKE2b-256 |
dbbd5ffc410f25111a1638666332a0e20c7758396903c982b11febc004562479
|