Skip to content

feat: add grok-stt tool (speech-to-text) - #36

Merged
hrco merged 1 commit into
releasefrom
feat/grok-stt
Jul 4, 2026
Merged

feat: add grok-stt tool (speech-to-text)#36
hrco merged 1 commit into
releasefrom
feat/grok-stt

Conversation

@hrco

@hrco hrco commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • PR 2 of 5 for issue feat: new tool areas — TTS, STT, Files API, Context Compaction, Batch #21 — adds the grok-stt tool per docs/issue-21-scope.md (from docs: scope issue #21 (TTS, STT, Files API, Context Compaction, Batch) #34).
  • New constant: STT_API_BASE.
  • make_stt_request() — submits via the url field only (server-side download). The endpoint requires multipart/form-data even for url-only submissions; httpx's plain data= dict would encode as application/x-www-form-urlencoded instead, so fields go through files= using (None, value) tuples to force multipart encoding without an actual file part.
  • handle_grok_stt() — validates audio_url, guards that inverse_text_normalization requires language (per the API's documented constraint), returns transcript text plus a speaker/channel table when diarize or multichannel was requested.
  • Tool schema registered in list_tools() / dispatched in call_tool().

v1 cuts (flagged in the scope doc as intentional, not oversights):

  • Local file upload deferred — url-only for now.
  • keyterm biasing deferred — delimiter format is unconfirmed in xAI's docs.

Note on test file naming: used tests/test_stt_tools.py instead of the scope doc's suggested combined test_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 pass
  • pytest 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 #27 nexuswedge rename, both unrelated to this change), 3 skipped — no regressions
  • Verified grok-stt appears in list_tools() output (20 tools total)
  • Founder smoke test against real XAI_API_KEY + real audio URL

🤖 Generated with Claude Code

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.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@hrco, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 48 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a32d82c4-698c-4a87-8655-dcccf079a6d0

📥 Commits

Reviewing files that changed from the base of the PR and between e7ee108 and e0e2e64.

📒 Files selected for processing (2)
  • tests/test_stt_tools.py
  • xbridge_mcp/server.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/grok-stt

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hrco
hrco merged commit 4bc4f45 into release Jul 4, 2026
1 check passed
hrco added a commit that referenced this pull request Jul 4, 2026
Resolves PR #35 conflicts after grok-stt (#36) landed on release.
Both audio tools coexist: grok-tts and grok-stt.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant