banner
endercat

endercat

某个白嫖怪的分享博客 现已迁移到 https://endercat.eu.org 请前往该URL查看最新文章
bilibili
github
telegram

Embed ChatGPT that can read articles on the blog.

In the previous article, we implemented a conversation with ChatGPT on the blog by embedding ora.sh's HTML. 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, enabling it to read articles and establish a direct connection, adding intelligence and fun to your blog.

image


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#

  1. Go to Fast GPT (or deploy it yourself) and register as required.
    image
  2. 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).
    image
  3. Go to the knowledge base page and add a knowledge base.
    image
  4. Import article data (you need to add the data for each article update later).
    image
    image
  5. Create an AI.
    image
  6. Set it up as shown in the image below.
    image
    Select the knowledge base, customize the temperature, write your own prompts, and remember to save.
    After saving, you can try if the conversation works properly.
  7. Set up a publicly accessible link.
    image
    image
    Customize the maximum context.
  8. Embed it in the blog.
    Refer to the method in the previous article and 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. Click on the ChatGPT button in the top bar to start a conversation.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.