[bot] RubyLLM content moderation (`RubyLLM.moderate`) not instrumented
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- ruby
- Lĩnh vực
- observability
Hướng nghiên cứu
Bắt đầu với lib/braintrust/contrib/ruby_llm/patcher.rb và integration.rb, sau đó so sánh các mẫu hiện có trong các tệp moderation của OpenAI và phần instrumentation moderation của ruby-openai. Triển khai RubyLLM moderation instrumentation còn thiếu cho các trường input, metadata, output và latency đã được ghi trong tài liệu, đăng ký nó cùng với ChatPatcher và xác minh rằng integration bao phủ RubyLLM.moderate và RubyLLM::Moderation.moderate.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
The ruby_llm gem provides RubyLLM.moderate(input, ...) for AI-powered content moderation. This API is not instrumented by this SDK. The current RubyLLM integration only instruments RubyLLM::Chat. Content moderation uses an AI classification model to screen text and images for harmful content, and is a distinct execution surface from chat completions.
This is a cross-library parity gap: the Braintrust Ruby SDK already instruments OpenAI's moderation API for both the openai gem (OpenAI::Resources::Moderations) and the ruby-openai gem (ModerationsPatcher). The equivalent ruby_llm surface has no instrumentation.
What is missing
RubyLLM.moderate(input, model:, with:, provider:, ...) / RubyLLM::Moderation.moderate(input, ...) — invokes a provider moderation model (e.g., OpenAI's omni-moderation-latest) and returns a RubyLLM::Moderation object containing:
id— provider-assigned identifiermodel— model ID used for moderationresults— array ofResultobjects with category flags and scores
What a span should capture
- Input: text string(s) and/or image attachments being moderated
- Metadata: model, provider, endpoint
- Output: flagged status (
flagged?), flagged categories, per-category scores - Metrics:
time_to_first_token(latency)
The implementation pattern is established: ModerationsPatcher for openai and ruby-openai gems both wrap a single create-style method. A new ModerationPatcher for ruby_llm would wrap Moderation.moderate.
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. Moderation is not mentioned. The OpenAI integration page does describe moderation support for the openai gem.
Upstream sources
- RubyLLM
Moderationclass: https://github.com/crmne/ruby_llm/blob/main/lib/ruby_llm/moderation.rb - RubyLLM module
moderatemethod: https://github.com/crmne/ruby_llm/blob/main/lib/ruby_llm.rb
Local repo files inspected
lib/braintrust/contrib/ruby_llm/patcher.rb— defines onlyChatPatcher; noModerationPatcherlib/braintrust/contrib/ruby_llm/integration.rb— registers[ChatPatcher]onlylib/braintrust/contrib/openai/instrumentation/moderations.rb— existing OpenAI moderation instrumentation (pattern to follow)lib/braintrust/contrib/openai/patcher.rb—ModerationsPatcherdemonstrates the patcher patternlib/braintrust/contrib/ruby_openai/instrumentation/moderations.rb— ruby-openai moderation instrumentation- Grep for
moderate,Moderation,ModerationPatcheracrosslib/braintrust/contrib/ruby_llm/returns zero matches
- Ngôn ngữ chính
- Ruby
- Star
- 9
- Fork
- 10
- Merge trung bình
- 3 ngày 43 phút
- Pull request đã merge (30 ngày)
- 9
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của braintrustdata/braintrust-sdk-ruby
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
[BOT ISSUE] OpenAI Chat Completions missing reasoning model and web search metadata parametersĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
ruby
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
ruby
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Tất cả issue của braintrustdata/braintrust-sdk-ruby
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Homebrew/homebrew-cask#293134 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
notch8/iiif_print#430 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ActionText::Content#to_markdown: <br> in a table cell and empty <tr> produce malformed Markdown tablesCó thể đã có người làm @azmi2409 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày