mcpField
R
recipes

recipes

github.com/deepgram开发26320 次安装4 周前更新
代码仓库

关于 recipes

Deepgram SDK 的 Agent 维护型微型示例集,提供各支持语言中可运行的短代码片段,适合已知功能后快速查找调用方式。

主要功能

  1. 01按语言和产品组织示例
  2. 02提供可运行的短代码片段
  3. 03覆盖语音转文字与文字转语音
  4. 04包含音频和文本分析示例
  5. 05涵盖语音 Agent 功能

适用场景

  1. 01查找特定 SDK 功能的调用代码
  2. 02复制示例到项目中作为起点
  3. 03对照不同语言的功能实现

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/deepgram/skills --skill recipes

安装后在 Claude Code 中输入/recipes确认已加载。

详细介绍

Deepgram Recipes

由 Agent 维护的微型 recipe,展示如何在所有受支持的语言中使用 Deepgram SDK 的每一项功能。每个 recipe 都是一段聚焦的、可运行的代码片段——而不是一个完整的应用。

何时使用 recipes

  • 你已了解产品和功能;你想要最短的可用代码
  • 你想要可以复制到自己项目中的 example.py / example.js / example.go / 等
  • 你想要针对特定语言、回答“如何用 Deepgram SDK 调用 {feature}?”的答案

在以下情况改用其他 skill:

  • 你想要一个带 Web UI、部署配置等的完整起步应用 → starters skill
  • 你想要与第三方平台(Twilio、LiveKit、Vercel AI SDK、Discord 等)集成 → examples skill
  • 你想要完整的 API 契约(参数、响应、消息结构)→ api skill
  • 你想要 shell 命令而非应用代码 → cli skill

浏览 recipes

仓库:https://github.com/deepgram/recipes

覆盖矩阵:https://github.com/deepgram/recipes/blob/main/COVERAGE.md

Recipe 结构

recipes/{language}/{product}/{version}/{recipe}/
  example.{ext}       # runnable, < 50 lines, reads DEEPGRAM_API_KEY from env
  example_test.{ext}  # runs the example as a subprocess, asserts output
  README.md           # feature explanation, params, sample output, how to run

涵盖的产品

产品Recipe 示例
语音转文本:Nova (/v1/listen)26 个 recipes:transcribe-url、transcribe-file、streaming、streaming-file、punctuate、smart-format、paragraphs、utterances、diarize、multichannel、numerals、measurements、dictation、filler-words、profanity-filter、redact、replace、search、keywords、keyterm、detect-language、detect-entities、summarize、sentiment、topics、intents
语音转文本:Flux STT (/v2/listen)两个 recipes。streaming 使用 model=flux-general-en、encoding=linear16、sample_rate=16000 打开 /v2/listen WebSocket,并打印 TurnInfo 事件(transcript、turn index、event type),以替代 v1 的 interim/final 对。transcribe-url 在 SDK 的 prerecorded transcribe-URL 调用上设置 model=flux-general-en,并配合 smart_format。CLI 只有 transcribe-url。没有专门针对 EOT 或 eager EOT 阈值、会话中途 Configure 或 keyterms 的 recipe
文本转语音:Aura (/v1/speak)generate-audio、stream-audio、websocket-streaming、select-model、select-encoding、bit-rate
Audio Intelligence (/v1/listen)summarize、sentiment、topics、intents、entities
Voice Agentsconnect、custom-llm、custom-tts、function-calling
文本分析 (/v1/read)summarize、sentiment、topics、intents

Audio Intelligence 和文本分析对不同的输入运行相同的分析,因此请根据你已拥有的内容来选择对应的行。Audio Intelligence 的 recipes 是叠加在 /v1/listen 上的查询参数,因此输入是音频,entities 就是其中之一。文本分析的 recipes 是一次 POST /v1/read,因此输入是文本,并且没有 entities recipe:在 /v1/read 上的 detect_entities 会返回 400 {"err_code":"INVALID_QUERY_PARAMETER","err_msg":"unknown query parameter: detect_entities"}。前者请打开 audio-intelligence skill,后者请打开 text-intelligence。文本分析的 recipes 在全部七种语言中都存在。

Nova 是通用 STT 系列;Flux STT 专为对话式音频和 Voice Agents 设计。两者都在积极维护——决策指南见 api skill 的“Nova vs Flux STT”一节。请注意,Flux STT(/v2/listen)和 Flux TTS(/v2/speak)是共享 Flux 名称的两个独立产品。

Flux TTS (/v2/speak) 目前还没有 recipes。 上述 TTS recipes 仅涵盖 /v1/speak 上的 Aura——recipes 仓库中没有 text-to-speech/v2 目录。对于 Flux TTS,请使用 api skill 的“Aura vs Flux TTS”一节了解端点契约,或使用 starters skill 的 flux-tts 应用(node、flask、fastapi、django、java)获取可运行代码。

语言

Python、JavaScript、Go、.NET、Java、Rust,以及 Deepgram CLI(dg / deepctl)。

安装相关 SDK 技能

对于除单一配方之外的语言惯用模式(完整快速入门、常见模式、注意事项),请安装特定于 SDK 的技能:

npx skills add deepgram/deepgram-python-sdk     # Python
npx skills add deepgram/deepgram-js-sdk         # JavaScript / TypeScript
npx skills add deepgram/deepgram-java-sdk       # Java
npx skills add deepgram/deepgram-go-sdk         # Go
npx skills add deepgram/deepgram-rust-sdk       # Rust
npx skills add deepgram/deepgram-dotnet-sdk     # C# / .NET

Swift 和 Kotlin SDK 技能未列出,因为这些仓库不是公开的,npx skills add 无法访问它们。对于浏览器相关工作,请打开 browser-agent 技能:它涵盖了在 npm 上发布的四个 Browser Agent SDK 包(@deepgram/agents、@deepgram/react、@deepgram/ui、@deepgram/agents-widget)。

相关 Deepgram 技能

  • api — 整合的 REST + WebSocket API 参考
  • examples — 第三方平台集成(Twilio、LiveKit、LangChain 等)
  • starters — 可运行的入门应用(框架 × 功能矩阵)
  • docs — 文档查找器
  • setup-mcp — Deepgram MCP 服务安装

评论

支持 Markdown