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

Minimal changes to allow multiline suggestions. #1948

Merged
merged 2 commits into from
Jan 1, 2025

Conversation

Carreau
Copy link
Contributor

@Carreau Carreau commented Dec 19, 2024

I'm trying to be the least invasive;
But the idea is to allow access to previous lines when rendering a line in order to shift them down; and display multiline sugestions.

With this I can add minimal modifications into IPython that allows multiline suggestions (typically would be created by an LLM – while not a big fan, there is a lot of requests for it.

I'm going to assume there is no willingness tochange the current API for transformers to get at least a ranges of lines instead of lines, it would be easier to handle.

I do not include any update to the transformers we use in IPython to display those completions; but once battled tested a bit more, I'm happy to contribute it as well.


Here is what it could looks like in IPython for example.

Screen.Recording.2024-12-19.at.14.03.28.mov

I'm trying to be the least invasive;
But the idea is to allow access to previous lines when rendering a line
in order to shift them down; and display multiline sugestions.

With this I can add minimal modification into IPython that allows
multiline suggestion (typically would be created by an LLM – while not a
big fan, there is a lot of requests for it.

I'm going to assume there is no willingness tochange the current API
for transformers to get at least a ranges of lines instead of lines,
it would be easier to handle.

I do not include any update to the transformers we use in IPython to
display those completions; but once battled tested a bit more, I'm happy
to contribute it as well.
@jonathanslenders jonathanslenders merged commit 8ea3306 into prompt-toolkit:master Jan 1, 2025
6 checks passed
@jonathanslenders
Copy link
Member

Thank you!

@Carreau
Copy link
Contributor Author

Carreau commented Jan 1, 2025

Thanks, and happy new year.

I'll contribute some examples that show how one can achieve showing multiple lines later this month.

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

Successfully merging this pull request may close these issues.

2 participants