Skip to main content

Python SDK for Sinohealth Skills

Project description

Skills Consumer SDK

Python SDK:调用 Skill 网关(POST /skill/{url_suffix}),封装请求头 bizTypebizToken、请求体与响应解析。

当前发布包仅包含 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sinohealth_skills_sdk-0.5.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sinohealth_skills_sdk-0.5.0-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file sinohealth_skills_sdk-0.5.0.tar.gz.

File metadata

  • Download URL: sinohealth_skills_sdk-0.5.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for sinohealth_skills_sdk-0.5.0.tar.gz
Algorithm Hash digest
SHA256 cc81c361a8be58be1c2b0e473ecba8dc1a0bf68c9d851f5ccbedac610ecd13a2
MD5 5adca3c37158ed24a2b82bb0c353b71c
BLAKE2b-256 a3e507b96647b18ff9d59f70235a5eb766bff2fc5c70761878d3c5ee1796c636

See more details on using hashes here.

File details

Details for the file sinohealth_skills_sdk-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sinohealth_skills_sdk-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b8894b0dab79a26288adc2da2a287e3e4b3e82cab604c7f68970e8ede762f48c
MD5 790ee6eefa7d2268aaf8dd7ee36a2c25
BLAKE2b-256 b9234ad1f46615c94cfed7f49ea585c2db66fc350d570597e3fdf52f6016129e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page