Skip to main content

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 / get
    • client.documents:ingest / ingest_and_parse / upload / get
    • client.parse:parse / parse_direct / query_result / issue_download_ticket / download
    • client.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)

Source distribution for ikc-open-platform-sdk 0.1.0
File Size Uploaded
ikc_open_platform_sdk-0.1.0.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ikc-open-platform-sdk 0.1.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

0.7.0

2 release files

0.6.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.5

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page