Skip to content

Conversation

@yujonglee
Copy link
Contributor

@yujonglee yujonglee commented Dec 5, 2025

refactor(api): reorganize STT providers into directory structure

Summary

Restructures apps/api/src/stt to follow the pattern from owhisper/owhisper-client/src/adapter. Each STT provider now has its own directory with separate files for live streaming and batch transcription:

stt/
├── deepgram/
│   ├── index.ts    # re-exports
│   ├── live.ts     # WebSocket proxy
│   └── batch.ts    # batch transcription
├── assemblyai/
│   ├── index.ts
│   ├── live.ts
│   └── batch.ts
├── soniox/
│   ├── index.ts
│   ├── live.ts
│   └── batch.ts
├── index.ts        # main exports (unchanged API)
├── batch-types.ts  # shared types
├── connection.ts   # WsProxyConnection
└── utils.ts

No logic changes - purely file reorganization with updated import paths.

Review & Testing Checklist for Human

  • Verify import paths are correct (changed from ../env to ../../env, ./batch-types to ../batch-types, etc.)
  • Confirm the public API exported from apps/api/src/stt/index.ts is unchanged

Notes

Restructure apps/api/src/stt to follow the pattern from owhisper-client/src/adapter:
- Create provider directories: deepgram/, assemblyai/, soniox/
- Move live streaming code to <provider>/live.ts
- Move batch transcription code to <provider>/batch.ts
- Add index.ts for each provider to export both modules
- Update main index.ts to import from provider directories

Co-Authored-By: yujonglee <[email protected]>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@netlify
Copy link

netlify bot commented Dec 5, 2025

Deploy Preview for hyprnote-storybook ready!

Name Link
🔨 Latest commit 1a38ba3
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/6932bc09c90ef400087227a8
😎 Deploy Preview https://deploy-preview-2149--hyprnote-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 5, 2025

📝 Walkthrough

Walkthrough

This PR reorganizes the STT (Speech-to-Text) module structure by adjusting import paths across AssemblyAI, Deepgram, and Soniox providers, creating new index files to centralize public API exports, and updating the main stt/index.ts to consolidate imports and re-export from provider index files.

Changes

Cohort / File(s) Change Summary
AssemblyAI provider module updates
apps/api/src/stt/assemblyai/batch.ts, apps/api/src/stt/assemblyai/live.ts
Updated import paths: env imports adjusted from ../env to ../../env, and WsProxyConnection/batch-types imports adjusted to reference new locations.
AssemblyAI public API index
apps/api/src/stt/assemblyai/index.ts
New file that re-exports buildAssemblyAIUrl, createAssemblyAIProxy from live module, and transcribeWithAssemblyAI from batch module.
Deepgram provider module updates
apps/api/src/stt/deepgram/batch.ts, apps/api/src/stt/deepgram/live.ts
Updated import paths: env imports adjusted from ../env to ../../env, and WsProxyConnection/batch-types imports adjusted to reference new locations.
Deepgram public API index
apps/api/src/stt/deepgram/index.ts
New file that re-exports buildDeepgramUrl, createDeepgramProxy from live module, and transcribeWithDeepgram from batch module.
Soniox provider module updates
apps/api/src/stt/soniox/batch.ts, apps/api/src/stt/soniox/live.ts
Updated import paths: env imports adjusted from ../env to ../../env, and WsProxyConnection/batch-types imports adjusted to reference new locations.
Soniox public API index
apps/api/src/stt/soniox/index.ts
New file that re-exports buildSonioxUrl, createSonioxProxy from live module, and transcribeWithSoniox from batch module.
Main STT index consolidation
apps/api/src/stt/index.ts
Consolidated import statements and updated re-exports to source from new provider index files instead of individual batch modules.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Verify all import path adjustments are correct, particularly env and WsProxyConnection references across batch/live files
  • Confirm all new index files re-export the correct functions from their source modules
  • Ensure the main stt/index.ts correctly imports from the new provider index files with no missing or duplicate exports

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately describes the main change: reorganizing STT providers into a directory structure.
Description check ✅ Passed The description is well-related to the changeset, providing context about the directory structure reorganization and import path updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch devin/1764932262-stt-provider-structure

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6420965 and 1a38ba3.

📒 Files selected for processing (10)
  • apps/api/src/stt/assemblyai/batch.ts (1 hunks)
  • apps/api/src/stt/assemblyai/index.ts (1 hunks)
  • apps/api/src/stt/assemblyai/live.ts (1 hunks)
  • apps/api/src/stt/deepgram/batch.ts (1 hunks)
  • apps/api/src/stt/deepgram/index.ts (1 hunks)
  • apps/api/src/stt/deepgram/live.ts (1 hunks)
  • apps/api/src/stt/index.ts (1 hunks)
  • apps/api/src/stt/soniox/batch.ts (1 hunks)
  • apps/api/src/stt/soniox/index.ts (1 hunks)
  • apps/api/src/stt/soniox/live.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Agent implementations should use TypeScript and follow the established architectural patterns defined in the agent framework
Agent communication should use defined message protocols and interfaces

Files:

  • apps/api/src/stt/soniox/live.ts
  • apps/api/src/stt/assemblyai/index.ts
  • apps/api/src/stt/index.ts
  • apps/api/src/stt/assemblyai/batch.ts
  • apps/api/src/stt/deepgram/batch.ts
  • apps/api/src/stt/deepgram/live.ts
  • apps/api/src/stt/soniox/batch.ts
  • apps/api/src/stt/assemblyai/live.ts
  • apps/api/src/stt/soniox/index.ts
  • apps/api/src/stt/deepgram/index.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Avoid creating a bunch of types/interfaces if they are not shared. Especially for function props, just inline them instead.
Never do manual state management for form/mutation. Use useForm (from tanstack-form) and useQuery/useMutation (from tanstack-query) instead for 99% of cases. Avoid patterns like setError.
If there are many classNames with conditional logic, use cn (import from @hypr/utils). It is similar to clsx. Always pass an array and split by logical grouping.
Use motion/react instead of framer-motion.

Files:

  • apps/api/src/stt/soniox/live.ts
  • apps/api/src/stt/assemblyai/index.ts
  • apps/api/src/stt/index.ts
  • apps/api/src/stt/assemblyai/batch.ts
  • apps/api/src/stt/deepgram/batch.ts
  • apps/api/src/stt/deepgram/live.ts
  • apps/api/src/stt/soniox/batch.ts
  • apps/api/src/stt/assemblyai/live.ts
  • apps/api/src/stt/soniox/index.ts
  • apps/api/src/stt/deepgram/index.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Redirect rules - hyprnote
  • GitHub Check: Header rules - hyprnote
  • GitHub Check: Pages changed - hyprnote
  • GitHub Check: fmt
  • GitHub Check: Devin
🔇 Additional comments (10)
apps/api/src/stt/deepgram/live.ts (1)

1-2: LGTM! Import paths correctly updated.

The import path adjustments properly reflect the new directory structure where provider files are nested in subdirectories.

apps/api/src/stt/assemblyai/live.ts (1)

1-2: LGTM! Import paths correctly updated.

The import path adjustments are consistent with the directory reorganization.

apps/api/src/stt/deepgram/batch.ts (1)

1-2: LGTM! Import paths correctly updated.

Both the env and batch-types import paths are properly adjusted for the new module structure.

apps/api/src/stt/assemblyai/batch.ts (1)

1-9: LGTM! Import paths correctly updated.

The import path adjustments for env and batch-types are consistent with the directory reorganization.

apps/api/src/stt/soniox/batch.ts (1)

1-9: LGTM! Import paths correctly updated.

The import path adjustments are consistent with the directory reorganization pattern applied across all STT providers.

apps/api/src/stt/soniox/live.ts (1)

1-2: LGTM! Import paths correctly updated.

The import path adjustments match the pattern used in other live.ts files and properly reflect the new directory structure.

apps/api/src/stt/assemblyai/index.ts (1)

1-2: LGTM! Clean provider API consolidation.

This index file properly centralizes the AssemblyAI public API exports, creating a clean module boundary.

apps/api/src/stt/soniox/index.ts (1)

1-2: LGTM! Clean provider API consolidation.

This index file properly centralizes the Soniox public API exports, matching the established pattern across all three STT providers (Deepgram, AssemblyAI, and Soniox). Each provider follows the same structure, exporting their live connection utilities and batch transcription functions.

apps/api/src/stt/deepgram/index.ts (1)

1-2: LGTM!

Clean barrel file that consolidates the Deepgram provider's public API. The pattern is consistent with the other STT providers (AssemblyAI, Soniox) and provides a clear, single entry point for consumers.

apps/api/src/stt/index.ts (1)

1-23: LGTM!

The reorganization cleanly separates concerns:

  • Imports on lines 1, 4, 5 are for local function use (transcribeBatch, createProxyFromRequest)
  • Re-exports on lines 9-23 define the public API surface for consumers

This approach provides explicit control over both internal usage and external exposure while leveraging the new provider-specific index files.


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 and usage tips.

@netlify
Copy link

netlify bot commented Dec 5, 2025

Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit 1a38ba3
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/6932bc097d2d110008df3604
😎 Deploy Preview https://deploy-preview-2149--hyprnote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@yujonglee yujonglee merged commit 0056bd7 into main Dec 5, 2025
13 of 14 checks passed
@yujonglee yujonglee deleted the devin/1764932262-stt-provider-structure branch December 5, 2025 11:07
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.

2 participants