PromptVertexAI
Description
Sends a prompt to VertexAI, 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 multimedia.
Tags
ai, chat, cloud, gcp, google, image, pdf, prompt, text, video
Properties
In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.
Display Name | API Name | Default Value | Allowable Values | Description |
---|---|---|---|---|
GCP Credentials Service * | GCP Credentials Service | Controller Service: GCPCredentialsService Implementations: GCPCredentialsControllerService | The Controller Service used to obtain Google Cloud Platform credentials. | |
GCP Location * | GCP Location | The location to configure the Vertex client with Supports Expression Language, using Environment variables. | ||
GCP Project ID * | GCP Project ID | The project ID to configure the Vertex client with Supports Expression Language, using Environment variables. | ||
Prompt Type * | Prompt Type | Text |
| The type of prompt to send to Vertex. Text to send a simple prompt. Media to send a multimedia type first followed by a text prompt. |
Media MIME Type | Media MIME Type | ${mime.type} | The MIME type of the media in the FlowFile content. Supported media types are listed here: https://firebase.google.com/docs/vertex-ai/input-file-requirements Supports Expression Language, using FlowFile attributes and Environment variables. This property is only considered if:
| |
Model Name * | Model Name | gemini-1.5-flash | The name of the Vertex model Supports Expression Language, using FlowFile attributes and Environment variables. | |
System Message | System Message | The system message to send to Vertex. 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} Supports Expression Language, using FlowFile attributes and Environment variables. This property is only considered if:
| ||
User Message * | User Message | The user message to send to Vertex. 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. Supports Expression Language, using FlowFile attributes and Environment variables. This property is only considered if:
| ||
Response Format * | Response Format | Plain Text |
| The format of the response from Vertex |
Stop Sequences | Stop Sequences | A comma delimited list of strings act as stop sequences. The model will halt after encountering one of the stop sequences. Supports Expression Language, using FlowFile attributes and Environment variables. | ||
Max File Size | Max File Size | 10 MB | The maximum size of a FlowFile that can be sent to Vertex as an image. If the FlowFile is larger than this, it will be routed to 'failure'. This property is only considered if:
| |
Temperature | Temperature | The 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. Supports Expression Language, using FlowFile attributes and Environment variables. | ||
Top K | Top K | The 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. Supports Expression Language, using FlowFile attributes and Environment variables. | ||
Top P | Top P | The 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. Supports Expression Language, using FlowFile attributes and Environment variables. | ||
Max Tokens * | Max Tokens | 1000 | The maximum number of tokens to generate Supports Expression Language, using FlowFile attributes and Environment variables. | |
Output Strategy * | Output Strategy | FlowFile |
| Determines response output destination |
Results Attribute * | Results Attribute | The name of the attribute to write the response to. This property is only considered if:
|
Dynamic Properties
This component does not support dynamic properties.
Relationships
Name | Description |
---|---|
failure | If unable to obtain a valid response from Vertex, the original FlowFile will be routed to this relationship |
success | The response from Vertex is routed to this relationship |
Reads Attributes
This processor does not read attributes.
Writes Attributes
Name | Description |
---|---|
filename | An updated filename for the response. |
mime.type | The mime type of the response. |
vertex.chat.completion.id | A unique id assigned to the conversation |
vertex.usage.inputTokens | The number of input tokens read in the request. |
vertex.usage.outputTokens | The number of output tokens generated in the response. |
State Management
This component does not store state.
Restricted
This component is not restricted.
Input Requirement
Input requirements are not specified for this component.
System Resource Considerations
This component does not specify system resource considerations.