Coder Social home page Coder Social logo

openai_tts's People

Contributors

dvejsada avatar jkpe avatar sfortis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

openai_tts's Issues

Unable to produce TTS output

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?

Enable voice selection in options (feature request)

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.

Unable to use environment variable

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 Int instead of Float

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.

Missing agent

image

Could you advice how to setup the AGENT ? Also in your video you call TTS, is this needed? If so how to set it up?

Wrong API key

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

Language selection?

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?

Invalid API key length

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:

if not (51 <= len(api_key) <= 56):

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

CONF_API_KEY length 51 vs 56

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.