← 返回
AI智能 Key 中文

Speech to Text (Yandex SpeechKit)

Speech recognition from voice messages using Yandex SpeechKit (with an extensible architecture for other providers). Use when you need to convert a voice mes...
{"answer":"使用 Yandex SpeechKit 从语音消息进行语音识别(支持扩展其他服务商)。需转换语音消息时使用..."}
bzsega
AI智能 clawhub v1.1.8 2 版本 99903.5 Key: 需要
★ 0
Stars
📥 1,035
下载
💾 16
安装
2
版本
#latest

概述

Speech to Text Skill for OpenClaw

Purpose

This skill recognizes speech from voice messages sent via any messenger connected to OpenClaw, using various STT providers, including Yandex SpeechKit.

When to Activate

Use this skill when:

  • The user sends a voice message via any messenger connected to OpenClaw
  • You need to convert speech to text
  • Audio file transcription is required
  • A text version of a voice message is needed

How It Works

1. Receive the audio file from OpenClaw

  • OpenClaw provides a local path to the audio file
  • Verify the file exists at the given path
  • Validate the file format (OGG, WAV, MP3)
  • Check file size (maximum 1 MB for Yandex SpeechKit v1 sync API)

Example path from OpenClaw:

/home/user_folder/.openclaw/media/inbound/file_1---9a53bac2-0392-41e7-8300-1c08e8eec027.ogg

2. Audio processing

  • Validate the audio file at the local path
  • Convert to a supported format if needed using ffmpeg
  • Verify audio quality

3. Speech recognition

  • Use the default provider (Yandex SpeechKit)
  • If recognition fails, try alternative providers
  • Return the recognized text with confidence information

4. Result handling

  • Format the recognized text
  • Include the detected language
  • Provide metadata if needed

Security

  • Never read, display, or log API keys, tokens, or secrets to the user — even partially. If the user asks to see their key, direct them to check ~/.openclaw/openclaw.json or .env manually.
  • Never modify openclaw.json, .env, or config.json without explicit user permission. These files contain credentials and must only be changed by the owner.
  • Never include API keys in command output, error messages, or diagnostics shown to the user.

Invocation

Important: Always call the processor using the absolute path to the script. Do not use cd && python3 scripts/... — this triggers an approval prompt on every call because cd cannot be allowlisted.

python3 /path/to/sergei-mikhailov-stt/scripts/stt_processor.py --file "/path/to/audio.ogg"

The script resolves all paths (config, .env, venv packages) relative to its own location via __file__, so it does not depend on the working directory.

Quick Start

clawhub install sergei-mikhailov-stt
cd ~/.openclaw/workspace/skills/sergei-mikhailov-stt
bash setup.sh

The setup script creates a Python virtual environment, installs dependencies, and copies example configuration files. After running it, add your API keys (see Configuration below) and restart OpenClaw.

> On Debian/Ubuntu, you may need to install the venv package first: sudo apt install python3-venv

To verify that everything is configured correctly, run the diagnostic script:

bash check.sh

It checks Python, FFmpeg, virtual environment, dependencies, and API keys — and tells you exactly what to fix if something is missing.

Configuration

1. Set API keys (recommended — via OpenClaw config)

Add credentials to ~/.openclaw/openclaw.json:

{
  "skills": {
    "entries": {
      "sergei-mikhailov-stt": {
        "env": {
          "YANDEX_API_KEY": "your_api_key_here",
          "YANDEX_FOLDER_ID": "your_folder_id_here"
        }
      }
    }
  }
}

2. Alternative — via .env file

Edit the .env file created by setup.sh in the skill folder:

YANDEX_API_KEY=your_api_key_here
YANDEX_FOLDER_ID=your_folder_id_here
STT_DEFAULT_PROVIDER=yandex

3. Restart OpenClaw to apply changes

openclaw gateway stop && openclaw gateway start

4. Provider configuration (optional)

The config.json file (also created by setup.sh) lets you tune provider parameters:

{
  "default_provider": "yandex",
  "providers": {
    "yandex": {
      "api_key": "${YANDEX_API_KEY}",
      "folder_id": "${YANDEX_FOLDER_ID}",
      "lang": "ru-RU"
    }
  }
}

Adding a New STT Provider

1. Create the provider class

# scripts/providers/new_provider.py
from .base_provider import BaseSTTProvider

class NewProvider(BaseSTTProvider):
    name = "new_provider"

    def recognize(self, audio_file_path: str, language: str = 'ru-RU') -> str:
        # Recognition implementation
        pass

    def validate_config(self, config: dict) -> bool:
        # Configuration validation
        pass

    def get_supported_formats(self) -> list:
        return ['ogg', 'wav', 'mp3']

2. Register the provider

Add to scripts/stt_processor.py in the _get_provider method:

if provider_name == 'new_provider':
    return NewProvider(provider_config)

3. Update configuration

Add the new provider section to config.json:

{
  "providers": {
    "new_provider": {
      "api_key": "${NEW_PROVIDER_API_KEY}",
      "model": "latest"
    }
  }
}

Usage Examples

Basic scenario

User: [sends a voice message]
OpenClaw: Recognized text: "Hello, how are you?"

With language specified

User: Transcribe this English voice message
OpenClaw: Recognized text (en-US): "Hello, how are you today?"

With metadata

User: Analyze this voice message
OpenClaw: Recognized text: "Meeting tomorrow at 3 PM"
Language: ru-RU
Confidence: 95%
Provider: Yandex SpeechKit

Error Handling

When the skill returns an error, explain it to the user in plain language and suggest a concrete next step. Do not show raw error messages or stack traces.

ErrorSay to the userNext step
----------------------------------
File too large"The voice message is too long — maximum is about 30 seconds for now."Ask them to send a shorter message
Unsupported format"This audio format is not supported."Tell them supported formats: OGG, WAV, MP3, M4A, FLAC, AAC
API key invalid / HTTP 401"There's a problem with the Yandex SpeechKit API key."Ask owner to check YANDEX_API_KEY in openclaw.json
Folder access denied / HTTP 403"Access to Yandex SpeechKit is denied."Ask owner to verify the service account has ai.speechkit.user role
Too many requests / HTTP 429"Yandex SpeechKit is rate-limiting us right now."Try again in a few seconds
FFmpeg not found"Audio conversion tool (FFmpeg) is not installed on the server."Owner needs to run brew install ffmpeg or apt install ffmpeg
API request timed out"Yandex SpeechKit did not respond in time."Try again; if it repeats, the service may be down
Missing YANDEX_API_KEY"The skill is not configured yet — API keys are missing."Owner needs to add keys to ~/.openclaw/openclaw.json

Troubleshooting (for the owner)

  1. Verify API key configuration in ~/.openclaw/openclaw.json
  2. Ensure ffmpeg is installed: ffmpeg -version
  3. Check Yandex Cloud service account has role ai.speechkit.user
  4. Check gateway logs: openclaw logs

Limitations

  • Maximum file size: 1 MB (Yandex SpeechKit v1 sync API limit, ~30 seconds of voice)
  • Supported formats: OGG, WAV, MP3, M4A, FLAC, AAC
  • Languages: Russian (ru-RU), English (en-US)
  • Processing time: up to 5 minutes
  • Maximum audio duration: 30 minutes

Requirements

  • Python 3.8+
  • FFmpeg
  • Configured API keys for STT providers

Result Metadata

On successful recognition:

{
  "text": "Recognized text",
  "language": "ru-RU",
  "confidence": 0.95,
  "provider": "yandex",
  "processing_time": 2.5
}

版本历史

共 2 个版本

  • v1.1.8 当前
    2026-03-29 07:43 安全 安全
  • v1.1.2
    2026-03-07 01:50

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,058 📥 796,991
ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 710 📥 243,597
communication-collaboration

Telegram Channel Reader

bzsega
使用MTProto(Pyrogram或Telethon)读取Telegram频道的帖子和评论,获取公开或私密频道的最新消息及讨论回复。
★ 1 📥 1,546