Skip to content

Commit

Permalink
✨ allow setting only the MINDEE_API_KEY env var
Browse files Browse the repository at this point in the history
  • Loading branch information
ianardee committed Oct 10, 2022
1 parent 9f31d51 commit 4309224
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion mindee/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ def to_envvar(name: str) -> str:
def set_api_key_from_env(self) -> None:
"""Set the endpoint's API key from an environment variable, if present."""
env_key = os.getenv(self.envvar_key_name, "")
if not env_key:
env_key = os.getenv("MINDEE_API_KEY", "")
if env_key:
self.api_key = env_key
logger.debug("Set from environment: %s", self.envvar_key_name)
logger.debug("Set API key from environment")

def predict_request(
self,
Expand Down

0 comments on commit 4309224

Please sign in to comment.