Skip to content

Multiline suggest in prompt_toolkit and LLM autocompletion#14623

Merged
Carreau merged 1 commit intoipython:mainfrom
Carreau:mline-suggest
Jan 31, 2025
Merged

Multiline suggest in prompt_toolkit and LLM autocompletion#14623
Carreau merged 1 commit intoipython:mainfrom
Carreau:mline-suggest

Conversation

@Carreau
Copy link
Copy Markdown
Member

@Carreau Carreau commented Dec 18, 2024

This is a preview-draft of modification to IPython in order
to allow multi-line suggestion in the terminal, and add the necesarry
hooks and examples, in order to trigger LLM autocomplation via a
shortcut.

This will not be complete, but will be available as a preview in IPython
8.32 in order to gather feedback.

This tries to be as compatible as possible with jupyter_ai and
jupyter_ai_magics, except the Provider cannot take parameters in their
constructor.

@Carreau
Copy link
Copy Markdown
Member Author

Carreau commented Jan 7, 2025

@Carreau
Copy link
Copy Markdown
Member Author

Carreau commented Jan 7, 2025

@Yann-P, want to take a look at taking over this, and potentially writing a real completer that will interrogate a LLM ?

@Carreau
Copy link
Copy Markdown
Member Author

Carreau commented Jan 23, 2025

@Carreau
Copy link
Copy Markdown
Member Author

Carreau commented Jan 23, 2025

Note that you can run

from IPython.terminal.shortcuts.auto_suggest import AppendAutoSuggestionInAnyLine
AppendAutoSuggestionInAnyLine._debug = True

To show some debugging.

@Carreau Carreau force-pushed the mline-suggest branch 3 times, most recently from 7484545 to d7dd087 Compare January 29, 2025 12:44
@Carreau Carreau changed the title multiline suggest in ptk. Multiline suggest in prompt_toolkit and LLM autocompletion Jan 31, 2025
@Carreau Carreau marked this pull request as ready for review January 31, 2025 13:08
@Carreau Carreau force-pushed the mline-suggest branch 2 times, most recently from a5eca08 to d832859 Compare January 31, 2025 13:11
This is a preview-draft of modification to IPython in order
to allow multi-line suggestion in the terminal, and add the necesarry
hooks and examples, in order to trigger LLM autocomplation via a
shortcut.

This will not be complete, but will be available as a preview in IPython
8.32 in order to gather feedback.

This tries to be as compatible as possible with jupyter_ai and
jupyter_ai_magics, except the Provider cannot take parameters in their
constructor.
@Carreau Carreau added this to the 8.32 milestone Jan 31, 2025
@Carreau
Copy link
Copy Markdown
Member Author

Carreau commented Jan 31, 2025

I will merge this for now, and backport it as a preview feature on 8.32.

@Carreau Carreau merged commit f5c228a into ipython:main Jan 31, 2025
@lumberbot-app
Copy link
Copy Markdown
Contributor

lumberbot-app bot commented Jan 31, 2025

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout 8.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 f5c228adf158beab0c06899e9a944789a5d41551
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #14623: Multiline suggest in prompt_toolkit and LLM autocompletion'
  1. Push to a named branch:
git push YOURFORK 8.x:auto-backport-of-pr-14623-on-8.x
  1. Create a PR against branch 8.x, I would have named this PR:

"Backport PR #14623 on branch 8.x (Multiline suggest in prompt_toolkit and LLM autocompletion)"

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 Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

@lumberbot-app lumberbot-app bot added the Still Needs Manual Backport Added My MrMeeseeks when a backport fails. Help by backporting it, solving conflicts, send PR. label Jan 31, 2025
Carreau added a commit to Carreau/ipython that referenced this pull request Jan 31, 2025
Carreau added a commit that referenced this pull request Jan 31, 2025
…ompletion (#14705)

see #14623

Minimal conflicts due to type informations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Still Needs Manual Backport Added My MrMeeseeks when a backport fails. Help by backporting it, solving conflicts, send PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant