Continue in-complete GPT responses.

A script that makes GPT responses continue.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Continue in-complete GPT responses.
// @description  A script that makes GPT responses continue. 
// @version      1.1
// @icon         https://www.google.com/favicon.ico
// @author       blank
// @namespace    https://google.com
// @match        https://chat.openai.com/*
// @run-at       document-start
// @license      MIT
// ==/UserScript==
(function() {
    "use strict";
 
    const log = console.log;
 
    // Get the ChatGPT response element.
    const responseElement = document.querySelector(".chat-gpt-response");
 
    // Check if the response is incomplete.
    if (responseElement.textContent.endsWith("...")) {
 
        // Get the last word in the response.
        const lastWord = responseElement.textContent.split(" ").pop();
 
        // Generate a continuation for the response.
        const continuation = GPT.continue(lastWord);
 
        // Append the continuation to the response.
        responseElement.textContent += continuation;
 
        // Check if the response is still incomplete.
        if (responseElement.textContent.endsWith("...")) {
 
            // Generate a new continuation for the response.
            const newContinuation = GPT.continue(continuation);
 
            // Append the new continuation to the response.
            responseElement.textContent += newContinuation;
        }
    }
})();