# Make a test loop in a scenario

**URL:** <https://community.make.com/t/make-a-test-loop-in-a-scenario/23604>\
**Category:** Questions\
**Tags:** chatgpt\
**Created:** [January 8, 2024, 11:27am UTC](https://community.make.com/t/make-a-test-loop-in-a-scenario/23604 "2024-01-08T11:27:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pamela1](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@Pamela1](https://community.make.com/u/Pamela1)\
**Post date:** [January 8, 2024, 11:27am UTC](https://community.make.com/t/make-a-test-loop-in-a-scenario/23604/1 "2024-01-08T11:27:56Z")

</div>

Hi.  
I am trying to make chatgpt produce a summary with limited number of characters, but can’t manage to do it (see [Can't make chatgpt produce a text with limited characters number](https://community.make.com/t/cant-make-chatgpt-produce-a-text-with-limited-characters-number/23601))

So I am thinking about creating a loop & test:

- ask chatgpt create a summary
- test if output is less than X characters long
- if not, ask chatgpt to make it shorter and test again
- if output is less than X characters, get out of the loop.

How can I do that in a scenario?

---

<div class="post-metadata">

**Author:** ![Msquare\_Automation](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/msquare_automation/32/6634_2.png) [@Msquare\_Automation](https://community.make.com/u/Msquare_Automation)\
**Post date:** [January 8, 2024, 12:02pm UTC](https://community.make.com/t/make-a-test-loop-in-a-scenario/23604/2 "2024-01-08T12:02:20Z")

</div>

Hi @Pamela1

Could you please share your scenario screenshot?

Please try giving the prompt to create summary to ChatGPT then 2 routes. One with a filter “length” of text \> 500, add one more chatGPT module to rephrase the summary in less than 500 words. Another route for “length” of text \<= 500 as a result.

If you require additional assistance, please don’t hesitate to reach out to us.  
[MSquare Support](https://calendly.com/msquarepro/meeting)  
Visit us [here](https://www.msquare.pro/)  
[Youtube Channel](https://www.youtube.com/channel/UCqidlIIwbejxZmRUWBICcjQ)

---

<div class="post-metadata">

**Author:** ![kaustubh\_dalvi](https://avatars.discourse-cdn.com/v4/letter/k/8dc957/32.png) [@kaustubh\_dalvi](https://community.make.com/u/kaustubh_dalvi)\
**Post date:** [January 8, 2024, 12:38pm UTC](https://community.make.com/t/make-a-test-loop-in-a-scenario/23604/3 "2024-01-08T12:38:36Z")

</div>

Hey, @Pamela1.  
I hope everything is going well for you.

I’ll advise you not to make the scenario more complicated (operational and time-consuming). Alternatively, you might attempt to precisely trigger the GPT. The following tips could assist you in enhancing the chat GPT’s prompting:

- Establish Proper connection
- Model (GPT 3.5 Turbo: gpt-3.5-turbo)
- Role
- Task
- Content

**Here’s an example how you can prompt…**

 ![Screenshot (82)](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/d/f/dfe888ca848ad2939e5457b0d0909b2c146edf13.png)  
 ![Screenshot (83)](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/f/0/f06b2c5514b2d5c539f9447eb1fc68f02a5aa1f8.png)

**Let me know if you need any assistance with this.**

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [January 8, 2024, 1:11pm UTC](https://community.make.com/t/make-a-test-loop-in-a-scenario/23604/4 "2024-01-08T13:11:40Z")

</div>

> [@Pamela1](#):
>
> - if not, ask chatgpt to make it shorter and test again

Like I [mentioned in your other question](https://community.make.com/t/cant-make-chatgpt-produce-a-text-with-limited-characters-number/23601/3), you can replace point three with “ **Reduce number of max tokens** ” (and try again).

One way to reduce the number of tokens per repeat, is by using a negative “step” in the Repeater module.

![Screenshot_2024-01-08_210151](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/6/c/6cfb6250f73a7987ab08733ba6328d94c6880279.png)

This starts of with 500, then 400, then 300

![Screenshot_2024-01-08_210109](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/b/7/b7a39f895fa11caa71d4d118e92a6a657ae1d69e.png)

Then, you can insert this variable into the Max Tokens field.

![Screenshot_2024-01-08_210114](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/4/5/45f58850d2852d8c8e4359c9d5a75df19926ff66.png)

---

<div class="post-metadata">

**Author:** ![Pamela1](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@Pamela1](https://community.make.com/u/Pamela1)\
**Post date:** [January 8, 2024, 4:37pm UTC](https://community.make.com/t/make-a-test-loop-in-a-scenario/23604/5 "2024-01-08T16:37:51Z")

</div>

@Msquare_Automation here is the screenshot

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/6/3/634d1a8b92d53d21176e1c526b7a71085bed8681.png)

1. I trigger with a message to telegram
2. then I extract the url in the message
3. I scrapt the webpage from the url to extract content
4. I send it to a cell in sheets to detect the language (with a sheet function)
5. I get the la language in another cell
6. I set a variable depending on the detected language (to publish in the right telegram channel at the end)
7. I set another variable depending on the detected language (to set the right language code for the buesky/unshape module
8. one route goes to chatgpt making a long (less than 500) summary of the webpage extracted content. THIS DOES NOT WORK WELL. I publish chatgpt output to mastodon.
9. the other route goes to chatgpt making a short (less that 280) comment about the webpage extracted content. THIS DOES NOT CREATE PROBLEMS FOR THE MOMENT. I publish chatgpt output TW, BS, TG and a cell in sheet.

I thought about the “two routes” option, but if after second chatgpt rephrase the output is still over 500, then it will break again 😕

---

<div class="post-metadata">

**Author:** ![Make\_Bot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/make_bot/32/14661_2.png) [@Make\_Bot](https://community.make.com/u/Make_Bot)\
**Post date:** [January 29, 2024, 5:28pm UTC](https://community.make.com/t/make-a-test-loop-in-a-scenario/23604/6 "2024-01-29T17:28:03Z")

</div>


