-
-
Notifications
You must be signed in to change notification settings - Fork 334
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
Expose templates for customisation in providers #581
Conversation
Nice work. Besides, I think it would be better to be able to configure prompt on the UI. |
5e1972e
to
c891855
Compare
I think this could be implemented in a follow up PR; the UI template should probably take precedence over provider-defined template. |
c891855
to
8a1dbca
Compare
Rebased this on latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this locally and everything works. My only concern is regarding the method name; I would prefer get_completion_prompt_template()
and drop the inline
word. We should keep inline
implicit if we don't support any other types of completion.
Also, I foresee difficulty with backporting this PR to 1.x as-is, since it also includes changes to the autocomplete work that is exclusive to 2.x. It might be easier to split the autocomplete-related changes into a separate PR and make this one smaller and "more backport-able". However, this is up to you, and I leave you the responsibility of backporting this PR. 👍
Finally, can you also consider a follow-up PR to remove the word inline
from the completion handler classes? For example, DefaultInlineCompletionHandler => DefaultCompletionHandler
. I would greatly prefer shorter and less redundant names.
Well, this is where we have different opinions - in #465 I included a detailed reasoning for using "inline completion" over just "completion" or other terms, let me quote it here:
If you a specific term was used it would be easier in future to introduce other completion types. For example, some users prefer a AI-powered tab-completer which uses learned patterns to infer top k tokens to prioiritise (see tabnine, previously kite). As far as I know this is also the code name used in other IDEs so keeping it explicit makes the codebase easy to navigate for others.
Yes, I will take care of backport this - no worries. |
8a1dbca
to
b235e0f
Compare
Sure if I have not convinced you on this one in the message above, I will open such a PR - just let me know :)
Done in b235e0f. |
b235e0f
to
b3e507c
Compare
Rebased to pickup a single-word change in README 😆 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@krassowski Thanks for addressing my feedback. I've approved this PR; you should have permission to merge & backport this PR yourself. If not, just ping me. 👍
Regarding "inline completion" v.s. "completion": I still prefer "completion" to be internally consistent; I think it's awkward how we only include the word "inline" when we have enough space for it. But I won't block on this, since you certainly know more about this topic than I do.
@meeseeksdev please backport to 1.x |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
* Expose chat template for customisation in providers * Enable completion template customization, including suffix * Remove `inline` from "inline completion" as per review request
* Expose chat template for customisation in providers * Enable completion template customization, including suffix * Remove `inline` from "inline completion" as per review request
References
Code changes
Adds:
get_chat_prompt_template()
toBaseProvider
, allowing custom providers to override chat prompt template.get_inline_completion_prompt_template()
for completion template