Click through a step-by-step, interactive demo walkthrough of Mindstudio, powered by Supademo.
Steps
1
If you want to name your new function, click on "Details" from within the editor
2
Enter the new name here
3
Once you're ready, build out your function in test mode. You can name the flow however you want, in this example, it's "test.flow"
4
Test.flow is an internal workflow that won't be used in the API. It will use normal variables, hence we don't need API Launch Variables
5
Add all the user inputs you need for the workflow. Here, we added a few user inputs to capture details on the lead we want to evaluate
6
Add a Generate Text Block and enter the prompt to evaluate the lead as VIP.
7
Then, add an end block terminator and map the output. For this example, we might want this as:
"isVip":""
8
Please continue with the next steps.
9
In the API flow, we do need to initialize the variables
10
Click on the Launch Variable input and enter the name of all the variables that will come from the API
11
Now, advance to the upcoming steps.
12
Click on add
13
Add as many as you need
14
After that, add a "Generate Text" block and enter all the data the AI will need to evaluate if the lead is a VIP or not
15
This is what we have now. Remember this will be sent together with the system prompt (workflow-dependent), which instructs the AI on what makes a lead a VIP
16
For Context, this is the main prompt for this workflow and the test one
17
We need to save this as a variable so we can display it in the structured output
18
Let's proceed to the next steps now.
19
Then, add an endpoint "End"
20
Enter the key/value pair for the structured output. You probably want the same structure as your test, so
"isVip":"" in this example
21
Proceed to the following steps now.
22
That's it - time to test!
23
Click on "Open published app".
24
Create a new thread
25
Enter all of the required information (remember you'll need to pass these via API when using the api.flow, this is only for testing purposes)
26
Once you're done, click continue. For reference, this set of info means the lead is NOT a VIP
27
And that's correct!
28
Let's try it with a positive result
29
Let's fill up the form to make it clear this lead IS a VIP
30
Click on "Continue".
31
Click on ""true"".
32
That's correct!
In a few minutes, you built an AI Cloud Function that can take in the lead details, determine if they're VIP, and send the result back in structured JSON.
Great job!