From 263aab27dc004a38dd80d54b17cb835efa19fb5b Mon Sep 17 00:00:00 2001 From: Agnieszka Marzec <97166305+agnieszka-m@users.noreply.github.com> Date: Thu, 8 Aug 2024 12:45:01 +0200 Subject: [PATCH] Docs: Update GeminiGenerator docstrings (#964) * Update docstrings * Update integrations/google_ai/src/haystack_integrations/components/generators/google_ai/gemini.py Co-authored-by: Daria Fokina --------- Co-authored-by: Daria Fokina --- .../components/generators/google_ai/gemini.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/integrations/google_ai/src/haystack_integrations/components/generators/google_ai/gemini.py b/integrations/google_ai/src/haystack_integrations/components/generators/google_ai/gemini.py index f7b2f9097..07277e55a 100644 --- a/integrations/google_ai/src/haystack_integrations/components/generators/google_ai/gemini.py +++ b/integrations/google_ai/src/haystack_integrations/components/generators/google_ai/gemini.py @@ -17,9 +17,10 @@ @component class GoogleAIGeminiGenerator: """ - `GoogleAIGeminiGenerator` is a multimodal generator supporting Gemini via Google AI Studio. + Generates text using multimodal Gemini models through Google AI Studio. + + ### Usage example - Usage example: ```python from haystack.utils import Secret from haystack_integrations.components.generators.google_ai import GoogleAIGeminiGenerator @@ -30,7 +31,8 @@ class GoogleAIGeminiGenerator: print(answer) ``` - Multimodal usage example: + #### Multimodal example + ```python import requests from haystack.utils import Secret @@ -81,9 +83,9 @@ def __init__( :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 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.