sfortis / openai_tts Goto Github PK
View Code? Open in Web Editor NEWOpenAI TTS custom component for HA
License: GNU General Public License v3.0
OpenAI TTS custom component for HA
License: GNU General Public License v3.0
I have added my OpenAI API key in the configuration, however whenever I try to call the tts.openai_tts_say
, for example:
service: tts.openai_tts_say
data:
entity_id: media_player.living_room_speaker
message: This is a test message
I receive the following error:
HTTP error from OpenAI: 429 Client Error: Too Many Requests for url: https://api.openai.com/v1/audio/speech
I haven't seen any other steps to take in order to start using the service. Any idea on what the issue might be?
By Adding Wyoming Protocol support, I can use this in Assist voice assistant.
Please Add Wyoming Protocol compatibility.
I'd like to be able to define the voice in the "options" field (and the other fields too, but primarily just voices), seen in Developer tools > services > call tts.openai_tts_say as well as Node-RED. I tried making some changes but I don't know much Python so I'm not sure the level of effort for this change. I think it would make sense to have defaults or be able to define them in configuration.yaml too.
Hi, first I want to say great job on this and thank you for making it!
One small issue I found though that I was wondering if you could look into: the configuration.yaml file is not happy with me using environment variables for the API key.
Failed to restart Home Assistant
The system cannot restart because the configuration is not valid: Error loading /config/configuration.yaml: OPENAIAPI
This seems to work with other items in the configuration.yaml file so I assume it's related to the integration, but might not be.
tts:
- platform: openai_tts
api_key: !env_var OPENAIAPI
Speed is currently configured as an integer. But as per the API, should be float with range from 0.25 to 4 (default 1).
Updated my own code to float instead of Int and worked a treat.
I've tried inputting the OpenAI API key in the "Add text-to-speech engine" dialog when adding integration but the input window just reloads. Tried multiple keys that work in other integrations.
Using the new 56 character API keys.
Just installed openai_tts today so have the latest version.
I get the following in the logs..
Logger: custom_components.openai_tts.config_flow
Source: custom_components/openai_tts/config_flow.py:56
integration: openai_tts ([documentation](https://github.com/sfortis/openai_tts/), [issues](https://github.com/sfortis/openai_tts/issues))
First occurred: 18:13:10 (4 occurrences)
Last logged: 18:14:28
Wrong or no API key provided.
Traceback (most recent call last):
File "/config/custom_components/openai_tts/config_flow.py", line 56, in async_step_user
await validate_input(user_input)
File "/config/custom_components/openai_tts/config_flow.py", line 21, in validate_input
raise WrongAPIKey
custom_components.openai_tts.config_flow.WrongAPIKey
The UI setup of the integration only asks for API key, speed, model and voice.
In the YAML version I was able to configure the language, how do I do that now?
I'm getting a 70 character key back when I create a key owned by a Service Account.
Works fine if I increase the limit in this:
Traceback (most recent call last):
File "/config/custom_components/openai_tts/config_flow.py", line 63, in async_step_user
await validate_user_input(user_input)
File "/config/custom_components/openai_tts/config_flow.py", line 28, in validate_user_input
await validate_api_key(user_input.get(CONF_API_KEY))
File "/config/custom_components/openai_tts/config_flow.py", line 24, in validate_api_key
raise WrongAPIKey("Invalid API key length")
custom_components.openai_tts.config_flow.WrongAPIKey: Invalid API key length
The CONF_API_KEY config value is checked to be 51 character long, but the new project based openapi keys are 56 character long. Also I didn't succeed to use my old key to generate voice (got an error from the API call), so I had to change the code in custom_components to allow 56 characters and then it worked with my project api key.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.