Workflows
Prompt Chaining galore
Last updated
Prompt Chaining galore
Last updated
Workflows are how you can create complex prompt-chains and interact with live data, API's, and enhance your portals with RAG. This feature is under active development, but there's already enough there to bring value to our Beamers, so we thought we'd give y'all access.
Workflows function very similar to portals, and since they have the same inputs and outputs as a Portal can even be swapped in your application with very little work. You send variables
and messages
and then we respond with a new ChatMessage
.
This first beam is where you define the global properties of your workflow, like it's name, or the variables that it can receive via the API.
This works similar to the portal feature, except each version is a one-off, and not shared in the global list of Portals.
Each beam has it's own set of variables defined by it's prompt. The input section allows for you to map the possible inputs available in the workflow at the stage of this Portal Beam to it's internal variables. The possibilities are,
Output
This could be from a previous Portal Beam, or a API, or anything else that generates an output earlier in the workflow sequence
Variable
This references the variables that are defined by the by top-level workflow in the Start Beam, and these values will later be "filled in" by your users when they interact with this workflow via the api
Text
This is just static text that you define per Portal Beam.
You can also choose to not include all of the messages in the chat to the Ai in each Portal. This can be expecially useful when doing things like data-preprocessing, etc.
You can also take this Portal Beam for a spin by just clicking the Demo/Preview Portal button, which allows you to explore how this works in isolation.
These allow you to make branching decision logic based on, comparing variables, outputs, and static text.
You can see how your workflow works at any point by clicking the "Demo/Preview Workflow" button. The output of the final Portal step is return to the chat at the end for you to interact with.
This endpoint processes a chat interaction within a specified workflow. It supports both streaming and non-streaming operations based on the provided parameters.
Unique identifier for the workflow
"workflow-abcde"
Payload containing the chat details and parameters for processing the workflow
Variables for the workflow
Identifier for the chat session
"chat-12345"
List of messages in the chat
Whether to stream the response
true
ID of the user initiating the workflow
"user-67890"
Whether to consolidate the stream
true
Workflow interaction successful
Identifier for the chat session
"chat-12345"
Indicates if the streaming has finished
true