Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Update GoogleChatGenerator docstrings #962

Merged
merged 2 commits into from
Aug 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down