ikc-open-platform-sdk
ikc-open-platform 第三方开发者 SDK(导入包 ikc_open_platform_sdk)。
- 认证:应用 API Key(
Authorization: Bearer <api-key>,由管理面/admin/apps/{appId}/keys创建)。 - 协议:统一响应壳
errCode/errMsg/data/traceId/reqId解包;业务模型一律复用ikc-sdk-lib(本 SDK 不自定义业务模型)。 - 追踪:每请求注入 23 位纯数字
X-Request-Id;reqId可显式传入,缺省 SDK 生成req_前缀值并随壳回显。 - 能力面(四类业务域):
client.knowledge_bases:create / update / query / getclient.documents:ingest / ingest_and_parse / upload / getclient.parse:parse / parse_direct / query_result / issue_download_ticket / downloadclient.search:universal_search / deep_search / query(兼容别名)
- 错误模型:
OpenPlatformAPIError(errCode/errMsg/traceId/reqId)、OpenPlatformConnectionError、OpenPlatformTimeoutError、OpenPlatformProtocolError。
安装
pip install ikc-open-platform-sdk # PyPI(发布后)
pip install sdk/python/ # 或本地源码
快速开始
from ikc_open_platform_sdk import OpenPlatformClient
from ikc_sdk.core.api.search.universal import SearchQueryRequest
with OpenPlatformClient("http://localhost:18000", api_key="<app-api-key>") as client:
result = client.search.universal_search(SearchQueryRequest(query="IKC 平台"))
for hit in result.hits:
print(hit)
测试
python -m pytest sdk/python/tests -q
Metadata
Release files for ikc-open-platform-sdk 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ikc_open_platform_sdk-0.1.0.tar.gz | 5.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ikc_open_platform_sdk-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.4 kB
Release files / ikc_open_platform_sdk-0.1.0.tar.gz
| Download URL | ikc_open_platform_sdk-0.1.0.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d975e8d64d8c62914b5933326e79965f0307e3346824664c15f13d740fd7ef0
|
|
BLAKE2b-256 checksum How to use checksums |
6db5f81abf2ad1c88e1af1762886b9037da27e97ca99a8917168b6156338ad6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / ikc_open_platform_sdk-0.1.0-py3-none-any.whl
| Download URL | ikc_open_platform_sdk-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
72c2d249df07d5f43871532f7e13cb895b9f975ca0ec65d6d281fe215cfd13d0
|
|
BLAKE2b-256 checksum How to use checksums |
828feaff9e95a89a65eb00cd84639194ecfb2a310da983d21ad4e2d4b2c64e9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|