Skip to content

Commit

Permalink
Merge branch 'main' into vector-search-hybrid
Browse files Browse the repository at this point in the history
  • Loading branch information
lspataroG authored Dec 3, 2024
2 parents 1211f60 + 019d578 commit 404ca52
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions libs/genai/langchain_google_genai/chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,9 @@ class ChatGoogleGenerativeAI(_BaseGoogleGenerativeAI, BaseChatModel):
Instantiation:
To use, you must have either:
1. The ``GOOGLE_API_KEY``` environment variable set with your API key, or
2. Pass your API key using the google_api_key kwarg to the ChatGoogle
constructor.
1. The ``GOOGLE_API_KEY`` environment variable set with your API key, or
2. Pass your API key using the google_api_key kwarg
to the ChatGoogleGenerativeAI constructor.
.. code-block:: python
Expand Down
6 changes: 3 additions & 3 deletions libs/genai/langchain_google_genai/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class GoogleGenerativeAIEmbeddings(BaseModel, Embeddings):
To use, you must have either:
1. The ``GOOGLE_API_KEY``` environment variable set with your API key, or
2. Pass your API key using the google_api_key kwarg to the ChatGoogle
constructor.
1. The ``GOOGLE_API_KEY`` environment variable set with your API key, or
2. Pass your API key using the google_api_key kwarg
to the GoogleGenerativeAIEmbeddings constructor.
Example:
.. code-block:: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@

def _get_token(credentials: Optional[Credentials] = None) -> str:
"""Returns a valid token for GCP auth."""
credentials = auth.default()[0] if not credentials else credentials
credentials = (
auth.default(scopes=["https://www.googleapis.com/auth/cloud-platform"])[0]
if not credentials
else credentials
)
request = auth_requests.Request()
credentials.refresh(request)
if not credentials.token:
Expand Down

0 comments on commit 404ca52

Please sign in to comment.