Home › Forums › Support › How does ChatGPT store their Chat history on the side for future reference?
- This topic has 15 replies, 3 voices, and was last updated 2 years, 11 months ago by
Leo.
-
AuthorPosts
-
February 26, 2023 at 10:06 pm #2548094
Jason
Hi Guys,
I’ve been trying for a whole week to find a solution, to save user generated text files like 1000 words files, from users that sign up and visit my wordpress website, kinda the same way as ChatGPT saves their down the left column. (photo attached) And when you click on it, it looks like it brings up a post associated with the user that made it, and stores all the chat history. How can I achieve this? what’s the easiest database to save files like chat, or text? I tried looking at SQL, but its kinda tough and looks outdated, are there easier solutions now? Any help would be appreciated.
I tried, SQL, thinking it would easily send files there, but I was wrong. I tried user post for each submission to be saved as a post, I tried email, but doesn’t work.
on my localhost I was able to save all the generated text files as .txt or .docx, but when I try the same method on my wordpress site, the files never appear anywhere, I enabled permission, so I dunno what to do now. Could you guys suggest something? I only need one folder per WordPress user/member, on the left side, called “My Content” and where all their generated text files get saved automatically.Right now they come back via successful text that is generated by an API call from openai, everything works fine, with the response text, but I’m trying to figure how to store the response text. is there maybe a plugin that maybe does this? thank you very much .
I also included a link to my test site, which is working in generating text, but not saving them
February 26, 2023 at 11:14 pm #2548138Jason
I also found another site whose layout I like, when you click on the article it brings up a specific ID /article-generator/?id=2916409
which brings up the below, which to me looks like an online word doc. looks very similar to Word.
February 27, 2023 at 5:53 am #2548483David
StaffCustomer SupportHi there,
the standard way of WordPress is that every piece of content is saved in a “Post” ( whether that be a post, page or custom post type ). That data is saved with Post Meta which can include data such as the Author.
If you adhere to that method, then listing what a user has added as a “post” should be fairly straight forward.February 27, 2023 at 6:05 am #2548505Jason
thanks for your reply, what if the response is coming back via API from openai? do I just create a post with javascript, via method ‘POST’ with a JSON file? as below.
or since it’s wordpress, am I forced to use .php? this is where I get stuck, if I have to use .php in order to create the post. thank you.
const options = {
url: ‘enterurl’,
method: ‘POST’,
headers: {
‘Content-Type’: ‘application/json’
},
json: newPost
};February 27, 2023 at 8:47 am #2548848David
StaffCustomer SupportPHP would be simplest, here is one method using
wp_insert_posthttps://stackoverflow.com/a/34435434Or you can check out the REST API:
https://developer.wordpress.org/rest-api/
And theres an npmjs package for that too ( if thats of interest ):
https://www.npmjs.com/package/wpapi
The main thing with any of these methods will be the authentication, so a user being logged in to the WP site, and using PHP or REST would probably be the least fuss
March 1, 2023 at 6:26 am #2551305Jason
oh u mean node.js? i was trying to work what that was for a full day lol, yeah the initial API call comes back using node.js from the server side. I think will be easier to add a save button after the response text comes back, so it posts it, but I never done this before so it’s all a bit confusing.
March 2, 2023 at 1:12 am #2552304David
StaffCustomer SupportYeah, node but you would need to configure that on your server.
Check thewp_insert_postfunction – looks fairly straightforward:https://developer.wordpress.org/reference/functions/wp_insert_post/
March 2, 2023 at 1:38 am #2552318Jason
do you mean server side, as in the backend? or do you mean the client side, front end, where my wordpress site is hosted?
Yeah it should be straight foward, though it’s my first time doing APIs and splitting a site with backend and front end. Thanks again.
March 2, 2023 at 4:43 am #2552540David
StaffCustomer Supportin our space, the Front End is what we the user sees in the browser.
The backend is the WordPress Admin down to the server.
So in this instance the PHP function would run in WordPress ( backend ), so it could be added to the template that you have for your form, or as separate function.March 2, 2023 at 7:13 am #2552728Jason
ok thanks for your help. I will give that a shot, cheers
March 2, 2023 at 10:59 am #2553156David
StaffCustomer SupportYou’re welcome – be good to hear how you get on!
March 3, 2023 at 6:11 am #2554011Jason
I will let you know, but I had some javascript conflict with the code, hence why it wasn’t even creating a post. So I have to rearrange some of the code around so the form works with the sliders I have on there, and can therefore save the response text as a post.
March 25, 2023 at 11:05 am #2581912Jason
hey there, Just wondering if you guys have any service to assist in php or javascript functionality, for a fee?
Just thought I’d ask here before going on Upwork etc. thank you.March 25, 2023 at 11:08 am #2581915Leo
StaffCustomer SupportHi Jason,
We don’t.
Upwork or Codeable suggested at the bottom of this page would be your best bet:
https://generatepress.com/what-support-includes/March 25, 2023 at 9:00 pm #2582181Jason
thanks for that, I will check it out, cheers
-
AuthorPosts
- The topic ‘How does ChatGPT store their Chat history on the side for future reference?’ is closed to new replies.