PromptAnthropicAI 2025.10.9.21

Bundle

com.snowflake.openflow.runtime | runtime-anthropic-nar

Description

Sends a prompt to Anthropic, writing the response either as a FlowFile attribute or to the contents of the incoming FlowFile. The prompt may consist of pure text interaction or may include an image. Use dynamic properties to enable beta features in the Anthropic endpoint.

Tags

ai, anthropic, chat, image, openflow, prompt, text

Input Requirement

REQUIRED

Supports Sensitive Dynamic Properties

false

Properties

PropertyDescription
Anthropic API KeyThe API Key for authenticating to Anthropic
Assistant MessageThe assistant message to send to Anthropic. FlowFile attributes may be referenced via Expression Language, and the contents of the FlowFile may be referenced via the flowfile_content variable. E.g., ${flowfile_content}. The assistant message is added last
Image MIME TypeThe MIME type of the image in the FlowFile content. Supported types are image/jpeg, image/png, image/gif, and image/webp.
Max File SizeThe maximum size of a FlowFile that can be sent to Anthropic as an image. If the FlowFile is larger than this, it will be routed to ‘failure’.
Max TokensThe maximum number of tokens to generate
Model NameThe name of the Anthropic model
Output StrategyDetermines response output destination
Prompt TypeThe type of prompt to send to Anthropic. TEXT to send a simple prompt. IMAGE to send an image first and then a prompt. Use JSON for advanced use of Anthropic’s /v1/messages endpoint.
Response FormatThe format of the response from Anthropic
Results AttributeThe name of the attribute to write the response to.
Stop SequencesA comma delimited list of strings act as stop sequences. The model will halt after encountering one of the stop sequences.
System MessageThe system message to send to Anthropic. FlowFile attributes may be referenced via Expression Language, and the contents of the FlowFile may be referenced via the flowfile_content variable. E.g., ${flowfile_content}
TemperatureThe temperature to use for generating the response. Defaults to 1.0. Ranges from 0.0 to 1.0. Use temperature closer to 0.0 for analytical / multiple choice, and closer to 1.0 for creative and generative tasks.
Top KThe top K value to use for generating the response. Only sample from the top K options for each subsequent token. Recommended for advanced use cases only. You usually only need to use temperature.
Top PThe top P value to use for generating the response. Top P is for nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by top_p. Recommended for advanced use cases only. You usually only need to use temperature.
User IDThe user id to set in the request metadata
User MessageThe user message to send to Anthropic. FlowFile attributes may be referenced via Expression Language, and the contents of the FlowFile may be referenced via the flowfile_content variable. E.g., ${flowfile_content}. The user message is added first, unless an image is present.
Web Client ServiceThe Web Client Service to use for communicating with Anthropic

Relationships

NameDescription
failureIf unable to obtain a valid response from Anthropic, the original FlowFile will be routed to this relationship
retryIf a 5XX response from Anthropic is returned, the original FlowFile will be routed to this relationship
successThe response from Anthropic is routed to this relationship

Writes attributes

NameDescription
anthropic.usage.inputTokensThe number of input tokens read in the request.
anthropic.usage.outputTokensThe number of output tokens generated in the response.
anthropic.chat.completion.idA unique id assigned to the conversation
anthropic.chat.completion.stop.reasonThe reason that we stopped.
anthropic.chat.completion.stop.sequenceWhich custom stop sequence was generated, if any, may be ‘null’.
mime.typeThe mime type of the response.
filenameAn updated filename for the response.