Skip to content

uncommented the TTS code#79

Merged
GitVivekHub merged 1 commit into
AgrI-Mitra:mainfrom
YoginiTayade:escapt
Aug 11, 2025
Merged

uncommented the TTS code#79
GitVivekHub merged 1 commit into
AgrI-Mitra:mainfrom
YoginiTayade:escapt

Conversation

@YoginiTayade

@YoginiTayade YoginiTayade commented Aug 11, 2025

Copy link
Copy Markdown
Contributor

Description

Please describe the changes in your pull request in few words here.

Changes

List the changes done to fix a bug or introducing a new feature.

How to test

Describe the steps required to test the changes proposed in the pull request.

Please consider using the closing keyword if the pull request is proposed to
fix an issue already created in the repository
(https://help.github.com/articles/closing-issues-using-keywords/)

Summary by CodeRabbit

  • New Features
    • Re-enabled Text-to-Speech in AI tools, allowing users to convert text into audio across supported languages. Audio output is now returned reliably during TTS requests.
  • Bug Fixes
    • Aligned error handling for TTS operations to improve stability and clearer logging when failures occur.
  • Style
    • Minor formatting and logging message tweaks throughout the service with no impact on functionality.

@coderabbitai

coderabbitai Bot commented Aug 11, 2025

Copy link
Copy Markdown

Walkthrough

Re-enabled the textToSpeech function in ai-tools.service.ts by uncommenting its implementation. The method now builds a Bhashini TTS config, invokes computeBhashini with task 'tts', and returns audioContent. Additional changes are formatting and minor stylistic edits without altering public APIs or logic elsewhere.

Changes

Cohort / File(s) Summary of changes
AI Tools Service (TTS reactivation + formatting)
src/modules/aiTools/ai-tools.service.ts
Un-commented and restored textToSpeech flow using getBhashiniConfig('tts', ...), computeBhashini, and returning audioContent; aligned error handling with existing pattern; minor formatting and logging style adjustments; no public API signature changes.

Sequence Diagram(s)

sequenceDiagram
  participant C as Caller
  participant S as AiToolsService
  participant Bc as getBhashiniConfig
  participant Bh as computeBhashini

  C->>S: textToSpeech(text, language, userId, sessionId)
  S->>Bc: getBhashiniConfig('tts', {language:{sourceLanguage: language}}, userId, sessionId)
  Bc-->>S: ttsConfig + serviceDetails
  S->>Bh: computeBhashini('tts', text, serviceDetails)
  Bh-->>S: { audioContent }
  S-->>C: audioContent
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

I twitch my ears at TTS’s return,
A hop, a skip—now voices churn.
From text to tune we lightly leap,
In bytes and waves our notes we keep.
Thump-thump! says rabbit, quite replete. 🎶🐇


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9a4f78b and 7b4f448.

📒 Files selected for processing (1)
  • src/modules/aiTools/ai-tools.service.ts (15 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/modules/aiTools/ai-tools.service.ts (1)
src/modules/aiTools/ai-tools.service.spec.ts (4)
  • mockBhashiniConfig (259-285)
  • mockBhashiniConfig (229-255)
  • it (258-286)
  • mockBhashiniConfig (193-225)
🔇 Additional comments (3)
src/modules/aiTools/ai-tools.service.ts (3)

350-350: Good improvement to callback binding

The addition of the logger to the callback context ensures proper error logging with the correct logger instance.

Also applies to: 424-424


37-37: Minor formatting improvements look good

The spacing and formatting changes throughout the file improve code consistency without affecting functionality.

Also applies to: 47-48, 53-53, 98-103, 105-105, 122-122, 152-156, 182-182, 299-299, 301-301, 309-309, 352-352, 356-357, 359-359, 363-363, 378-378, 390-390, 410-411, 426-426, 430-431, 433-433, 437-437, 439-439


199-250: ✅ textToSpeech method approved

Implementation has been verified to match the established speech-to-text pattern and aligns with existing test coverage for the pipelineResponse[0].audio[0].audioContent structure. No further changes required.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@GitVivekHub GitVivekHub merged commit 6a3d5c7 into AgrI-Mitra:main Aug 11, 2025
1 of 4 checks passed
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