Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Suggested By Someone On Greasyfork #87

Open
GITHUBTRASHACCOUNT opened this issue Dec 17, 2024 · 1 comment
Open

Code Suggested By Someone On Greasyfork #87

GITHUBTRASHACCOUNT opened this issue Dec 17, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@GITHUBTRASHACCOUNT
Copy link

Feature Request: Code Completer for ChatGPT

Overview:
I propose a feature that adds a "Continue" button to the ChatGPT interface, enabling users to retrieve additional code from truncated responses. This would enhance usability and productivity for developers.

Code Snippet:

// Function to create and insert the "Continue" button
function createBtn() {
    let continueBtn = document.createElement('button');
    continueBtn.textContent = "Continue";
    continueBtn.className = 'btn btn-neutral';
    continueBtn.disabled = true; // Start with disabled state
    return continueBtn;
}

// Function to get the last assistant's code block
function getLastAssistantCode() {
    let assistantMessages = document.querySelectorAll('.assistant');
    if (assistantMessages.length === 0) return null;
    let lastAssistant = assistantMessages[assistantMessages.length - 1];
    let codeBlocks = lastAssistant.querySelectorAll('code.hljs');
    if (codeBlocks.length === 0) return null;
    let lastCodeBlock = codeBlocks[codeBlocks.length - 1];
    return lastCodeBlock.innerText;
}

// Function to update the textarea with the continuation prompt
function updateTextArea(value) {
    let textarea = document.querySelector('textarea');
    if (textarea) {
        textarea.value = value;
    }
}
@adamlui adamlui added the enhancement New feature or request label Dec 18, 2024
@adamlui
Copy link
Owner

adamlui commented Dec 18, 2024

Sup @GITHUBTRASHACCOUNT the plugin already auto-continues truncated responses including code by auto-clicking native Continue button. Does this not happen for you? Also you can make PR and I can see it in action (and provide me test prompts)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants