[bot] RubyLLM speech synthesis (`RubyLLM.speak`) not instrumented
维护者通常 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 bytesmodel— model ID used for synthesisvoice— voice selectedformat— 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
- RubyLLM
Speechclass: https://github.com/crmne/ruby_llm/blob/main/lib/ruby_llm/speech.rb - RubyLLM module
speakmethod: https://github.com/crmne/ruby_llm/blob/main/lib/ruby_llm.rb - RubyGems (ruby_llm): https://rubygems.org/gems/ruby_llm — "Features chat (text, images, audio, PDFs), image generation, embeddings, tools (function calling)…" (audio includes TTS)
Local repo files inspected
lib/braintrust/contrib/ruby_llm/patcher.rb— defines onlyChatPatcher; noSpeechPatcherlib/braintrust/contrib/ruby_llm/instrumentation/chat.rb— wrapsChat#completeandChat#execute_toolonlylib/braintrust/contrib/ruby_llm/integration.rb— registers[ChatPatcher]onlyAppraisals— tests ruby_llm at versions 1.8, 1.9, and latest;speech.rbis present in all supported versions- Grep for
speak,Speech,tts,SpeechPatcheracrosslib/braintrust/returns zero matches
- 主要语言
- Ruby
- 星标
- 9
- 派生
- 11
- 平均合并
- 3 天 43 分钟
- 30 天内合并 PR
- 9
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
braintrustdata/braintrust-sdk-ruby 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
braintrustdata/braintrust-sdk-ruby#155 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
braintrustdata/braintrust-sdk-ruby#143 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
braintrustdata/braintrust-sdk-ruby#137 ·
维护者通常 1 天内回复
-
ruby
难度 3/5 半天 新手友好度 62/100
braintrustdata/braintrust-sdk-ruby#229 ·
维护者通常 1 天内回复
-
ruby
难度 3/5 1-2 天 新手友好度 45/100
braintrustdata/braintrust-sdk-ruby#228 ·
维护者通常 1 天内回复
查看 braintrustdata/braintrust-sdk-ruby 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
glossarist/glossarist-ruby#247 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
voxpupuli/puppet-corosync#589 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
theforeman/puppet-foreman_scap_client#93 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
simp/pupmod-simp-simp#406 ·