Sema Python SDK
Sema Code Core 的官方 Python SDK:一个事件驱动的 AI 编程助手核心引擎,支持多代理协作、Skill 扩展、Plan 模式任务规划等能力。SDK 内嵌 core 运行时(sidecar),pip install 后开箱即用,asyncio-first。
安装
pip install sema-core
要求:Python 3.10+,本机 Node.js ≥ 18(core 运行时依赖)。
快速开始
import asyncio
from sema_core import SemaCore
async def main():
core = await SemaCore.start({"workingDir": "/path/to/your/project"})
session = await core.create_session()
session.on("message:text:chunk", lambda d: print(d["delta"], end="", flush=True))
done = asyncio.Event()
session.on("state:update", lambda d: done.set() if (d or {}).get("state") == "idle" else None)
await session.process_user_input("你好")
await done.wait() # 等回复完成再关
await core.close()
asyncio.run(main())
模型配置与更多用法见 文档,完整示例见 example/python-demo(交互式 CLI 与一次性执行)。
License
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sema_core-2.0.15.tar.gz
(1.1 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sema_core-2.0.15.tar.gz.
File metadata
- Download URL: sema_core-2.0.15.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee958908651791721dfdaef65bbb547a66b76d73c32ac3ed607e6af474e467cd
|
|
| MD5 |
f98180f1bb861a81f0a55bf39e75f828
|
|
| BLAKE2b-256 |
c24dbfb14ed9e31bbfce832000fc9d354e72a4d963ac70ce8497693c38e5e125
|
File details
Details for the file sema_core-2.0.15-py3-none-any.whl.
File metadata
- Download URL: sema_core-2.0.15-py3-none-any.whl
- Upload date:
- Size: 1.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3017ef53010d7c048c8aec5969267f16082d273eb65dccdf54ef1bb595301d91
|
|
| MD5 |
49145dee2f608ccdbc7725c7e36842eb
|
|
| BLAKE2b-256 |
2c8633d04efaae3e7d2142d7c6e11e58e484a4dceea0dbf974c3778eb84b981b
|