From db24bebf98b4ea584a24945f338c6afccb9be22a Mon Sep 17 00:00:00 2001 From: anakin87 Date: Fri, 28 Jun 2024 16:13:57 +0200 Subject: [PATCH 1/3] pin google-generativeai<0.7.1 --- integrations/google_ai/pyproject.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/integrations/google_ai/pyproject.toml b/integrations/google_ai/pyproject.toml index 3a2382477..1c9b1b4aa 100644 --- a/integrations/google_ai/pyproject.toml +++ b/integrations/google_ai/pyproject.toml @@ -22,7 +22,10 @@ classifiers = [ "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] -dependencies = ["haystack-ai", "google-generativeai>=0.3.1"] +dependencies = [ + "haystack-ai", + "google-generativeai>=0.3.1, <0.7.1" # https://github.com/deepset-ai/haystack-core-integrations/issues/855 +] [project.urls] Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/google_ai_haystack#readme" From c4700aad543c38051be51d9bf205d4d4671edd68 Mon Sep 17 00:00:00 2001 From: anakin87 Date: Fri, 28 Jun 2024 16:26:39 +0200 Subject: [PATCH 2/3] try different model --- .../components/generators/google_ai/chat/gemini.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrations/google_ai/src/haystack_integrations/components/generators/google_ai/chat/gemini.py b/integrations/google_ai/src/haystack_integrations/components/generators/google_ai/chat/gemini.py index d3a8299fd..5a6e0081f 100644 --- a/integrations/google_ai/src/haystack_integrations/components/generators/google_ai/chat/gemini.py +++ b/integrations/google_ai/src/haystack_integrations/components/generators/google_ai/chat/gemini.py @@ -95,7 +95,7 @@ def __init__( self, *, api_key: Secret = Secret.from_env_var("GOOGLE_API_KEY"), # noqa: B008 - model: str = "gemini-pro-vision", + model: str = "gemini-1.5-flash", generation_config: Optional[Union[GenerationConfig, Dict[str, Any]]] = None, safety_settings: Optional[Dict[HarmCategory, HarmBlockThreshold]] = None, tools: Optional[List[Tool]] = None, From 8029fc1a635f2c2d72a4319ffe51b19ece76785b Mon Sep 17 00:00:00 2001 From: anakin87 Date: Fri, 28 Jun 2024 16:36:03 +0200 Subject: [PATCH 3/3] retry --- integrations/google_ai/pyproject.toml | 2 +- .../components/generators/google_ai/chat/gemini.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/integrations/google_ai/pyproject.toml b/integrations/google_ai/pyproject.toml index 1c9b1b4aa..33829abd0 100644 --- a/integrations/google_ai/pyproject.toml +++ b/integrations/google_ai/pyproject.toml @@ -24,7 +24,7 @@ classifiers = [ ] dependencies = [ "haystack-ai", - "google-generativeai>=0.3.1, <0.7.1" # https://github.com/deepset-ai/haystack-core-integrations/issues/855 + "google-generativeai>=0.3.1, <0.7.0" # https://github.com/deepset-ai/haystack-core-integrations/issues/855 ] [project.urls] diff --git a/integrations/google_ai/src/haystack_integrations/components/generators/google_ai/chat/gemini.py b/integrations/google_ai/src/haystack_integrations/components/generators/google_ai/chat/gemini.py index 5a6e0081f..d3a8299fd 100644 --- a/integrations/google_ai/src/haystack_integrations/components/generators/google_ai/chat/gemini.py +++ b/integrations/google_ai/src/haystack_integrations/components/generators/google_ai/chat/gemini.py @@ -95,7 +95,7 @@ def __init__( self, *, api_key: Secret = Secret.from_env_var("GOOGLE_API_KEY"), # noqa: B008 - model: str = "gemini-1.5-flash", + model: str = "gemini-pro-vision", generation_config: Optional[Union[GenerationConfig, Dict[str, Any]]] = None, safety_settings: Optional[Dict[HarmCategory, HarmBlockThreshold]] = None, tools: Optional[List[Tool]] = None,