Node Details

  • Name: chatAnthropic
  • Label: ChatAnthropic
  • Version: 6.0
  • Type: ChatAnthropic
  • Category: Chat Models

Base Classes

  • ChatAnthropic
  • (Additional base classes from LangchainChatAnthropic)

Parameters

Credential (Required)

Parameters

Credential (Required)

  • Type: anthropicApi

Inputs

Inputs

  1. Cache

    • Type: BaseCache
    • Optional: Yes
    • Description: Caching mechanism for the model
  2. Model Name

    • Type: Async Options (dynamically loaded)
    • Default: “claude-3-haiku”
    • Description: The specific Anthropic model to use
  3. Temperature

    • Type: Number
    • Default: 0.9
    • Step: 0.1
    • Optional: Yes
    • Description: Controls the randomness of the model’s output
  4. Max Tokens

    • Type: Number
    • Step: 1
    • Optional: Yes
    • Additional Params: Yes
    • Description: The maximum number of tokens to generate in the response
  5. Top P

    • Type: Number
    • Step: 0.1
    • Optional: Yes
    • Additional Params: Yes
    • Description: Controls the diversity of the model’s output
  6. Top K

    • Type: Number
    • Step: 0.1
    • Optional: Yes
    • Additional Params: Yes
    • Description: Limits the number of top tokens considered for generation
  7. Allow Image Uploads

    • Type: Boolean
    • Default: false
    • Optional: Yes
    • Description: Enables image upload functionality, automatically using claude-3-* models when an image is uploaded from chat

Functionality

  1. Model Loading:

    • The node dynamically loads available Anthropic models using the getModels function.
  2. Initialization:

    • Retrieves and validates the Anthropic API key from credentials.
    • Sets up the Anthropic model with specified parameters (temperature, model name, max tokens, top p, top k, streaming).
    • Creates and returns an instance of the ChatAnthropic model.
  3. Multi-Modal Support:

    • Configures the model to handle image uploads when the “Allow Image Uploads” option is enabled.

Usage

This node is designed to be used within a larger system, likely a flow-based programming environment for AI tasks. It can be used for various natural language processing tasks such as:

  • Text generation
  • Question answering
  • Conversation simulation
  • Multi-modal interactions (when image upload is enabled)
  • And other language-related tasks supported by Anthropic’s models

The node allows for fine-tuning of the model’s behavior through parameters like temperature, top p, and top k, enabling users to adjust the output according to their specific needs.

Integration

This node is meant to integrate with other components in the system, allowing for the creation of complex NLP pipelines and applications. It’s particularly noted to work well with:

  • LLMChain
  • Conversation Chain
  • ReAct Agent
  • Conversational Agent
  • Tool Agent

When the “Allow Image Uploads” option is enabled, it automatically switches to claude-3-* models to handle multi-modal inputs, enhancing its versatility in handling both text and image-based tasks.