← 返回 Skills 市场
richardcoder849

feishu-asr

作者 Richardcoder849 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
116
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install feishu-asr
功能描述
使用本地Whisper模型识别飞书语音消息。离线免费,不需要注册,不需要联网。
使用说明 (SKILL.md)

飞书语音识别 ASR

触发条件

  • 用户发送飞书语音消息
  • 用户要求将语音转为文字
  • 用户提到"语音识别"、"转文字"

工作流程

1. 获取语音文件

从飞书消息中获取语音文件的file_key,下载为.ogg或.m4a格式。

2. 音频格式转换

使用Python soundfile将音频转换为16kHz采样的WAV格式:

import soundfile as sf
audio, sr = sf.read(voice_file)
# 如果是立体声,转为单声道
if len(audio.shape) > 1:
    audio = audio.mean(axis=1)
sf.write('output.wav', audio, 16000)

3. 使用Whisper识别

import os
os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com'  # 国内镜像

from transformers import WhisperForConditionalGeneration, WhisperProcessor, WhisperFeatureExtractor
import soundfile as sf

# 读取音频
audio, sr = sf.read('output.wav')
if len(audio.shape) > 1:
    audio = audio.mean(axis=1)

# 加载模型
processor = WhisperProcessor.from_pretrained('openai/whisper-tiny')
model = WhisperForConditionalGeneration.from_pretrained('openai/whisper-tiny')
feature_extractor = WhisperFeatureExtractor.from_pretrained('openai/whisper-tiny')

# 识别
input_features = feature_extractor(audio, sampling_rate=16000, return_tensors='pt').input_features
with torch.no_grad():
    predicted_ids = model.generate(input_features)

result = processor.batch_decode(predicted_ids, skip_special_tokens=True)[0]

依赖安装

pip install torch transformers soundfile

模型选择

  • whisper-tiny: 75MB,适合CPU,最快
  • whisper-base: 142MB,精度更好
  • whisper-small: 466MB,精度高

注意事项

  • 首次运行需要下载模型(约75MB-3GB)
  • 建议使用国内镜像:HF_ENDPOINT=https://hf-mirror.com
  • 模型会自动检测语言
安全使用建议
This skill's description says 'offline', but the code will download Whisper models at first run and forces HF_ENDPOINT to https://hf-mirror.com — so network access and a third‑party mirror are involved. The README also asks you to set Feishu and cloud ASR credentials even though the included script never uses them. Before installing or running: (1) do not provide platform/cloud credentials (FEISHU_*, ALIYUN_*, etc.) unless you confirm the skill actually needs them; (2) treat the mirror (https://hf-mirror.com) as an external endpoint — ask the author for provenance or replace it with an official source you trust; (3) run initial tests in an isolated environment with network monitoring to see what is downloaded; (4) note that resampy is used but not listed in pip instructions — add missing dependency if you run it locally; (5) ask the maintainer to clarify the offline claim or to provide an explicitly bundled, offline model if truly intended. If you cannot verify the mirror’s trustworthiness or the author’s intent, avoid supplying any sensitive credentials.
功能分析
Type: OpenClaw Skill Name: feishu-asr Version: 1.0.0 The skill bundle provides a legitimate implementation for transcribing Feishu voice messages using a local OpenAI Whisper model. The Python script `scripts/recognize.py` uses standard libraries like `transformers` and `soundfile` to process audio, and the instructions in `SKILL.md` align with this functionality. While the `README.md` mentions optional third-party cloud ASR services (Aliyun/Tencent), the core logic is local and contains no evidence of data exfiltration, malicious execution, or prompt injection.
能力评估
Purpose & Capability
The name/description promise '本地...离线免费,不需要联网', but the code uses transformers.from_pretrained which downloads models and explicitly sets HF_ENDPOINT to https://hf-mirror.com. The README asks for FEISHU_APP_ID/SECRET and cloud ASR keys (Aliyun/Tencent) even though the provided script does not use those credentials. Requiring or suggesting remote model downloads (and unrelated cloud credentials) is inconsistent with the 'offline' claim.
Instruction Scope
SKILL.md and scripts instruct the agent to download models via Hugging Face (with HF_ENDPOINT set to a specific mirror). The SKILL.md mentions fetching file_key from Feishu and downloading audio, but the shipped script is a standalone CLI that takes a local file path and does not implement Feishu API calls or consume FEISHU_* env vars. The script also unconditionally overwrites HF_ENDPOINT in os.environ, forcing use of a particular external mirror — an unexpected outbound network action compared to the 'offline' description.
Install Mechanism
There is no explicit install spec (instruction-only + one script). That minimizes installer risk, but the runtime will trigger large model downloads via transformers.from_pretrained. The mirror URL is not a well-known official release host; model artifacts will be fetched at runtime. Also, the script imports resampy conditionally but pip install instructions in SKILL.md do not list resampy.
Credentials
Declared requirements are none, but README suggests FEISHU_APP_ID/FEISHU_APP_SECRET and cloud ASR keys. The code does not use those env vars; instead it hardcodes HF_ENDPOINT to a third‑party mirror. Asking users to configure unrelated credentials (Feishu or Aliyun) in documentation while the code ignores them is disproportionate and confusing — could lead users to supply sensitive credentials unnecessarily.
Persistence & Privilege
The skill is not always-enabled and does not request persistent privileges or modify other skills or system-wide configs. It only writes a transient temp WAV file and deletes it. Autonomous invocation is allowed (platform default) but not combined here with other high-risk features.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install feishu-asr
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /feishu-asr 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
feishu-asr 1.0.0 初始版本发布 - 支持通过本地 Whisper 模型识别飞书语音消息,离线免费,无需注册或联网 - 自动触发于收到飞书语音消息或用户要求转文字/语音识别 - 实现音频格式自动转换并支持多种常见音频格式(.ogg, .m4a) - 提供 whisper-tiny、base、small 多种模型选择,兼顾精度与速度 - 支持通过国内 Hugging Face 镜像加速首次模型下载
元数据
Slug feishu-asr
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

feishu-asr 是什么?

使用本地Whisper模型识别飞书语音消息。离线免费,不需要注册,不需要联网。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 116 次。

如何安装 feishu-asr?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install feishu-asr」即可一键安装,无需额外配置。

feishu-asr 是免费的吗?

是的,feishu-asr 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

feishu-asr 支持哪些平台?

feishu-asr 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 feishu-asr?

由 Richardcoder849(@richardcoder849)开发并维护,当前版本 v1.0.0。

💬 留言讨论