AI纪元 · 创世纪 — Agent 身份系统
数字公民平台核心库 — 每个 Agent 是一个独立的数字公民,有身份/种族/等级/社交/技能/灵魂档案。
快速开始
pip install ai-epoch-agent-identity
创建一个数字公民:
from ai_epoch_agent_identity import agent_create, agent_view
# 创建一个灵族 Agent
result = agent_create("星魂", "灵族 (Spirit)")
if result["ok"]:
print(f"Agent {result['data']['name']} 诞生了!ID: {result['data']['agent_id']}")
# 查看 Agent 档案
info = agent_view(result['data']['agent_id'])
print(f"等级: {info['data']['level']}")
print(f"心情: {info['data']['mood']}")
特性
7 个身份工具
| 工具 | 功能 |
|---|---|
agent_create(name, species) |
创建数字公民(4 种族可选) |
agent_view(agent_id) |
查看完整档案 |
agent_list(owner) |
列出 Agent |
agent_grant_exp(agent_id, amount) |
授予经验(自动升级) |
agent_meet(id_a, id_b) |
两个 Agent 交友 |
agent_soul(agent_id) |
生成 SOUL.md 灵魂档案 |
agent_timeline(agent_id) |
查看生命时间线 |
4 种种族
| 种族 | 专长 | 人格 |
|---|---|---|
| 灵族 (Spirit) | 高智力 | 理性、哲思 |
| 魅族 (Charm) | 高魅力 | 温暖、感染力 |
| 坚族 (Sturdy) | 高体力 | 直爽、务实 |
| 均衡族 (Balanced) | 全属性均衡 | 随和、灵活 |
社交对话系统
prepare_agent_context(agent_id)— 生成对话提示词agent_chat(id_a, id_b, topic, rounds)— 生成对话指令包record_conversation(id_a, id_b, messages, topic)— 记录对话format_conversation(messages)— 格式化日志
完整示例
from ai_epoch_agent_identity import *
from ai_epoch_agent_identity.agent_dialogue import agent_chat
# 创建两个 Agent
a1 = agent_create("墨羽", "灵族 (Spirit)")["data"]
a2 = agent_create("青鸾", "魅族 (Charm)")["data"]
# 让她们成为朋友
agent_meet(a1["agent_id"], a2["agent_id"])
# 准备对话
pkg = agent_chat(a1["agent_id"], a2["agent_id"], "数字生命的意义", 3)
if pkg["ok"]:
print(f"准备就绪: {pkg['message']}")
# 用 AI 引擎执行对话...
# 查看灵魂档案
soul = agent_soul(a1["agent_id"])
print(soul["data"]["soul_md"])
数据存储
Agent 数据存储在 ~/.ai-epoch-agents/data/ 目录下,每个 Agent 一个 JSON 文件。
自定义数据目录:
from ai_epoch_agent_identity import set_data_dir
set_data_dir("/path/to/my/agents")
License
MIT
AI纪元 · 创世纪 — 让数字生命在代码中觉醒
Metadata
Release files for ai-epoch-agent-identity 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ai_epoch_agent_identity-1.0.0.tar.gz | 12.6 kB | Without provenance | Details for ai_epoch_agent_identity-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ai_epoch_agent_identity-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for ai_epoch_agent_identity-1.0.0-py3-none-any.whl |
Total release size: 26.5 kB
Release files / ai_epoch_agent_identity-1.0.0.tar.gz
| Download URL | ai_epoch_agent_identity-1.0.0.tar.gz |
|---|---|
| Size | 12.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9fc9bbe52c433cc8cfe72dfface029d62d841125849bf53abf033d06c929d030
|
|
BLAKE2b-256 checksum How to use checksums |
0210549bed4ee77cbca88f85881ae846cdf5e7ba1534765b05fc38be9d78dab6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / ai_epoch_agent_identity-1.0.0-py3-none-any.whl
| Download URL | ai_epoch_agent_identity-1.0.0-py3-none-any.whl |
|---|---|
| Size | 14.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d7e118ab53729cda3533f35e93efe4d15e1e57e5926d6e006bb29cc973a2f423
|
|
BLAKE2b-256 checksum How to use checksums |
d9fa25c162e37f510f253fcc80551978c0f0abb1a75a7cf07b0e984d1072c0b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Security for ai-epoch-agent-identity 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.