Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[bot] RubyLLM speech synthesis (`RubyLLM.speak`) not instrumented

未关闭
#191 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
70/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
冷清
技术栈
ruby

调研方向

从 lib/braintrust/contrib/ruby_llm/patcher.rb、instrumentation/chat.rb 和 integration.rb 开始,然后对比现有的 Embed、Paint 和 Transcription 模式。检查 RubyLLM Speech 源码以及 Appraisals 中支持的版本。当 RubyLLM.speak 和 RubyLLM::Speech.speak 创建能够捕获所列输入、元数据、音频输出详细信息和延迟的 spans,且不记录原始音频字节时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

Summary

The ruby_llm gem provides RubyLLM.speak(input, ...) for text-to-speech synthesis using AI TTS models. This API is not instrumented by this SDK. The current RubyLLM integration only instruments RubyLLM::Chat — covering chat completions, tool execution, and streaming. speak is a distinct generative AI execution surface (it drives a TTS model to produce audio from text) and produces usage data (token counts via some providers), yet no span is created for it.

This is a direct parity gap with the OpenAI Audio integration gap (#146), which notes that TTS execution via client.audio.speech.create is also uninstrumented. Both use AI models to generate audio from text input.

What is missing

RubyLLM.speak(input, model:, voice:, ...) / RubyLLM::Speech.speak(input, ...) — invokes a TTS provider (OpenAI tts-1, tts-1-hd, or equivalent) and returns a RubyLLM::Speech object containing:

  • data — raw audio bytes
  • model — model ID used for synthesis
  • voice — voice selected
  • format — audio format (mp3, wav, flac, etc.)
What a span should capture
  • Input: the text string passed to speak
  • Metadata: model, voice, format, provider
  • Output: audio format and size (not the raw binary bytes)
  • Metrics: time_to_first_token (latency)

The implementation pattern already exists: RubyLLM::Embed, RubyLLM::Paint, and RubyLLM::Transcription are single-method execution surfaces (see issue #136). RubyLLM::Speech follows the same shape and would be instrumented with the same approach: a new SpeechPatcher wrapping the speak class method.

Braintrust docs status

not_found — The Braintrust RubyLLM integration docs at https://www.braintrust.dev/docs/integrations/sdk-integrations/ruby-llm document only chat completions, tool calls, token usage, and streaming. Speech synthesis is not mentioned.

Upstream sources

Local repo files inspected

  • lib/braintrust/contrib/ruby_llm/patcher.rb — defines only ChatPatcher; no SpeechPatcher
  • lib/braintrust/contrib/ruby_llm/instrumentation/chat.rb — wraps Chat#complete and Chat#execute_tool only
  • lib/braintrust/contrib/ruby_llm/integration.rb — registers [ChatPatcher] only
  • Appraisals — tests ruby_llm at versions 1.8, 1.9, and latest; speech.rb is present in all supported versions
  • Grep for speak, Speech, tts, SpeechPatcher across lib/braintrust/ returns zero matches
主要语言
Ruby
星标
9
派生
11
平均合并
3 天 43 分钟
30 天内合并 PR
9

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

braintrustdata/braintrust-sdk-ruby 的其他 Issue

查看 braintrustdata/braintrust-sdk-ruby 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。