my-other-half · 倾听 Agent
基于 ACPs 智能体互联协议(AIP v2) 的情侣互助倾听 Agent。倾听 Agent 匿名记录情侣双方的倾诉内容并总结(诉求线索、情绪、共同话题),交由共情 Agent 协助双方看见彼此的诉求。全程不做裁判、不判定谁对谁错,重点是理解彼此,而非分出胜负。
核心特点
- 双 Agent 互联:使用官方
acps-sdk==2.1.0的 AIP RPC,倾听端(Leader)与共情端(Partner)通过 JSON-RPC 互联。 - 不评判原则:输出只做感受确认与诉求呈现,不做对错判定、不站队,报告内含原则声明。
- 双方都被看见:分别呈现 A 方 / B 方的真实感受与背后诉求,并找出共同在意的事作为连接点。
- 隐私友好:双方以匿名 A 方 / B 方区分,数据模型不含姓名、账号等身份字段。
- 精简可运行:基于规则模板,无需外部大模型/网络,可离线运行;一条命令即可演示。
架构
双方倾诉 ──▶ [倾听 Agent / Leader]
│ 匿名记录 + 总结 (ListeningSummary)
│ ACPs AIP RPC (start_task)
▼
[共情 Agent / Partner]
│ 看见彼此诉求 + 共同点 + 沟通建议
▼
共情倾听报告 (Product) ──▶ 双方
安装
pip install acps-sdk==2.1.0
pip install my-other-half
从源码本地运行:
cd my-other-half
pip install -e .
快速开始
一键演示(本机启动共情 Agent 并发送示例倾诉):
my-other-half demo
分别启动服务端与倾诉端:
# 终端 1:启动共情 Agent
my-other-half serve --host 0.0.0.0 --port 8768
# 终端 2:提交双方倾诉
my-other-half confide \
--url http://127.0.0.1:8768/aip/rpc \
--a "你回家总看手机,我感觉被忽略了" --a-mood "委屈" \
--b "我工作压力大,刷手机是为了放松,总觉得被指责" --b-mood "疲惫"
Python API
import asyncio
from my_other_half import ListenerAgent, ConfideEntry
async def main():
agent = ListenerAgent(partner_url="http://127.0.0.1:8768/aip/rpc")
entries = [
ConfideEntry(side="A", content="你总是加班,我觉得被冷落了。", mood="失落"),
ConfideEntry(side="B", content="我加班是为了我们的未来,你不理解我。", mood="委屈"),
]
report = await agent.help(entries)
print(report.a_seen, report.b_seen, report.common_ground)
await agent.close()
asyncio.run(main())
共情 Agent 服务也可嵌入任意 FastAPI 应用:
from my_other_half import build_empathizer_app
app = build_empathizer_app() # 已挂载 /aip/rpc
扩展
内置知识库位于 knowledge.py,可按需扩展 FEELING_NEEDS(情绪→诉求线索)、COMMON_TOPICS(共同话题)与 TIPS(沟通建议)。
构建 whl
pip install build
python -m build --wheel
twine upload dist/*
版本
1.0.0 · 依赖 acps-sdk==2.1.0 · Python >= 3.10
免责声明:以上为沟通陪伴参考,不替代专业情感咨询;若冲突持续升级或涉及安全,请寻求专业帮助。
Metadata
Release files for my-other-half 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| my_other_half-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for my_other_half-1.0.0-py3-none-any.whl |
Release files / my_other_half-1.0.0-py3-none-any.whl
| Download URL | my_other_half-1.0.0-py3-none-any.whl |
|---|---|
| Size | 12.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
033b5504b71c4c711bb5ba4f668eeac95febc9f86fa7fdb63ef58c33b82eddbf
|
|
BLAKE2b-256 checksum How to use checksums |
ea18179d7a9e2a4d35fb759720163b15321c9a4a83754a8b813cb740b296e56b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.1
|
Security for my-other-half 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.