Repository navigation
v0.3.0 feat: audio and video for Cloudflare's clef-omni - #23
Merged
Merged
Conversation
Client#ask takes audio: and videos: next to images:, as base64 data URLs. Providers opt in through supports_audio?(model) and supports_videos?(model), false by default; Cloudflare says yes for clef-omni only, so audio or video sent to clef, clef-flash, or any other provider raises RequestError before anything is sent. Base#request_body carries the two new fields. Media.data_url and Media.from_file build data URLs for images, audio, and video. Images is unchanged. cloudflare/clef-omni and @cf/cloudflare/clef-omni resolve on the Cloudflare provider; in 0.2.0 they raised ConfigurationError. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sends an audio clip and a video to targets whose model reads them, the way SMOKE_IMAGE already does for images. A target that skips a given file now says so on its ok line, so a run against a model that does not read audio cannot pass for one that exercised it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README covers audio: and videos:, the Media helper, how far the client-side check goes, retries replaying the whole body, the clef-omni aliases, the new provider hooks, and timeouts for long clips. Hosted clef-flash now has a 24,576-token context window, and Cloudflare cuts a longer text state to fit without an error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
0.3.0 lets
Client#asksend audio and video to Cloudflare'sclef-omni, the multimodal Clef model Cloudflare released on Workers AI. Text and image calls toclef-omnialready worked on 0.2.0; audio and video could not be sent at all.ask(audio:, videos:)next toimages:, as base64 data URLs. On Cloudflare they go in the top-levelaudioandvideosfields.RubyDecisionModel::Media.from_file/.data_urlbuild data URLs for images, audio (WAV, MP3), and video (MP4, WebM).Imagesis unchanged.clef,clef-flash, or any other provider raisesRequestErrorand nothing goes over the wire. Onlyclef-omniis allowed, because Cloudflare does not document what the other models do with those fields.cloudflare/clef-omniand@cf/cloudflare/clef-omniresolve on the Cloudflare provider. In 0.2.0 they raisedConfigurationError.supports_audio?(model)andsupports_videos?(model), false by default.Base#request_bodyacceptsaudio:andvideos:.rake smoketakesSMOKE_AUDIOandSMOKE_VIDEO, and printsskipped <kind>when a target does not read a supplied file.clef-flashnow has a 24,576-token context window and that Cloudflare cuts a longer text state to fit without an error.request_body, andsupports_images?is still called with no argument.Not changed on purpose: default timeouts (5 seconds for Cloudflare), the
:system_oneprovider (no confirmed wire format for a self-hosted Clef-omni), and OpenRouter aliases (OpenRouter does not listclef-omni).Not verified live against Cloudflare. The
audioandvideosfield names come from Cloudflare's model page, not from a request that returned answers; no Cloudflare credentials were available where this was built. A liverake smoke TARGETS=open_router,open_router:clefon this branch answered through Jev and Clef (text path). To check the new path:rake smoke TARGETS=cloudflare:clef-omni SMOKE_AUDIO=clip.mp3 SMOKE_VIDEO=clip.mp4.Merging this publishes 0.3.0 to RubyGems through the Release workflow.
Test Coverage
Tests: 199 → 216 (+17), 613 → 699 assertions, 7 test files. Zero warnings on Ruby 3.3.4; also green on 3.2.1.
The coverage audit wrote 8 of the 17, including three regression tests for behaviour 0.2.0 callers rely on. It found no bugs.
Pre-Landing Review
Five specialists, a red team, and two adversarial passes (Claude and Codex) reviewed the diff, plus a Codex structured review. No critical findings. Codex structured review: no actionable defects.
Fixed before this PR:
supports_audio?orsupports_videos?must acceptaudio:/videos:inrequest_body(api-contract).from_filereads the whole file, and that format, size, and count are the provider's to enforce (both adversarial passes).retry: { max_retries: 0 }for large clips (red team).rake smokeprinted a plainokfor a target that skipped the supplied audio or video. It now printsskipped audio/skipped video(red team).Left as is, all of them true of
images:since 0.2.0:RequestErrorwith a message that names "state or questions".Encoding::CompatibilityError, notRequestError.audio: {}is treated like an empty array.Testing, maintainability, security, and performance specialists: no findings.
Design Review
No frontend files changed. Design review skipped.
Eval Results
No prompt-related files changed. Evals skipped.
Scope Drift
Scope Check: CLEAN. Intent: audio and video for
clef-omniin a 0.3.0 release. Delivered: that, its docs, and the smoke options needed to verify it.Plan Completion
No plan file detected.
Test plan
bundle exec rake: 216 runs, 699 assertions, 0 failures, 0 errors, 0 warnings (Ruby 3.3.4)rake release:buildwith--strict:ruby_decision_model-0.3.0.gembuilds and carries all 19 files underlib/rake smoke TARGETS=open_router,open_router:clef: both answeredrake smoke TARGETS=cloudflare:clef-omni SMOKE_AUDIO=clip.mp3 SMOKE_VIDEO=clip.mp4(needs Cloudflare credentials)🤖 Generated with Claude Code