In the previous article, we implemented a conversation with ChatGPT on the blog by embedding html from ora.sh. However, this method not only fails to read the articles on the blog but also requires a VPN to access. So, is there any method that can allow ChatGPT to read the content of the articles without the need for a VPN? This article will introduce how to embed ChatGPT on the blog, which can read the articles and establish a direct connection, adding intelligence and fun to your blog.
Prerequisites#
You need an OpenAi API KEY (if you don't have one, you can check out some keys I shared or purchase credits directly from Fast GPT).
Method#
-
Go to Fast GPT (or deploy it yourself) and register as required.
-
Go to the account page and set your OpenAi API KEY (if not set, the free credits will not be enough, of course, you can also purchase credits directly from Fast GPT).
-
Go to the knowledge base page and add a knowledge base.
-
Import article data (you need to add the data of that article every time you update the article later).
-
Create an AI.
-
Set according to the following image.
Select the knowledge base, customize the temperature, write your own prompts, and remember to save in the end.
After saving, you can try if the conversation works properly. -
Set the link for public access.
Customize the maximum context. -
Embed in the blog.
Refer to the method in the previous article, replace the html code with
<div style="height:600px; width:400px">
<iframe
src="obtained link"
width="100%"
height="100%"
style="border:0; border-radius: 4px"
/>
</div>
Now you should be able to have a conversation with ChatGPT on your blog, and ChatGPT should be able to read the content of the articles. You can also place the html code in articles or other places that can load html.
I have already deployed this method on my blog, so click on the ChatGPT button on the top bar to start a conversation.