Metadata-Version: 2.4
Name: rag-core-sdk
Version: 0.10.2
Summary: Optional Python client SDK for witty-rag / rag_core REST APIs
Author: openEuler community
License: MulanPSL-2.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"

# rag-core-sdk（Python）

面向 rag_core REST 的可选 **Python 客户端 SDK**。

- **Python**：≥ 3.10
- **包名**：`rag_core_sdk`
- **鉴权**：`Authorization: Bearer <access_key>`

SDK **不能替代**部署 rag_core。统一说明见上级 [../USER_GUIDE.md](../USER_GUIDE.md)。

## 安装

```bash
cd rag-core-sdk/python
pip install -e .
# 开发依赖（pytest）：
pip install -e ".[dev]"
```

## 快速开始

```bash
export RAG_BASE_URL=http://127.0.0.1:9988
export RAG_ACCESS_KEY=debug-access-key
python examples/quickstart.py
```

## 测试

```bash
pytest tests/test_client_unit.py -q

# 端到端（需 rag_core 已启动）
RAG_E2E=1 RAG_BASE_URL=http://127.0.0.1:9988 pytest tests/test_e2e.py -q -s
```

## OpenAPI 导出

```bash
# 对已启动服务：
curl -s http://127.0.0.1:9988/openapi.json | python3 -m json.tool > ../openapi.json

# 或能 import rag_core 时：
python scripts/export_openapi.py -o ../openapi.json
```
