Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions google/generativeai/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@ def configure(
"Invalid configuration: Please set either `api_key` or `client_options['api_key']`, but not both."
)
else:
if api_key is None:
if not api_key:
# If no key is provided explicitly, attempt to load one from the
# environment.
api_key = os.getenv("GEMINI_API_KEY")

if api_key is None:
if not api_key:
# If the GEMINI_API_KEY doesn't exist, attempt to load the
# GOOGLE_API_KEY from the environment.
api_key = os.getenv("GOOGLE_API_KEY")
Expand Down
Loading