Skip to content

Commit b14e53c

Browse files
Annhiluccopybara-github
authored andcommitted
chore: Improve error message for missing API key.
PiperOrigin-RevId: 875248443
1 parent af94e53 commit b14e53c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

google/genai/_api_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,9 +704,9 @@ def __init__(
704704
else: # Implicit initialization or missing arguments.
705705
if not self.api_key:
706706
raise ValueError(
707-
'Missing key inputs argument! To use the Google AI API,'
708-
' provide (`api_key`) arguments. To use the Google Cloud API,'
709-
' provide (`vertexai`, `project` & `location`) arguments.'
707+
'No API key was provided. Please pass a valid API key. Learn how to'
708+
' create an API key at'
709+
' https://ai.google.dev/gemini-api/docs/api-key.'
710710
)
711711
self._http_options.base_url = 'https://generativelanguage.googleapis.com/'
712712
self._http_options.api_version = 'v1beta'

0 commit comments

Comments
 (0)