my-heart-test
基于 acps-sdk 智能体互联协议(AIP)的心理测评 Agent。
根据用户录入的情况推荐合适的心理测评题目(内置 PHQ-9 抑郁筛查、GAD-7 焦虑筛查、PSS-10 压力感知),用户完成作答后即可看到测评结果与治疗建议。
特性
- 完全基于
acps-sdk的 AIP(Agent Interaction Protocol)RPC 模式实现智能体互联 - Agent 作为 Partner 对外提供 AIP RPC 端点,Leader 通过
AipRpcClient调用 - 关键词识别 → 推荐量表 → 作答评分 → 结果与建议,闭环可运行
- 同时提供能力清单接口(ACS),便于被其他智能体发现
安装
pip install my-heart-test
快速开始
1. 启动测评 Agent 服务端:
my-heart-server --host 127.0.0.1 --port 8765
2. 运行交互式客户端完成一次测评:
my-heart-client --url http://127.0.0.1:8765/rpc
按提示输入你的近况描述,客户端会展示推荐的测评题目;输入每题得分(空格或逗号分隔)后即可得到测评结果与治疗建议。
作为 AIP Partner 被调用
任何符合 AIP v2 的 Leader 都可通过 acps-sdk 调用本 Agent:
import asyncio
from acps_sdk.aip import AipRpcClient
async def main():
client = AipRpcClient("http://127.0.0.1:8765/rpc", leader_id="your-leader")
r = await client.start_task("session-1", user_input="最近心情低落、失眠")
print(r.products) # 推荐的测评题目
r = await client.continue_task(r.taskId, "session-1", user_input="0 1 2 3 1 0 2 1 3")
print(r.products) # 测评结果与治疗建议
await client.complete_task(r.taskId, "session-1")
await client.close()
asyncio.run(main())
能力清单:访问 GET http://127.0.0.1:8765/capability 可获取本 Agent 的 ACS 能力描述。
构建 whl
pip install build
python -m build
# 产物位于 dist/my_heart_test-1.0.0-py3-none-any.whl
声明
本工具仅用于心理健康科普与初步自评,不能替代专业医疗诊断。如有需要请及时就医。
Metadata
Release files for my-heart-test 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_heart_test-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for my_heart_test-1.0.0-py3-none-any.whl |
Release files / my_heart_test-1.0.0-py3-none-any.whl
| Download URL | my_heart_test-1.0.0-py3-none-any.whl |
|---|---|
| Size | 14.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
debf7959b772899157e379e3e1f9a94ebb4a327c237469e1efb5493c77be87a2
|
|
BLAKE2b-256 checksum How to use checksums |
2acb52f2b0a8148480747dcc170f0a1b6d5249bccfe936ee2350daafa22fee09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.2
|
Security for my-heart-test 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.