feat: add grok-stt tool (speech-to-text) - #36
Conversation
New STT surface per issue #21 (PR 2 of 5). make_stt_request() submits via the `url` field only (server-side download) since the endpoint requires multipart/form-data even for url-only submissions -- httpx's plain data= dict encodes as x-www-form-urlencoded, so fields are sent through files= using (None, value) tuples to force multipart encoding without an actual file part. v1 cut: local `file` upload and `keyterm` biasing deferred (keyterm delimiter format unconfirmed in docs), per docs/issue-21-scope.md.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 48 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
grok-stttool perdocs/issue-21-scope.md(from docs: scope issue #21 (TTS, STT, Files API, Context Compaction, Batch) #34).STT_API_BASE.make_stt_request()— submits via theurlfield only (server-side download). The endpoint requiresmultipart/form-dataeven for url-only submissions; httpx's plaindata=dict would encode asapplication/x-www-form-urlencodedinstead, so fields go throughfiles=using(None, value)tuples to force multipart encoding without an actual file part.handle_grok_stt()— validatesaudio_url, guards thatinverse_text_normalizationrequireslanguage(per the API's documented constraint), returns transcript text plus a speaker/channel table whendiarizeormultichannelwas requested.list_tools()/ dispatched incall_tool().v1 cuts (flagged in the scope doc as intentional, not oversights):
fileupload deferred —url-only for now.keytermbiasing deferred — delimiter format is unconfirmed in xAI's docs.Note on test file naming: used
tests/test_stt_tools.pyinstead of the scope doc's suggested combinedtest_audio_tools.py— PR 1 (grok-tts, #35) already claims that filename, and since these PRs merge independently, sharing a filename would cause an add/add conflict for whichever merges second.Test plan
pytest tests/test_stt_tools.py -v— 9/9 new tests passpytest tests/— 212 passed, 54 pre-existing failures (51 known pytest-asyncio strict-mode baseline + 3 stale Docker-namespace assertions from the fix: publish Docker image under nexuswedge namespace #27nexuswedgerename, both unrelated to this change), 3 skipped — no regressionsgrok-sttappears inlist_tools()output (20 tools total)XAI_API_KEY+ real audio URL🤖 Generated with Claude Code