Python SDK for Sinohealth Skills
Project description
Skills Consumer SDK
Python SDK:调用 Skill 网关(POST /skill/{url_suffix}),封装请求头 bizType、bizToken、请求体与响应解析。
当前发布包仅包含 skills_sdk 运行时代码与基础文档;tests/、examples/ 不会打入 wheel / sdist。
依赖
运行时仅依赖 httpx;配置与请求/响应模型使用标准库 dataclasses。若希望 自动读取当前目录 .env,请额外安装:pip install python-dotenv(或 pip install "sinohealth-skills-sdk[env]"),SDK 会在 import 时尝试 load_dotenv()。
pip install sinohealth-skills-sdk
# 或本地开发
pip install -e .
pip install python-dotenv # 可选,解决「只写 .env 未 export」读不到变量
对外文档
接入方请阅读:docs/SDK_USER_GUIDE.md(安装、环境变量、call_skill 示例)。
快速示例
export SKILLS_BIZ_TYPE=medmateclaw
export SKILLS_BIZ_TOKEN='你的令牌'
export SKILLS_GATEWAY_BASE_URL='https://med-gateway.sinohealth.com'
from skills_sdk import SkillsClient
client = SkillsClient()
r = client.call_skill(
"ai-mdt/examination-indicators-interpretation",
{"indicator": "甘油三酯(TG) 2.87mmol/L(参考≤2.30)"},
)
print(r.data)
client.close()
可运行脚本:python examples/examination_indicators_client.py
开发
pip install -r requirements-dev.txt
pytest
发布前检查
python3 -m pip install -U build twine
python3 -m build
python3 -m twine check dist/*
许可证
MIT
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 sinohealth_skills_sdk-0.4.2.tar.gz.
File metadata
- Download URL: sinohealth_skills_sdk-0.4.2.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b45ad74e5653ba4f4dc11975973bf89ac1a829db3585d61fd1d32955f6b0cbde
|
|
| MD5 |
e4242fd19e08cf59ac3e88d1185fe2da
|
|
| BLAKE2b-256 |
978915adb0b59e947d5fe9aa10bac8f4bd0e36e8863e4c328e42254bda25fa3f
|
File details
Details for the file sinohealth_skills_sdk-0.4.2-py3-none-any.whl.
File metadata
- Download URL: sinohealth_skills_sdk-0.4.2-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e40b1c9ea3a43bcc26d0c726f7b5251d5ad86bd2484b264940d73c72aaf4873d
|
|
| MD5 |
9906b8bd79a4290f95fa10c18de16642
|
|
| BLAKE2b-256 |
67535961cfb7bb7c618fb3fe6618cf46da8cf4ad5cee137530091a59477e52af
|