Use form data to build prompts
-
Hi Jordy,
I’m loving your plugin so far. I have experimented with most of the other GPT plugins out there and I think you are on the right track. So many possibilities with this tech!
My question today has to do with using a form with a set of inputs to collect information from a visitor, take that data and formulate it into a prompt, and then provide the customized response back to the user.
Basically, the user doesn’t see the chatbot at all. They don’t even know they are building a prompt.
I have a use case for this that I don’t want to make public yet.
But I think having this type of interface would provide you with a huge advantage to your competition.
Let’s chat if this is something you are interested in.
Talk soon,
Rick
-
Hi @five40,
That sounds interesting ?? So it would be a form builder, basically? Or a predefined form? And then, the discussion, or the request, would go directly to the AI from that prompt?
Let me know more ??
Probably best to provide a real world example.
Let’s say you have a site that reviews movies and TV shows. You want to provide visitors with custom tailored recommendations.
An AI prompt might look like:
“I’m 24 years old, female, english speaking, I watch 3 movies a month, I like horror and fantasy genres, my 3 favorite movies are ‘The Shape of Water’, ‘Get Out’ and ‘King Kong’. Please recommend 3 movies for me to watch”
My concept is to hide the whole concept of a prompt and provide a group of inputs to the visitor instead (radio buttons, multi-choice, text, etc) and then give them a custom response
That’s a super simple example. You could also let them refine the list. Or add affiliate links, or supply a small sample and paywall the rest, etc.-
This reply was modified 2 years, 1 month ago by
five40.
Here’s a quick mockup:
https://wireframe.cc/EuOzWsI also have a use case for this. I even tried to work out how to build by asking ChatGPT.
What would be cool is:
- either a simple form builder in the plugin or an integration with a 3rd party/s form builder.
- Ability to create custom prompts in your AI plugin dashboard.
- User completes form on frontend
- Combine the submitted form data with the custom prompt and send to OpenAI
- Render response on the screen for user.
Maybe this should be pulled off line, developed, and then re-released as a stand-alone. Potentially a ‘killer-app’. ??</img>
Hi guys! Of course, I really love this idea; originally, I thought of AI Engine more like the engine to power other plugins or developers to create their own forms or UI, but it’s true, AI Engine could also have its own form builder! And it’s not so hard to implement for me, based on my framework and the work I did with my other plugins.
I’ll do it ?? It might take a month or two, but that will be there. Don’t hesitate to leave a little review @five40, that motivates me. And also, as the earlier users sharing with me ideas and feedback, I want to make you super happy! So when I release a Pro Version, contact me, we’ll discuss! ??Hi Jordy- I wIll put up a review this afternoon!
I have been tinkering with the chatbot.php file. I have several fun iterations in development!
Can you provide some advice?
I’d like to assign different [shortcodes] to different version of chatbot.php.
Example: I have a copy of chatbot.php named chatbot_books.php, I want to assign that version a new shortcode like [mwai_chatbot_books]
What do you recommend?
Thanks!Hi @five40,
As you can see, it’s completely modular, so you can copy/paste this file, and make your own (don’t keep the file in the plugin though, as it will be erased when it gets updated).
This define the name of the shortcode:
add_shortcode( 'mwai_chat', array( $this, 'chat' ) );
You can give the name of your own shortcode here, then modify the chatbot to your liking.
That said, depending on what you do and what you want, I could integrate this directly. I will change stuff and enhance the whole thing, so it’s possible that your own version of the chatbot stops working at some point (potentially – I am not really sure – in any case, it will be fixable, but I just wanted to say it).
Don’t hesitate to share with me what you really want to do, and maybe there will be a simpler way. But yes, you can also play with this file, I make it so so that it’s not very difficult to change, and many of those can be used at the same time, they will not collide ??
OK. Close. But not working.
Here are the steps I tried:
1. I made a copy of the chatbot.php file. Made some changes to fit my needs. Changed the shortcode to [chat_books]
2. Renamed the modified file ‘chatbotbooks.php
3. Uploaded chatbotbooks.php to classes>modules folder.
At this point, [chat_books] returns nothing while [mwai_chat] functions correctly.
To test
– I renamed chatbot.php to chatbot.old
– I renamed chatbotbooks.php to chatbot.php
After this change, the [chat_books] shortcode works correctly.
Suggestions?Ohhhh wait ?? The files inside the /modules folder are not being loaded automatically. Also, you shouldn’t add any files there, as they will be removed at every update (the whole folder is being replaced by the WordPress update system).
Have a look at this: https://meowapps.com/add-custom-php-code-wordpress/. I recommend using Code Snippets.
Create a new snippet, copy the code you have in your php file directly in it. And that should work! ??
If you want to really keep a PHP file (let’s say, “custom_chat_bot.php”), you can drop it in your theme folder (again, if the theme is updated, it will go away). In the functions.php of your file, simply add
require("./custom_chat_bot.php");
But I still recommend you to use Code Snippets ??
Hi Jordy-
Been working on this and have hit a roadblock. I’m hoping you can help with this.
Here’s where I’m at:
https://eatlovegrow.com/test/
I’ve finally developed a prompt that returns (mostly) consistent results.I’m keeping the prompt as short as possible to minimize token usage.
This is where I am stuck-
I need to break down the answer being returned into 3 variables- title, author, and description. That will allow me to format the answer (links, retrieving images, etc).
You can see the answer I’m getting in the console.
Within the code I want to capture the answer, break it down into variables, add what I need, and then send it to the page with all my formatting intact.
I’ve tried php and js solutions but it’s just outside my understanding. I’m not quite sure how to get the data and then return it.
If you can provide any suggestions I’d appreciate it!
Let me know what you think of the concept!!
Thanks,
RickIt will be difficult for me to help you developing this completely, as it would take a lot of time ??
But I have a few thoughts.
- The chatbot is not the right tool; maybe you changed it a lot, and it’s not a chatbot at all anymore, but still, the code of the chatbot was not meant do to that at all. However, we could think of an alternative way: I could create some kind of shortcode, that will act as a “response” holder but also will propose helpers accessible in Javascript. You’ll only need to handle what’s in the form, prepare the prompt, and call that that helper. You’ll get the response, you’ll be able to filter it (to make some changes for example), and the result will be displayed in the container of the shortcode. It’s an idea. Let me know what you think of this. Then I will make an example similar to yours and try to make it work.
- There are errors on your website. Make sure you have no errors; it’s really important ?? For example: ReferenceError: height is not defined, Uncaught ReferenceError: data is not defined. Not sure where this happens, but it will cause issues.
- I can see some output based on what I like; however, it’s using Markdown it seems… in that case, you can check Enable Formatting in the Chatbot setting (admin side), and it will transform this into HTML. Of course, it depends on how you want to do it. If I develop my own solution, I’ll need to look into this more.
I hope it helps a little bit ??
Okay, thought about it. Extremely doable. So much that I have decided to do it ?? Give me some time, I need to build the form builder (it will be usable directly in the Post Editor, through blocks).
Yes, I completely butchered your original chatbot to make that happen. I’d be embarrassed to ever show it to you! ??</img>
My hope was that once you saw it you would be as excited as I am. So many possibilities and business uses.
If you’re interested in marketing the concept as a stand-alone product on a pro level I’d love to be involved. I recently retired but I’ll jump back in for something of this scale. -
This reply was modified 2 years, 1 month ago by
- The topic ‘Use form data to build prompts’ is closed to new replies.