# Anthropic

<figure><img src="/files/nhALoy56JaFooGTGbRXC" alt=""><figcaption></figcaption></figure>

## Description

The Anthropic model, developed by Anthropic, is a language model that combines the power of GPT (Generative Pre-trained Transformer) with LLM (Language Model for Legal Text). It is specifically designed to understand and generate legal text, making it useful for tasks such as legal document analysis, contract generation, and legal research. The model has been trained on a large corpus of legal documents to ensure accuracy and relevance in its responses.

The Anthropic component allows you to integrate Anthropic into your flows. You can customize the parameters used by the Anthropic component, and also specify the context of knowledge that the Anthropic component operates on, as well as provide the input query. Both the context and the query are given to the Anthropic component by specifying Diaflow component identifiers. For example, the above screenshot shows the default user message of **trigger.text** which is a Text Input component.&#x20;

The Anthropic component has the identifier of an-**X**, where **X** represents the instance number of the Anthropic component.

<figure><img src="/files/DNHv2IGayONFlCt9oAPT" alt=""><figcaption></figcaption></figure>

## Inputs

The Anthropic component has the following input connections.

| Input Name                               | Description                                                                       | Constraints                                                                                                      |
| ---------------------------------------- | --------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| From data Loaders/ Data source/Vector DB | This input connection represents the context information for the Anthropic model. | Must originate from a Data Loader/Data Source or VectorDB component.                                             |
| From Input                               | This input connection represents the user query for the Anthropic model.          | Must originate from a component that generates a text string as output such as a Python or Text Input component. |

## Component settings

| Parameter Name | Description                                                                                                                                                                                                                                                    |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Model          | <p>This parameter specifies the version of Anthropic that the component should use. </p><p></p><p>Available values:</p><p></p><p>Series 4.5:</p><ul><li><em>Claude-4.5-sonet</em></li><li><em>Claude-4.5-opus</em></li><li><em>Claude-4.5-haiku</em></li></ul> |
| Prompt         | Describes how you want the Anthropic model to respond. For example, you can specify the role, manner and rules that Anthropic should adhere to. Also mention the component ID to connect the components.                                                       |
| Image source   | Adding an image to your prompt by identify a trigger file in this configuration.                                                                                                                                                                               |

## Advanced configurations

| Options        | Description                                                                                                                                                                                                                                                                                                                                                                                                      |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enable caching | This option determines whether the results of the component are cached. This means that on the next run of the Flow, Diaflow will utilize the previous computed component output, as long as the inputs have not changed.                                                                                                                                                                                        |
| Caching time   | <p>Only applicable if the "Enable Caching" option has been enabled.<br>This parameter controls how long Diaflow will wait before automatically clearing the cache.</p>                                                                                                                                                                                                                                           |
| Memory         | The ability of the model to remember and utilize context within a single session. The context window represent the maximum amount of text the model can consider.                                                                                                                                                                                                                                                |
| Temperature    | <p>The temperature is used to control the randomness of the output. When you set it higher, you'll get more random outputs. When you set it lower, towards 0, the values are more deterministic.<br><em>Valid range for this parameter is 0 to 1.</em></p>                                                                                                                                                       |
| Max lenght     | <p>The Max Length parameter in OpenAI refers to the maximum number of tokens allowed in the input text. Tokens can be individual words or characters. By setting the max length, you can control the length of the response generated by the model. It's important to note that longer texts may result in higher costs and longer response times. <br><em>Valid range for this parameter is 0 to 3097.</em></p> |
| Top P          | Top-p sampling, involves selecting the next word from the smallest possible set of words whose cumulative probability is greater than or equal to the specified probability p, typically between 0 and 1.                                                                                                                                                                                                        |

## Outputs

The Anthropic component has the following output connections.

| Output Name | Description                                                                 | Constraints                                                    |
| ----------- | --------------------------------------------------------------------------- | -------------------------------------------------------------- |
| To Output   | This output connection contains the text result of the Anthropic component. | Can be connected to any component that accepts a string input. |

## Use case

Here is a simple use case of the Anthropic component, where the Anthropic component is being used to provide the user the ability to ask the Anthropic component questions via a Text Input component.

<figure><img src="/files/fXzIhwDbxCB0lqkuNGJ3" alt=""><figcaption></figcaption></figure>


---

# 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.diaflow.io/workflow-builder/nodes/private-ai-llm-models/anthropic.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.
