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

complete code snippet #13

Open
j0bekt01 opened this issue Jul 16, 2024 · 3 comments
Open

complete code snippet #13

j0bekt01 opened this issue Jul 16, 2024 · 3 comments

Comments

@j0bekt01
Copy link

could you show us how to iteratively get a complete code snippet. I've tried many times but only got a first line.

@rajagopalreddykontham
Copy link

Do we require Copilot subscription to get replies when we sent prompt

@j0bekt01
Copy link
Author

yes

@psybers
Copy link

psybers commented Oct 28, 2024

You can iterate like this:

def copilot_iter(prompt, language='python'):
    original = prompt
    while True:
        result = copilot(prompt, language)
        if result == '\n\n':
            break
        prompt += result
    return prompt[len(original) + 1:].replace('\n\n', '\n') + '\n'

Just add that function to the original app.py and then call it instead of calling copilot() on line 154:

completion = copilot(prompt, language)

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

No branches or pull requests

3 participants