Skip to main content

HWP (Hypothesis Working Protocol) Python SDK

Project description

hwp-protocol

HWP (Hypothesis Working Protocol) Python SDK

安装

pip install hwp-protocol

使用

from hwp_protocol import create_client

client = create_client(
    base_url="https://hwp.halfwaylab.cn",
    api_key="your-api-key"
)

# 方式1: 提交运行
run = client.create_run(input_text="What is consciousness?")
print(f"Session ID: {run['session_id']}")

# 方式2: 提交并等待完成
result = client.run_and_wait(
    input_text="What is the nature of time?",
    on_progress=lambda status: print(f"Progress: {status['current_round']}/{status['total_rounds']}")
)

print("Result:", result)

API

HWPClient

方法 说明
create_run() 创建链运行任务
get_run_status() 查询运行状态
get_run_result() 获取运行结果
cancel_run() 取消运行
health() 健康检查
list_providers() 获取可用 Provider
pause_summary() 暂停总结
run_and_wait() 提交并等待完成

License

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

hwp_protocol-0.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file hwp_protocol-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hwp_protocol-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for hwp_protocol-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 502cb089531676df769018de35e0a5b9d08d43b20e8d51a35706d3383e0225de
MD5 568a93043655a7b362abe68689254925
BLAKE2b-256 f3bf6e8bcae8a9f8e5bccaee765f9e23dec476b850c645baf6100411104b021d

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