I just lost an entire day trying to solve a problem (that i am sure is super simple) before giving up and asking here now:
I have a form to generate an email using chatGPT with a few options and a template list. When clicking on generate I generate a message in a js function and depending on the options selected by the user that would look like that:
emailText = “You are a helpful assistant that writes emails for a real estate agent, for real estate transactions in French using a provided template. You can modify the template. Always be polite. Mention that the deadline is past since -41 days. Mention the transaction name: Maison de Bel Airs. he name of the person you are writing to is: Olivia Durand.”
I am trying to pass that value to my serverconnect, but i just cannot. I have tried regular variable, localStorage, sessions nothing works. My API call to openAI is good it works well when i hardcode the message.
so to put it simply lets say I run the following code when clicking on a button:
function generateMessage(){
emailText = ‘A message’;
return emailText;
}
How can i then pass it to my serverconnect generateGPT.load({messagetext: ???})
I have also tried to run the serverconnect from my function but nothing happens, it looks like the line is ignored:
function generateMessage(){
emailText = ‘A message’;
dmx.parse(generateGPT.load({messagetext: emailText}));
}