We can’t see your code in your post body because it seems like there is some HTML tags.
1. Format your code
Could you format your code by editing three backticks ``` before and after the code, like this:
``` input/output bundle goes here
```
or use the format code button in the editor:
2. Webflow site links
Can you please provide the project preview/share link AND the published page link of your site?
3. Scenario blueprint
Please export the scenario blueprint file to allow others to view the mappings and settings. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.
(Note: Exporting your scenario will not include private information or keys to your connections)
Please provide the output bundles of the modules by running the scenario, then click the white speech bubble on the top-right of each module, save the bundle contents in your text editor as a bundle.json file, and upload it here into this discussion thread.
Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.
Following these steps will allow others to assist you here. Thanks!
<script>
// Select the form element and the loader elements
const form = document.querySelector('#wf-form-generator');
const resultWrap = document.querySelector('#statement-component');
const resultLoader = document.querySelector('#statement-loader');
const resultText = document.querySelector('#statement-text');
// Add a submit event listener to the form
form.addEventListener('submit', (event) => {
// Prevent the default form submission behavior
event.preventDefault();
// Show the div that will contain the response and scroll to it
resultWrap.style.display = "block";
resultLoader.style.display = "flex";
resultWrap.scrollIntoView({behavior: "smooth"});
// Get the values of the form fields
const income = document.getElementById('income').value;
const debt = document.getElementById('debt').value;
const monthlysavings = document.getElementById('monthlysavings').value;
const risktolerance = document.getElementById('risktolerance').value;
const anynote = document.getElementById('anynote').value;
const profession = document.getElementById('profession').value;
const age = document.getElementById('age').value;
// Create the prompt string using the form field values
const prompt = `Generate an investment stratgey for an Indian who's profession is ${profession}, age is ${age} and income is ${income}. Their monthly savings are ${monthlysavings} and risk tolerance is ${risktolerance}. Keep in mind ${anynote}. The output should be in similar format : Sensex or nifty ₹1000, any individual high performing stocks ₹200, Gold ₹100, Silver ₹50 and mutual funds smalll cap, medium cap and large cap ₹500 etc. Note that these amounts should add upto the amount of ${monthlysavings}.`;
// Make an API call to our Make cenario
fetch('https://hook.eu2.make.com/7ruo5nlopv8cos93xx6bpqcw9mqnxwdu', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
prompt: prompt,
max_tokens: 512
})
})
// Then get the API response object, covert it to text and display it
.then(response => response.text())
.then(result => {
resultText.value = result;
resultLoader.style.display = "none";
});
});
</script>
Take a look at the execution history of the scenario and see what’s sent in the webhook response
Please provide the following details:
Please provide the output bundles of the ChatGPT module by going to the latest execution, then click the white speech bubble on the top-right of the module, save the bundle contents in your text editor as a bundle.json file, and upload it here into this discussion thread.
Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.
Following these steps will allow others to assist you here. Thanks!
For Webhook response, it must be sent within 40 seconds. If the OpenAI module takes too long, your Webhook trigger will send the default “Accepted” text only.
This is your prompt:
Generate an investment stratgey for an Indian who’s profession is other, age is 30 and income is 5000. Their monthly savings are 5000 and risk tolerance is high. Keep in mind none. The output should be in similar format : Sensex or nifty ₹1000, any individual high performing stocks ₹200, Gold ₹100, Silver ₹50 and mutual funds smalll cap, medium cap and large cap ₹500 etc. Note that these amounts should add upto the amount of 5000.
Sometimes there is this error, resulting in the termination of the scenario. The Webhook response module was not run, so the Trigger responded with the default “Accepted” message.
I checked the history after trying this a few times.
It solved the timeout error but I still can’t see the output in the website.
It still shows “accepted” even though the scenario was completed in under 30 seconds.
I’ve changed the model to gpt-3.5-turbo-16k-0613 with 1000 max tokens as you suggested.
Is there any other way I can make this work out or should I continue with fixing this only?
Will I’ve to change anything else in the custom code with I go with http?
Also, I went through the http tutorial. Can you tell me how the make scenario will look?
Thanks for your help. Looking forward for your response.
Hey,
seems like it isn’t a timeout error. I’m getting response in 10-20 seconds. Still it just shows “accepted”.
I’d request to you help me out.
Waiting for response.