Hello!
So I’d like to create a ChatGPT Chat completion, where the answer contains 5 rows of answer.
Example:
“1. Bla bla
2. Bla Bla
3.
4.
5. Bla bla”
When I create this I get only 1 output of course. But I want to create 5 different outputs from this.
I have tried text parser with this:
But in the future actions I was only able to map the first output.
Please help, how can I solve this?
What I’ve done in a similar instance is to instruct OpenAI to return the results in a predefined format like
“Return the text in the following format:
{Number}. {Text string} (add the symbol # between each Text string).”
You would then get the output as
- blah blah#
- bla bla#
- bla bla blah#
Once you do that, you can then use the set variable “split” function with the delimiter as “#” to split the string into an array of strings, iterate over the results and do your follow on steps.
2 Likes
Welcome to the Make community!
A Text Parser Match Pattern module only works when the output is consistent.
You’ll need to somehow specify the format in the prompt and make sure OpenAI follows it.
For further assistance, please provide the following:
When asking for help with creating a regex pattern for a text parser module, please copy and paste the text here as well so that we can run it against test patterns.
Don’t forget to use the format code button in the editor:
samliew – request private consultation
Join the unofficial Make Discord server to chat with us!
2 Likes