We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e2ddfb4 + ffd8828 commit a5276bbCopy full SHA for a5276bb
deepgram/client.py
@@ -158,12 +158,13 @@ def __init__(
158
self.logger = logging.getLogger(__name__)
159
self.logger.addHandler(logging.StreamHandler())
160
161
- if config is not None:
+ if api_key == "" and config is not None:
162
+ self.logger.info("Attempting to set API key from config object")
163
api_key = config.api_key
- if not api_key:
164
- # Default to `None` for on-prem instances where an API key is not required
165
- api_key = os.getenv("DEEPGRAM_API_KEY", None)
166
+ if api_key == "":
+ self.logger.info("Attempting to set API key from environment variable")
+ api_key = os.getenv("DEEPGRAM_API_KEY", "")
167
168
self.logger.warning("WARNING: API key is missing")
169
170
self.api_key = api_key
0 commit comments