From 74d09390c11e987018c5d689a651c57740c7c78b Mon Sep 17 00:00:00 2001 From: agnieszka-m Date: Thu, 8 Aug 2024 08:11:13 +0200 Subject: [PATCH 1/2] Update docstrings --- .../generators/google_ai/chat/gemini.py | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) 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 8b592a184..0c0e2e047 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 @@ -18,10 +18,16 @@ @component class GoogleAIGeminiChatGenerator: """ - `GoogleAIGeminiChatGenerator` is a multimodal generator supporting Gemini via Google AI Studio. - It uses the `ChatMessage` dataclass to interact with the model. + Completes chats using multimodal Gemini models through Google AI Studio. + + It uses the [`ChatMessage`](https://docs.haystack.deepset.ai/docs/data-classes#chatmessage) + dataclass to interact with the model. You can use the following models: + - gemini-pro + - gemini-ultra + - gemini-pro-vision + + ### Usage example - Usage example: ```python from haystack.utils import Secret from haystack.dataclasses.chat_message import ChatMessage @@ -42,7 +48,8 @@ class GoogleAIGeminiChatGenerator: ``` - Usage example with function calling: + #### With function calling: + ```python from haystack.utils import Secret from haystack.dataclasses.chat_message import ChatMessage @@ -111,11 +118,15 @@ def __init__( * `gemini-pro-vision` * `gemini-ultra` - :param api_key: Google AI Studio API key. - :param model: Name of the model to use. - :param generation_config: The generation config to use. - Can either be a `GenerationConfig` object or a dictionary of parameters. - For the available parameters, see + :param api_key: Google AI Studio API key. To get a key, + see [Google AI Studio](https://makersuite.google.com) + :param model: Name of the model to use. Supported models are: + - gemini-pro + - gemini-ultra + - gemini-pro-vision + :param generation_config: The generation configuration to use. + This can either be a `GenerationConfig` object or a dictionary of parameters. + For available parameters, see [the `GenerationConfig` API reference](https://ai.google.dev/api/python/google/generativeai/GenerationConfig). :param safety_settings: The safety settings to use. A dictionary with `HarmCategory` as keys and `HarmBlockThreshold` as values. From 6f7de3e6c364acad941867d5c70903b4f22c06bf Mon Sep 17 00:00:00 2001 From: Agnieszka Marzec <97166305+agnieszka-m@users.noreply.github.com> Date: Thu, 8 Aug 2024 12:33:12 +0200 Subject: [PATCH 2/2] Update integrations/google_ai/src/haystack_integrations/components/generators/google_ai/chat/gemini.py Co-authored-by: Daria Fokina --- .../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 0c0e2e047..dd065af4b 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 @@ -119,7 +119,7 @@ def __init__( * `gemini-ultra` :param api_key: Google AI Studio API key. To get a key, - see [Google AI Studio](https://makersuite.google.com) + see [Google AI Studio](https://makersuite.google.com). :param model: Name of the model to use. Supported models are: - gemini-pro - gemini-ultra