Skip to content

Add TTS and ASR speech functionality from cursor/fixing-code-issues-5…#2

Open
AnshumanAI wants to merge 3 commits into
mainfrom
brlatest
Open

Add TTS and ASR speech functionality from cursor/fixing-code-issues-5…#2
AnshumanAI wants to merge 3 commits into
mainfrom
brlatest

Conversation

@AnshumanAI
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bugbot free trial expires on August 10, 2025
Learn more in the Cursor dashboard.

"Authorization" -> s"Bearer ${config.apiKey}",
"Content-Type" -> "application/json"
)
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Incorrect API Request Format and Type Mismatch

The OpenAI transcription API expects multipart/form-data with a binary audio file, but the current implementation sends application/json with base64-encoded audio in a "file" field, causing API requests to fail (e.g., 400 Bad Request). Additionally, the requestBody for the transcription API call is incorrectly constructed as a mutable.Map instead of a ujson.Obj before attempting to call .render(), resulting in a type mismatch.

Locations (1)

Fix in Cursor Fix in Web

def getTTSClient(provider: SpeechProvider, config: SpeechProviderConfig): TTSClient =
provider match {
case SpeechProvider.OpenAI =>
new OpenAISpeechClient(config.asInstanceOf[OpenAISpeechConfig])
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Type Safety Violation in Speech Client Retrieval

Unsafe type casting using asInstanceOf without validation in getTTSClient and getASRClient methods. If an incorrect SpeechProviderConfig type is passed for a given SpeechProvider, it will result in a ClassCastException at runtime instead of being caught at compile time.

Locations (2)

Fix in Cursor Fix in Web

cursoragent and others added 2 commits July 27, 2025 21:19
Co-authored-by: mcs23026 <mcs23026@iiitl.ac.in>
Co-authored-by: mcs23026 <mcs23026@iiitl.ac.in>
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