I’m trying to use a Gemini API key like this :
llm_gemini = LLM(
model=“gemini-1.5-pro”,
temperature=0.7,
api_key=gemini_api_key
)
but I always get this error while executing the crew :
ERROR:root:LiteLLM call failed: litellm.APIConnectionError: Your default credentials were not found. To set up Application Default Credentials, see Set up Application Default Credentials | Authentication | Google Cloud for more information.
Traceback (most recent call last):
File “C:\Users\tomit\crewai_env\Lib\site-packages\litellm\main.py”, line 2372, in completion
model_response = vertex_chat_completion.completion( # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\tomit\crewai_env\Lib\site-packages\litellm\llms\vertex_ai\gemini\vertex_and_google_ai_studio_gemini.py”, line 1204, in completion
_auth_header, vertex_project = self._ensure_access_token(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\tomit\crewai_env\Lib\site-packages\litellm\llms\vertex_ai\vertex_llm_base.py”, line 130, in _ensure_access_token
self._credentials, cred_project_id = self.load_auth(
^^^^^^^^^^^^^^^
File “C:\Users\tomit\crewai_env\Lib\site-packages\litellm\llms\vertex_ai\vertex_llm_base.py”, line 84, in load_auth
creds, creds_project_id = google_auth.default(
^^^^^^^^^^^^^^^^^^^^
File “C:\Users\tomit\crewai_env\Lib\site-packages\google\auth_default.py”, line 719, in default
raise exceptions.DefaultCredentialsError(_CLOUD_SDK_MISSING_CREDENTIALS)
google.auth.exceptions.DefaultCredentialsError: Your default credentials were not found. To set up Application Default Credentials, see Set up Application Default Credentials | Authentication | Google Cloud for more information.
I tried to bypass the use of of LiteLLM with langchain but I didn’t succeed.
Any help or suggestion would be appreciated.