Metadata-Version: 2.1
Name: hwp-protocol
Version: 0.1.0
Summary: HWP (Hypothesis Working Protocol) Python SDK
Home-page: https://github.com/halfway-lab/HWP
Author: HalfWay Lab
Author-email: hello@halfwaylab.cn
License: MIT
Project-URL: Bug Reports, https://github.com/halfway-lab/HWP/issues
Project-URL: Source, https://github.com/halfway-lab/HWP
Project-URL: Documentation, https://github.com/halfway-lab/HWP#readme
Keywords: hwp,hypothesis-working-protocol,ai,llm,chain,reasoning,openai,deepseek
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: requests (>=2.28.0)
Provides-Extra: dev
Requires-Dist: pytest-asyncio (>=0.21.0) ; extra == 'dev'
Requires-Dist: pytest-cov (>=4.0.0) ; extra == 'dev'
Requires-Dist: pytest (>=7.0.0) ; extra == 'dev'

# hwp-protocol

HWP (Hypothesis Working Protocol) Python SDK

## 安装

```bash
pip install hwp-protocol
```

## 使用

```python
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


