ChatArch Feishu/Lark bot helpers extracted from ChatTool.
Project description
ChatLark
ChatArch 的 Feishu/Lark bot helper 包,承接从 ChatTool 拆出的轻量机器人、消息发送、事件服务和消息内容构造能力。更广泛的 Feishu/Lark OpenAPI 操作仍优先使用官方 lark-cli。
快速开始
pip install -e ".[dev]"
chatlark --help
chatlark --version
chatlark send --help
chatlark serve --help
python -m pytest -q
python -m build
CLI
chatlark info
chatlark send USER_ID "Hello"
chatlark send "Hello" # 使用 FEISHU_DEFAULT_RECEIVER_ID
chatlark send -t chat_id "Hello team" # 使用 FEISHU_DEFAULT_CHAT_ID
chatlark serve echo
chatlark serve webhook
AI 对话命令保留为可选边界,避免 ChatLark 基础包依赖 ChatTool 形成循环:
pip install "chatlark[llm]"
chatlark chat
chatlark serve ai --system "你是工作助手"
Python API
from chatlark import LarkBot, ChatSession
bot = LarkBot()
session = ChatSession(system="你是助手")
@bot.on_message
def chat(ctx):
ctx.reply(session.chat(ctx.sender_id, ctx.text))
bot.start()
配置
ChatLark 复用 ChatEnv 的 Feishu 配置字段:
FEISHU_APP_IDFEISHU_APP_SECRETFEISHU_API_BASEFEISHU_DEFAULT_RECEIVER_IDFEISHU_DEFAULT_CHAT_ID
可通过环境变量直接提供,也可以通过 -e/--env 指定 ChatEnv Feishu profile 或 .env 文件。
边界
- ChatLark:bot helper、消息发送、事件服务、消息上下文、消息内容构造。
- lark-cli:广泛 Feishu/Lark OpenAPI 操作和用户授权流程。
- ChatTool:迁移完成后只应保留有意设计的兼容入口或依赖连接,不再重复持有 Lark business logic。
开发说明
扩展前先阅读 DEVELOP.md 和 AGENTS.md。发布走 PyPI Trusted Publisher/OIDC workflow,不使用本地 token 上传正式版本。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 chatlark-0.1.0.tar.gz.
File metadata
- Download URL: chatlark-0.1.0.tar.gz
- Upload date:
- Size: 22.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3a250062957ab5f3180450cc6fc8e388f0d06e0192f9bb8160037b98d5c728a
|
|
| MD5 |
c47301263439b74f0640725a41d2e538
|
|
| BLAKE2b-256 |
a9a403aa66ce3719bdae75d63296b7f929cf058b15522c5e5babe4ff409c8d93
|
Provenance
The following attestation bundles were made for chatlark-0.1.0.tar.gz:
Publisher:
publish.yml on ChatArch/ChatLark
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chatlark-0.1.0.tar.gz -
Subject digest:
d3a250062957ab5f3180450cc6fc8e388f0d06e0192f9bb8160037b98d5c728a - Sigstore transparency entry: 2085604695
- Sigstore integration time:
-
Permalink:
ChatArch/ChatLark@6403c795b23bbf6041bc63515d5640c29e0b8076 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ChatArch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6403c795b23bbf6041bc63515d5640c29e0b8076 -
Trigger Event:
push
-
Statement type:
File details
Details for the file chatlark-0.1.0-py3-none-any.whl.
File metadata
- Download URL: chatlark-0.1.0-py3-none-any.whl
- Upload date:
- Size: 24.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dad4b0450e13b8d8fb83570c4918a0be2063ae662cb43995fc97834716257c42
|
|
| MD5 |
517ed5eef77d6ba49441b3f68dea3c87
|
|
| BLAKE2b-256 |
2b2e317dcbce32c9cb7aad95ee168ce4c2404ebec155c76339b44d258e8b94ca
|
Provenance
The following attestation bundles were made for chatlark-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on ChatArch/ChatLark
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chatlark-0.1.0-py3-none-any.whl -
Subject digest:
dad4b0450e13b8d8fb83570c4918a0be2063ae662cb43995fc97834716257c42 - Sigstore transparency entry: 2085604961
- Sigstore integration time:
-
Permalink:
ChatArch/ChatLark@6403c795b23bbf6041bc63515d5640c29e0b8076 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ChatArch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6403c795b23bbf6041bc63515d5640c29e0b8076 -
Trigger Event:
push
-
Statement type: