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

  1. Model Name (Required)

    • Type: asyncOptions
    • Default: “gemini-pro”
    • Description: The name of the Google Gemini model to use
  2. Model Name (Required)

    • Type: asyncOptions
    • Default: “gemini-pro”
    • Description: The name of the Google Gemini model to use
  3. Cache (Optional)

    • Type: BaseCache
    • Description: Caching mechanism for responses
  4. Cache (Optional)

    • Type: BaseCache
    • Description: Caching mechanism for responses
  5. Custom Model Name (Optional)

    • Type: string
    • Description: Override the selected model with a custom model name
  6. Custom Model Name (Optional)

    • Type: string
    • Description: Override the selected model with a custom model name
  7. Temperature (Optional)

    • Type: number
    • Default: 0.9
    • Range: 0 to 1
    • Description: Controls the randomness of the output
  8. Temperature (Optional)

    • Type: number
    • Default: 0.9
    • Range: 0 to 1
    • Description: Controls the randomness of the output
  9. Max Output Tokens (Optional)

    • Type: number
    • Description: Maximum number of tokens in the generated response
  10. Max Output Tokens (Optional)

    • Type: number
    • Description: Maximum number of tokens in the generated response
  11. 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
  12. 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
  13. Top Next Highest Probability Tokens (Top K) (Optional)

    • Type: number
    • Description: Considers only the top K most probable tokens for each step
  14. Top Next Highest Probability Tokens (Top K) (Optional)

    • Type: number
    • Description: Considers only the top K most probable tokens for each step
  15. Harm Category (Optional)

    • Type: multiOptions
    • Options: Dangerous, Harassment, Hate Speech, Sexually Explicit
    • Description: Categories of harmful content to filter
  16. Harm Category (Optional)

    • Type: multiOptions
    • Options: Dangerous, Harassment, Hate Speech, Sexually Explicit
    • Description: Categories of harmful content to filter
  17. Harm Block Threshold (Optional)

    • Type: multiOptions
    • Options: Low and Above, Medium and Above, None, Only High, Threshold Unspecified
    • Description: Threshold for blocking harmful content
  18. Harm Block Threshold (Optional)

    • Type: multiOptions
    • Options: Low and Above, Medium and Above, None, Only High, Threshold Unspecified
    • Description: Threshold for blocking harmful content
  19. Allow Image Uploads (Optional)

    • Type: boolean
    • Default: false
    • Description: Enables image upload capability, automatically using vision model when an image is uploaded
  20. Allow Image Uploads (Optional)

    • Type: boolean
    • Default: false
    • Description: Enables image upload capability, automatically using vision model when an image is uploaded

Functionality

  1. Initializes the ChatGoogleGenerativeAI model with the provided configuration
  2. Applies safety settings based on selected harm categories and thresholds
  3. Supports multi-modal interactions if image uploads are allowed
  4. 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.