Skip to main content

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

模型调用相关命令暂不放入 ChatLark 的默认命令面;需要模型 backend 的 bot 编排会在后续单独设计,避免重新引入 ChatTool 或其他 LLM runtime 硬依赖。

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_ID
  • FEISHU_APP_SECRET
  • FEISHU_API_BASE
  • FEISHU_DEFAULT_RECEIVER_ID
  • FEISHU_DEFAULT_CHAT_ID

可通过环境变量直接提供,也可以通过 -e/--env 指定 ChatEnv Feishu profile 或 .env 文件。

边界

  • ChatLark:bot helper、消息发送、事件服务、消息上下文、消息内容构造。
  • lark-cli:广泛 Feishu/Lark OpenAPI 操作和用户授权流程。
  • ChatTool:迁移完成后只应保留有意设计的兼容入口或依赖连接,不再重复持有 Lark business logic。

开发说明

扩展前先阅读 DEVELOP.mdAGENTS.md。发布走 PyPI Trusted Publisher/OIDC workflow,不使用本地 token 上传正式版本。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chatlark-0.1.1.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chatlark-0.1.1-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file chatlark-0.1.1.tar.gz.

File metadata

  • Download URL: chatlark-0.1.1.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chatlark-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5b6b2ab12aa75043d64919cb808f24e3639b9bda65ba059e805deb62d6e2eda6
MD5 4be8648cae75821fbf15d31311eff56d
BLAKE2b-256 f0f46d5bb566d3a4cf010cae78affd291ad290e4edfb48744f03b52c53e9d4fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for chatlark-0.1.1.tar.gz:

Publisher: publish.yml on ChatArch/ChatLark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chatlark-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: chatlark-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 23.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chatlark-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 98698b05bcc0576312360aad67d73c0dafa85aba9b5fc0255a5a595f4c0af2ee
MD5 c9cf624ff81ec969f00d52e98c66b2a2
BLAKE2b-256 0e7c2132493a80223c0bb4fc46dd069d37a897339fc546a7b7c52b83ab936709

See more details on using hashes here.

Provenance

The following attestation bundles were made for chatlark-0.1.1-py3-none-any.whl:

Publisher: publish.yml on ChatArch/ChatLark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page