# ChatGoogleGenerativeAI

## Prerequisite

1. Register a [Google](https://accounts.google.com/InteractiveLogin) account
2. Create an [API key](https://aistudio.google.com/app/apikey)

## Setup

1. **Chat Models** > drag **ChatGoogleGenerativeAI** node

<figure><img src="/files/vCG8nx3s4BE7UF05jfuu" alt="" width="563"><figcaption></figcaption></figure>

2. **Connect Credential** > click **Create New**

<figure><img src="/files/fgkkcmGCJUZXEPIJdVw4" alt="" width="278"><figcaption></figcaption></figure>

3. Fill in the **Google AI** credential

<figure><img src="/files/HPdUQViN4aFykJQiOeSl" alt="" width="563"><figcaption></figcaption></figure>

4. Voila [🎉](https://emojipedia.org/party-popper/), you can now use **ChatGoogleGenerativeAI node** in Flowise

<figure><img src="/files/1mk1ceqncBaLgxN1xtxw" alt=""><figcaption></figcaption></figure>

## Safety Attributes Configuration

1. Click **Additonal Parameters**

<figure><img src="/files/L2czeknfaSfwar7WsCW8" alt="" width="563"><figcaption></figcaption></figure>

* When configuring **Safety Attributes**, the amount of selection in **Harm Category** & **Harm Block Threshold** should be the same amount. If not it will throw an error `Harm Category & Harm Block Threshold are not the same length`
* The combination of **Safety Attributes** below will result in `Dangerous` is set to `Low and Above` and `Harassment` is set to `Medium and Above`

<figure><img src="/files/sYEseqY3iZxsYaUuSzAb" alt="" width="563"><figcaption></figcaption></figure>

## Resources

* [LangChain JS ChatGoogleGenerativeAI](https://js.langchain.com/docs/integrations/chat/google_generativeai)
* [Google AI for Developers](https://ai.google.dev/)
* [Gemini API Docs](https://ai.google.dev/docs)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flowiseai.com/integrations/langchain/chat-models/google-ai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
