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

[bot] ruby-anthropic gem (alexrudall) not instrumented

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
ruby
领域
observability

调研方向

先从 lib/braintrust/contrib/ruby_openai/integration.rb 和 lib/braintrust/contrib/anthropic/integration.rb 开始,比较 community-gem 和 official-gem 的模式。然后检查 lib/braintrust/contrib.rb、Appraisals 和 braintrust.gemspec,确认注册情况和依赖覆盖范围。当 ruby-anthropic 的 messages、streaming、batches 和 vision 执行面都完成 instrumentation,并且该 gem 已纳入 repository 设置时,即表示完成。

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

描述

Summary

The ruby-anthropic gem (~444K downloads, v0.4.2, April 2025) by alexrudall is not instrumented by this SDK. This is a direct asymmetry: the SDK instruments both the official OpenAI gem (openai) and alexrudall's community OpenAI gem (ruby-openai), but for Anthropic it only instruments the official gem (anthropic) — not the equivalent community gem (ruby-anthropic) by the same author.

What is missing

No instrumentation exists for any ruby-anthropic execution surface. Key APIs that should be instrumented:

Messages API (Chat Completions)
  • client.messages(parameters: { model:, messages:, ... }) — Core chat completions method supporting Claude models (claude-3-haiku, claude-3-sonnet, claude-3-opus, claude-3.5-sonnet, etc.)
Streaming
  • client.messages(parameters: { ..., stream: Proc.new { |chunk| } }) — Streaming responses via callback proc
Batches API
  • client.messages.batches.create(parameters: { ... }) — Asynchronous batch processing of multiple message requests
Vision
  • Multimodal image analysis via base64-encoded image content in messages

Braintrust docs status

not_found — Braintrust docs at https://www.braintrust.dev/docs/instrument/trace-llm-calls list only the official anthropic gem (minimum version 0.3.0) for Ruby Anthropic tracing. No mention of ruby-anthropic anywhere.

Upstream sources

Local repo files inspected

  • lib/braintrust/contrib.rb (lines 196–205) — registers 4 integrations: OpenAI, RubyOpenAI, RubyLLM, Anthropic. No RubyAnthropic integration.
  • lib/braintrust/contrib/ — contains openai/, ruby_openai/, ruby_llm/, anthropic/ directories. No ruby_anthropic/ directory.
  • lib/braintrust/contrib/ruby_openai/integration.rb — instruments alexrudall's ruby-openai gem, confirming the pattern of instrumenting community gems alongside official ones.
  • lib/braintrust/contrib/anthropic/integration.rb — only instruments the official anthropic gem (checks for ::Anthropic::Client).
  • Appraisals — no appraisal scenarios for ruby-anthropic
  • braintrust.gemspec — no mention of ruby-anthropic
  • Grep for ruby.anthropic and ruby_anthropic across lib/braintrust/ returns zero matches

Notes

The existing ruby_openai integration demonstrates the pattern for instrumenting alexrudall's community gems. A ruby_anthropic integration could follow the same structure: RubyAnthropic::Integration, RubyAnthropic::MessagesPatcher, etc., mirroring how RubyOpenAI::ChatPatcher parallels OpenAI::ChatPatcher.

主要语言
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 摘要。