-
-
Notifications
You must be signed in to change notification settings - Fork 304
Add TTS support #481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add TTS support #481
Conversation
lib/ruby_llm/models.rb
Outdated
| @instance ||= new | ||
| end | ||
|
|
||
| def provider_for(model) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this change intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh no! I will change it back.
| parse_image_response(response, model:) | ||
| end | ||
|
|
||
| def tts(input, model:, voice:) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be named with a simple verb like the other ones? Maybe RubyLLM.speak?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RubyLLM.speak was my first idea as well. Than I thought RubyLLM.tts might be clearer for users.
Also there is an alias 'say' for 'ask' in lib/ruby_llm/active_record/chat_methods.rb.
And the difference between 'say' and 'speak' might be confusing.
So, if you are happier with 'speak', I could change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it is a bit confusing. Honestly as I said in discord, asking an LLM library to do this is a bit confusing in general. But I guess we have transcribe so, why not? Not sure what naming would be best. Up to @crmne ultimately.
What this does
This PR adds text-to-speech functionality. With it you can call for example "audio = RubyLLM.tts('Hello')".
Docs are extended in the core-functionality section.
Type of change
Scope check
Quality check
overcommit --installand all hooks passbundle exec rake vcr:record[provider_name]bundle exec rspecmodels.json,aliases.json)API changes