feat: add tab-completion for magic commands using readline and added working groq model#1746
Open
DevaRajan8 wants to merge 3 commits intoopeninterpreter:mainfrom
Open
feat: add tab-completion for magic commands using readline and added working groq model#1746DevaRajan8 wants to merge 3 commits intoopeninterpreter:mainfrom
DevaRajan8 wants to merge 3 commits intoopeninterpreter:mainfrom
Conversation
…ndling Co-authored-by: Copilot <copilot@github.com>
…nt working model in groq)
Contributor
|
Probably should split this into two PRs since readline and groq are completely unrelated issues |
Author
ok , will do that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1697
Problem
Open Interpreter has 12+ magic commands (
%help,%reset,%verbose,etc.) but users must remember exact spellings with no discoverability.
Although
readlinewas already imported for up-arrow history,tab-completion was never wired up for magic commands.
Solution
Added a
MagicCommandCompleterclass and registered it with readline:%+ Tab shows all available magic commands%re+ Tab completes to%reset%input is unaffected (no completion)other libraries (e.g. litellm) from resetting it
Changes
Only one file changed:
interpreter/terminal_interface/terminal_interface.pyMagicCommandCompleterclass at the top of the fileinput()call to ensureit is never overridden by imported dependencies
Code Added
Demo
Testing
Tested on Python 3.13.3, Ubuntu Linux, open-interpreter 0.4.3:
%+ Tab → shows all 12 magic commands%re+ Tab → completes to%reset%sa+ Tab → completes to%save_message%infoentered directly → works as beforeGroq Model Update:
now uses llama-3.3-70b-versatile
Model loads without decommission errors
Basic functionality verified