Continue in-complete GPT responses.

A script that makes GPT responses continue.

  1. // ==UserScript==
  2. // @name Continue in-complete GPT responses.
  3. // @description A script that makes GPT responses continue.
  4. // @version 1.1
  5. // @icon https://www.google.com/favicon.ico
  6. // @author blank
  7. // @namespace https://google.com
  8. // @match https://chat.openai.com/*
  9. // @run-at document-start
  10. // @license MIT
  11. // ==/UserScript==
  12. (function() {
  13. "use strict";
  14. const log = console.log;
  15. // Get the ChatGPT response element.
  16. const responseElement = document.querySelector(".chat-gpt-response");
  17. // Check if the response is incomplete.
  18. if (responseElement.textContent.endsWith("...")) {
  19. // Get the last word in the response.
  20. const lastWord = responseElement.textContent.split(" ").pop();
  21. // Generate a continuation for the response.
  22. const continuation = GPT.continue(lastWord);
  23. // Append the continuation to the response.
  24. responseElement.textContent += continuation;
  25. // Check if the response is still incomplete.
  26. if (responseElement.textContent.endsWith("...")) {
  27. // Generate a new continuation for the response.
  28. const newContinuation = GPT.continue(continuation);
  29. // Append the new continuation to the response.
  30. responseElement.textContent += newContinuation;
  31. }
  32. }
  33. })();