How to build Flows?

Building a Flow is straightforward. Let's explore the process by creating a simple Flow where an input is fed into an LLM to generate a response.

  1. Go to the ‘Flows’ section, and click the ‘+New Flow’ button.

  1. You will be directed to the ‘Build’ page, where you can start building the Flow.

  1. On the ‘Build’ page, the first component is a default text input. To change the input action, click on the input component’s box. A side screen will appear, allowing you to select the appropriate input type from the Action dropdown menu. For this example, we will choose a text input.

  1. Then click on the ‘+' button below the input component. Navigate to the side screen, enter “ZBrain model” in the search field, and click on it.

  1. Choose an ‘Action’ for the model to perform. This Action can include tasks such as generating images, transcribing audio, converting text to audio recordings, and more. In this case, we will select the 'Ask LLM' action.

  1. Now, navigate to ‘Connection’ and click on ‘+New Connection.

  1. Here, provide a name for the connection and enter your API key. Follow the on-screen instructions to locate your OpenAI API Key and input it into the designated field. You can also find your ZBrain API key under Settings -> My Account. Finally, click the ‘Save’ button to proceed.

  1. Next, choose a suitable model, enter a question, and configure other additional parameters based on your specific needs.

  1. Click the '+' button again, then type "response" in the search bar. From the search results, select the 'HTTP' option.

  1. Once the side screen appears, choose the action you want the component to perform. Here, select the ‘Return Response' option.

  1. A response box will appear where you can define the data returned by your Flow. Paste the following code snippet into the box:

{
 "response" : "{{step_2}}"  
}

Here, step_2 represents the result of the second step. Modify this value as needed depending on which step's response you require.

  1. Your final Flow is now complete. Click the ‘Save’ button to store your changes.

How to test each step in the Flow?

Testing each step in the Flow involves validating each component’s functionality to ensure it operates as expected. Once a component is tested, you will be provided with sample data. The generated sample data can then be used to validate and refine subsequent steps, contributing to the overall development and reliability of your Flow application.

Here’s how to test each step:

  1. Select the component you wish to test. In this case, we are selecting the second component of the Flow, labeled as ‘Ask LLM’.

  1. Click the play button located at the top right corner of the side screen.

  1. Next, on the 'Generate Sample Data' screen that appears, click the ‘Test step’ button.

  1. The sample data will be generated successfully. Repeat the same step to test each component.

Last updated