minosvasilias / godot-copilot

AI-assisted development for the Godot engine.
MIT License
197 stars 12 forks source link

Thank you! + A couple ideas #2

Open Kelin2025 opened 1 year ago

Kelin2025 commented 1 year ago

Hi! Just wanted to say thank you, awesome extension! I have a couple ideas on how to improve DX

Save snippets

When using text-davinci-003 model, it's really useful to use the following pattern:

Prompt 1
Solution 1

Prompt 2
%let it complete solution 2%

And since indexing the whole codebase is a painful task, having snippets library for that could be a good workaround

Insert mode

It's not that critical, but in OpenAI Playground there's "Insert mode". The way how it works is that you put [insert] keyword to your prompt, and the model puts its response here. Could be useful for some cases when you want to patch some nested thing instead of making a new solution below

minosvasilias commented 1 year ago

Hey, thank you very much, glad you found it useful!

Appreciate the suggestions as well.

Regarding Save Snippets:

That's a great idea, i like it. And it could serve as a stepping stone towards more comprehensive solutions to the same problem, which would probably involve embeddings to retrieve context for the entire codebase.

Perhaps selecting some text in the editor and pressing a shortcut/button could save that piece of code as a snippet, and we assign a certain number of slots or maximum character length for saved snippets. I'll look into that when i have time. 👍

Regarding Insert Mode:

The insert-mode in their playground actually just adds a suffix parameter to the API-call. (try pressing View Code in their playground to see). godot-copilot is already using that for the davinci-model and will always attempt to send code before and after the caret to the model, in order to insert code at the caret-position.

I can imagine improving the UX somewhat though, such as replacing currently selected text when pressing the shortcut, instead of just using the caret-position.

Will need to look into whether or not selected text can actually be retrieved by the addon-scripts in both 4.x and 3.x, since that seems relevant for both suggestions.

MatMice commented 2 months ago

I feel a bit dumb, but I managed to get my API token but I have no clue where to put it. I have the plugin enabled

minosvasilias commented 2 months ago

@MatMice there should be a Copilot tab in the right hand panel with an API key field. You might need to scroll the tabs to see it if your panel is not wide enough.

Screenshot 2024-04-19 at 00 22 09
MatMice commented 2 months ago

Success; thank you <3 Now I may code within Godot and use copilot ty so much!!

also the guides on how to get the key are a bit hard to find, but after digging around other repo sites figured it out as well

minosvasilias commented 2 months ago

also the guides on how to get the key are a bit hard to find, but after digging around other repo sites figured it out as well

Yeah, i don't want to advertise these approaches too much on this repo since it risks it being banned, so the links to external sources will have to do for now.