OpenAI Playground (ChatGPT) - Continue Button

press the single [Continue] button instead of having to repeatedly click and type 'Add message > continue > Ctrl+Enter' to continue GPT's output

目前为 2023-05-21 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name OpenAI Playground (ChatGPT) - Continue Button
  3. // @namespace https://greasyfork.org/en/users/10118-drhouse
  4. // @version 1.0
  5. // @description press the single [Continue] button instead of having to repeatedly click and type 'Add message > continue > Ctrl+Enter' to continue GPT's output
  6. // @include https://platform.openai.com/playground?mode*
  7. // @require http://code.jquery.com/jquery-3.4.1.min.js
  8. // @require https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.18.2/babel.js
  9. // @require https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.16.0/polyfill.js
  10. // @author drhouse
  11. // @license CC-BY-NC-SA-4.0
  12. // @icon https://www.google.com/s2/favicons?sz=64&domain=openai.com
  13. // ==/UserScript==
  14. /* global jQuery, $ */
  15. this.$ = this.jQuery = jQuery.noConflict(true);
  16. (function($){
  17. setTimeout(function(){
  18. var path = "#root > div.route-container > div > div.pg-root.page-body.full-width.flush > div > div.pg-body > div.pg-editor > div > div > div.chat-pg-right-wrapper > div.chat-pg-footer > span > button.btn.btn-sm.btn-minimal.btn-neutral"
  19. $('<button id="continue" tabindex="0" class="btn btn-sm btn-filled btn-primary" type="button" data-testid="pg-submit-btn" aria-haspopup="true" aria-expanded="false"><span class="btn-label-wrap"><span class="btn-label-inner">Continue&zwj;</span></span></button>').insertAfter(path)
  20.  
  21. $("button[id='continue']").click(function(){
  22. $("#root > div.route-container > div > div.pg-root.page-body.full-width.flush > div > div.pg-body > div.pg-editor > div > div > div.chat-pg-right-wrapper > div.chat-pg-panel-wrapper > div > div > div.chat-pg-message.add-message")[0].click()
  23. setTimeout(function(){
  24. $("#root > div.route-container > div > div.pg-root.page-body.full-width.flush > div > div.pg-body > div.pg-editor > div > div > div.chat-pg-right-wrapper > div.chat-pg-panel-wrapper > div > div > div:nth-child(3) > div.text-input-with-focus > textarea").text('continue')
  25. }, 500);
  26. setTimeout(function(){
  27. $("#root > div.route-container > div > div.pg-root.page-body.full-width.flush > div > div.pg-body > div.pg-editor > div > div > div.chat-pg-right-wrapper > div.chat-pg-footer > span > button:nth-child(1)")[0].click()
  28. }, 1000);
  29. });
  30. }, 1000);
  31. })(jQuery);