ChatGoogleGenerativeAI
The ChatGoogleGenerativeAI node is a wrapper around Google’s Gemini large language models that use the Chat endpoint. It provides an interface to interact with Google’s generative AI models within a chat context.
Node Details
- Name: chatGoogleGenerativeAI
- Type: ChatGoogleGenerativeAI
- Version: 2.1
- Category: Chat Models
Parameters
Parameters
Credential (Required)
Credential (Required)
- Type: googleGenerativeAI
- Description: Google Generative AI API key
Inputs
Inputs
-
Model Name (Required)
- Type: asyncOptions
- Default: “gemini-pro”
- Description: The name of the Google Gemini model to use
-
Model Name (Required)
- Type: asyncOptions
- Default: “gemini-pro”
- Description: The name of the Google Gemini model to use
-
Cache (Optional)
- Type: BaseCache
- Description: Caching mechanism for responses
-
Cache (Optional)
- Type: BaseCache
- Description: Caching mechanism for responses
-
Custom Model Name (Optional)
- Type: string
- Description: Override the selected model with a custom model name
-
Custom Model Name (Optional)
- Type: string
- Description: Override the selected model with a custom model name
-
Temperature (Optional)
- Type: number
- Default: 0.9
- Range: 0 to 1
- Description: Controls the randomness of the output
-
Temperature (Optional)
- Type: number
- Default: 0.9
- Range: 0 to 1
- Description: Controls the randomness of the output
-
Max Output Tokens (Optional)
- Type: number
- Description: Maximum number of tokens in the generated response
-
Max Output Tokens (Optional)
- Type: number
- Description: Maximum number of tokens in the generated response
-
Top Probability (Top P) (Optional)
- Type: number
- Range: 0 to 1
- Description: Nucleus sampling, considers the smallest set of tokens whose cumulative probability exceeds the value
-
Top Probability (Top P) (Optional)
- Type: number
- Range: 0 to 1
- Description: Nucleus sampling, considers the smallest set of tokens whose cumulative probability exceeds the value
-
Top Next Highest Probability Tokens (Top K) (Optional)
- Type: number
- Description: Considers only the top K most probable tokens for each step
-
Top Next Highest Probability Tokens (Top K) (Optional)
- Type: number
- Description: Considers only the top K most probable tokens for each step
-
Harm Category (Optional)
- Type: multiOptions
- Options: Dangerous, Harassment, Hate Speech, Sexually Explicit
- Description: Categories of harmful content to filter
-
Harm Category (Optional)
- Type: multiOptions
- Options: Dangerous, Harassment, Hate Speech, Sexually Explicit
- Description: Categories of harmful content to filter
-
Harm Block Threshold (Optional)
- Type: multiOptions
- Options: Low and Above, Medium and Above, None, Only High, Threshold Unspecified
- Description: Threshold for blocking harmful content
-
Harm Block Threshold (Optional)
- Type: multiOptions
- Options: Low and Above, Medium and Above, None, Only High, Threshold Unspecified
- Description: Threshold for blocking harmful content
-
Allow Image Uploads (Optional)
- Type: boolean
- Default: false
- Description: Enables image upload capability, automatically using vision model when an image is uploaded
-
Allow Image Uploads (Optional)
- Type: boolean
- Default: false
- Description: Enables image upload capability, automatically using vision model when an image is uploaded
Functionality
- Initializes the ChatGoogleGenerativeAI model with the provided configuration
- Applies safety settings based on selected harm categories and thresholds
- Supports multi-modal interactions if image uploads are allowed
- Integrates with various LangChain components like LLMChain, Conversation Chain, ReAct Agent, etc.
Usage
This node is particularly useful for applications that require advanced language understanding and generation capabilities, such as:
- Chatbots and conversational AI
- Content generation
- Text analysis and summarization
- Question-answering systems
The node’s flexibility in configuration allows for fine-tuning the model’s behavior to suit specific use cases and safety requirements.
Notes
- Ensure you have the necessary Google Generative AI API credentials before using this node.
- Be mindful of the model’s capabilities and limitations when designing your application.
- Properly configure safety settings to align with your application’s content policies.