From 09be978b1c370099b9b6b82b2392ee2afbf47a59 Mon Sep 17 00:00:00 2001 From: Amna Mubashar Date: Wed, 16 Oct 2024 15:59:36 +0200 Subject: [PATCH] Make project-id param optional --- .../components/generators/google_vertex/chat/gemini.py | 4 ++-- .../components/generators/google_vertex/gemini.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/integrations/google_vertex/src/haystack_integrations/components/generators/google_vertex/chat/gemini.py b/integrations/google_vertex/src/haystack_integrations/components/generators/google_vertex/chat/gemini.py index f09692daf..eaa1f5af1 100644 --- a/integrations/google_vertex/src/haystack_integrations/components/generators/google_vertex/chat/gemini.py +++ b/integrations/google_vertex/src/haystack_integrations/components/generators/google_vertex/chat/gemini.py @@ -50,7 +50,7 @@ def __init__( self, *, model: str = "gemini-1.5-flash", - project_id: str, + project_id: Optional[str] = None, location: Optional[str] = None, generation_config: Optional[Union[GenerationConfig, Dict[str, Any]]] = None, safety_settings: Optional[Dict[HarmCategory, HarmBlockThreshold]] = None, @@ -65,7 +65,7 @@ def __init__( Authenticates using Google Cloud Application Default Credentials (ADCs). For more information see the official [Google documentation](https://cloud.google.com/docs/authentication/provide-credentials-adc). - :param project_id: ID of the GCP project to use. + :param project_id: ID of the GCP project to use. By default, it is set during Google Cloud authentication. :param model: Name of the model to use. For available models, see https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models. :param location: The default location to use when making API calls, if not set uses us-central-1. Defaults to None. diff --git a/integrations/google_vertex/src/haystack_integrations/components/generators/google_vertex/gemini.py b/integrations/google_vertex/src/haystack_integrations/components/generators/google_vertex/gemini.py index 2b1c1b477..3e4dcca7e 100644 --- a/integrations/google_vertex/src/haystack_integrations/components/generators/google_vertex/gemini.py +++ b/integrations/google_vertex/src/haystack_integrations/components/generators/google_vertex/gemini.py @@ -54,7 +54,7 @@ def __init__( self, *, model: str = "gemini-1.5-flash", - project_id: str, + project_id: Optional[str] = None, location: Optional[str] = None, generation_config: Optional[Union[GenerationConfig, Dict[str, Any]]] = None, safety_settings: Optional[Dict[HarmCategory, HarmBlockThreshold]] = None, @@ -69,7 +69,7 @@ def __init__( Authenticates using Google Cloud Application Default Credentials (ADCs). For more information see the official [Google documentation](https://cloud.google.com/docs/authentication/provide-credentials-adc). - :param project_id: ID of the GCP project to use. + :param project_id: ID of the GCP project to use. By default, it is set during Google Cloud authentication. :param model: Name of the model to use. For available models, see https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models. :param location: The default location to use when making API calls, if not set uses us-central-1. :param generation_config: The generation config to use.