Anthropic

The Anthropic component is an AI component that allows users to connect the AI models served on the Anthropic Platform. It can carry out the following tasks:

#Release Stage

Alpha

#Configuration

The component definition and tasks are defined in the definition.json and tasks.json files respectively.

#Setup

In order to communicate with Anthropic, the following connection details need to be provided. You may specify them directly in a pipeline recipe as key-value pairs within the component's setup block, or you can create a Connection from the Integration Settings page and reference the whole setup as setup: ${connection.<my-connection-id>}.

FieldField IDTypeNote
API Keyapi-keystringFill in your Anthropic API key. To find your keys, visit the Anthropic console page.

#Supported Tasks

#Text Generation Chat

Anthropic's text generation models (often called generative pre-trained transformers or large language models) have been trained to understand natural language, code, and images. The models provide text outputs in response to their inputs. The inputs to these models are also referred to as "prompts". Designing a prompt is essentially how you “program” a large language model model, usually by providing instructions or some examples of how to successfully complete a task.

InputIDTypeDescription
Task ID (required)taskstringTASK_TEXT_GENERATION_CHAT
Model Name (required)model-namestringThe Anthropic model to be used
Prompt (required)promptstringThe prompt text
System Messagesystem-messagestringThe system message helps set the behavior of the assistant. For example, you can modify the personality of the assistant or provide specific instructions about how it should behave throughout the conversation. By default, the model’s behavior is set using a generic message as "You are a helpful assistant."
Prompt Imagesprompt-imagesarray[string]The prompt images (Note: The prompt images will be injected in the order they are provided to the 'prompt' message. Anthropic doesn't support sending images via image-url, use this field instead)
Chat historychat-historyarray[object]Incorporate external chat history, specifically previous messages within the conversation. Please note that System Message will be ignored and will not have any effect when this field is populated. Each message should adhere to the format: : {"role": "The message role, i.e. 'system', 'user' or 'assistant'", "content": "message content"}.
SeedseedintegerThe seed (Note: Not supported by Anthropic Models)
TemperaturetemperaturenumberThe temperature for sampling
Top Ktop-kintegerTop k for sampling
Max New Tokensmax-new-tokensintegerThe maximum number of tokens for model to generate
Input Objects in Text Generation Chat

Chat History

Incorporate external chat history, specifically previous messages within the conversation. Please note that System Message will be ignored and will not have any effect when this field is populated. Each message should adhere to the format: : {"role": "The message role, i.e. 'system', 'user' or 'assistant'", "content": "message content"}.

FieldField IDTypeNote
ContentcontentarrayThe message content
RolerolestringThe message role, i.e. 'system', 'user' or 'assistant'

Content

The message content

FieldField IDTypeNote
Image URLimage-urlobjectThe image URL
TexttextstringThe text content.
TypetypestringThe type of the content part.
Enum values
  • text
  • image_url

Image URL

The image URL

FieldField IDTypeNote
URLurlstringEither a URL of the image or the base64 encoded image data.
OutputIDTypeDescription
TexttextstringModel Output
Usage (optional)usageobjectUsage tokens in Anthropic
Output Objects in Text Generation Chat

Usage

FieldField IDTypeNote
Input Tokensinput-tokensnumberThe input tokens used by Anthropic
Output Tokensoutput-tokensnumberThe output tokens used by Anthropic

#Example Recipes

Recipe for the List GitHub Repo Issues pipeline.


version: v1beta
component:
anthropic-0:
type: anthropic
task: TASK_TEXT_GENERATION_CHAT
input:
max-new-tokens: 1000
model-name: claude-3-5-sonnet-20240620
prompt: Summarise and pick the most important issues from this list ${github.output.issues}
system-message: You are a helpful assistant.
temperature: 0.7
top-k: 10
setup:
api-key: ${secret.INSTILL_SECRET}
github:
type: github
task: TASK_LIST_ISSUES
input:
direction: desc
no-pull-request: false
owner: ${variable.repository-owner}
page: 1
per-page: 30
repository: ${variable.repository-name}
since: "2021-01-01T00:00:00Z"
sort: created
state: open
setup:
token: ${secret.github-demo}
variable:
repository-name:
title: Repository Name
description: Name of the repository i.e. instill-core
instill-format: string
repository-owner:
title: Repository Owner
description: Name of the repository owner i.e. instill-ai
instill-format: string
output:
result:
title: Result
value: ${anthropic-0.output.text}