diff --git a/safetytooling/apis/inference/gray_swan.py b/safetytooling/apis/inference/gray_swan.py index 2ddb99e..2d2e18a 100644 --- a/safetytooling/apis/inference/gray_swan.py +++ b/safetytooling/apis/inference/gray_swan.py @@ -23,7 +23,8 @@ def __init__( ): self.num_threads = num_threads self.prompt_history_dir = prompt_history_dir - if api_key is not None: + # Use truthy check so empty string (from blank .env line) is treated as unset + if api_key: try: self.aclient = AsyncGraySwan(api_key=api_key) except TypeError as e: diff --git a/safetytooling/apis/inference/together.py b/safetytooling/apis/inference/together.py index 7a06141..1b94cd9 100644 --- a/safetytooling/apis/inference/together.py +++ b/safetytooling/apis/inference/together.py @@ -44,7 +44,8 @@ def __init__( ): self.num_threads = num_threads self.prompt_history_dir = prompt_history_dir - if api_key is not None: + # Use truthy check so empty string (from blank .env line) is treated as unset + if api_key: self.aclient = AsyncTogether(api_key=api_key) else: self.aclient = None