NeonGeckoCom / neon-stt-plugin-google_cloud_streaming

Google cloud streaming STT plugin for Neon/Mycroft
Other
0 stars 1 forks source link

Just a Question... #42

Open JoergZ2 opened 1 year ago

JoergZ2 commented 1 year ago

Description

I wonder that a STT plugin is activated via the TTS section. Is that correct? Furthermore, I wonder if the JSON syntax is correct: no quotes at all.... Now I fetched an API Key for Goggle STT. I put the plugin call into the STT part of mycroft.conf. Now the plugin is found by OVOS. But there are problems with the API-Key. Mycroft.conf :

  "stt": {
    "module": "google_cloud_streaming",
    "google_cloud": {
      "lang": "de-de",
      "credential": "MyApiKey"
    }
  },

But voice.log throws this error:

 2023-06-17 13:01:21.064 - voice - neon_utils.authentication_utils:find_neon_google_keys:193 - ERROR - No credentials found in default locations or path: /home/ovos/
2023-06-17 13:01:21.069 - voice - neon_stt_plugin_google_cloud_streaming:__init__:79 - ERROR - No google credentials found in default locations or path: ~/
2023-06-17 13:01:30.106 - voice - ovos_plugin_manager.stt:create:160 - ERROR - The selected STT plugin could not be loaded!
Traceback (most recent call last):
  File "/home/ovos/.local/lib/python3.9/site-packages/ovos_plugin_manager/stt.py", line 158, in create
    return clazz(plugin_config)
  File "/home/ovos/.local/lib/python3.9/site-packages/neon_stt_plugin_google_cloud_streaming/__init__.py", line 82, in __init__
    self.client = speech.SpeechClient(credentials=credentials)
  File "/home/ovos/.local/lib/python3.9/site-packages/google/cloud/speech_v1/services/speech/client.py", line 459, in __init__
    self._transport = Transport(
  File "/home/ovos/.local/lib/python3.9/site-packages/google/cloud/speech_v1/services/speech/transports/grpc.py", line 153, in __init__
    super().__init__(
  File "/home/ovos/.local/lib/python3.9/site-packages/google/cloud/speech_v1/services/speech/transports/base.py", line 101, in __init__
    credentials, _ = google.auth.default(
  File "/home/ovos/.local/lib/python3.9/site-packages/google/auth/_default.py", line 692, in default
    raise exceptions.DefaultCredentialsError(_CLOUD_SDK_MISSING_CREDENTIALS)
google.auth.exceptions.DefaultCredentialsError: Your default credentials were not found. To set up Application Default Credentials, see https://cloud.google.com/docs/authentication/externa>
2023-06-17 13:01:30.132 - voice - mycroft.listener:run:506 - ERROR - Starting producer/consumer threads for listener failed.
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/mycroft/listener/__init__.py", line 504, in run
    self.start_async()
  File "/usr/local/lib/python3.9/dist-packages/mycroft/listener/__init__.py", line 429, in start_async
    self.stt = STTFactory.create()
  File "/usr/local/lib/python3.9/dist-packages/mycroft/listener/stt.py", line 13, in create
    return OVOSSTTFactory.create(config)
  File "/home/ovos/.local/lib/python3.9/site-packages/ovos_plugin_manager/stt.py", line 158, in create
    return clazz(plugin_config)
  File "/home/ovos/.local/lib/python3.9/site-packages/neon_stt_plugin_google_cloud_streaming/__init__.py", line 82, in __init__
    self.client = speech.SpeechClient(credentials=credentials)
  File "/home/ovos/.local/lib/python3.9/site-packages/google/cloud/speech_v1/services/speech/client.py", line 459, in __init__
    self._transport = Transport(
  File "/home/ovos/.local/lib/python3.9/site-packages/google/cloud/speech_v1/services/speech/transports/grpc.py", line 153, in __init__
    super().__init__(
  File "/home/ovos/.local/lib/python3.9/site-packages/google/cloud/speech_v1/services/speech/transports/base.py", line 101, in __init__
    credentials, _ = google.auth.default(
  File "/home/ovos/.local/lib/python3.9/site-packages/google/auth/_default.py", line 692, in default
    raise exceptions.DefaultCredentialsError(_CLOUD_SDK_MISSING_CREDENTIALS)
google.auth.exceptions.DefaultCredentialsError: Your default credentials were not found. 

The name of the credential file is google.json and what's inside of the file {"API_Key": "MyApiKey"} or what?

Steps to Reproduce

No response

Relevant Code

No response

Other Notes

No response

NeonDaniel commented 3 months ago

Sorry for the very late response; missed this issue when it was created. The mycroft.conf should look like:

"stt": {
  "google_cloud_streaming": {
    "credential": { "json": "TOKEN_STRING" }
  }
}

OR, you can include the json credentials at ~/.local/share/neon/google.json or a different path that is specified in the GOOGLE_APPLICATION_CREDENTIALS envvar