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

AI (GPT/Copilot) integration #358

Open
pt12lol opened this issue Sep 1, 2023 · 1 comment
Open

AI (GPT/Copilot) integration #358

pt12lol opened this issue Sep 1, 2023 · 1 comment
Labels
NYI/NewFeat Not yet implemented or New Feature

Comments

@pt12lol
Copy link

pt12lol commented Sep 1, 2023

I would love to have prompts from AI as I have using Copilot - start typing, and you get prompt from some sort of AI guessing what you would like to type then.

For more context, ble could provide model with:

  1. result of ls in the current directory
  2. recent n commands in the session
  3. content of readme file
@akinomyoga
Copy link
Owner

Thank you for the suggestion. Though I don't think we should do that by default in ble.sh, it would be interesting to have an external plugin that enables it.

You can define a custom source for auto-complete by defining a function named ble/complete/auto-complete/source:NAME (where NAME should be replaced by a unique name such as pt12lol/AI). The custom source function is supposed to call an internal function ble/complete/auto-complete/enter with appropriate arguments. The usage of ble/complete/auto-complete/enter is found in the doc comment in the source. Although it is written in Japanese text, you should be able to translate it using AI. For details, you can reference existing implementations of the auto-complete sources at

Once you create the auto-complete source, you can register the source by adding the source name to the array _ble_complete_auto_source. For example,

# Append the source (this source will be attempted after the other sources)
ble/array#push _ble_complete_auto_source NAME

# Prepend the source (this source will be attempted earlier than the other sources)
ble/array#unshift _ble_complete_auto_source NAME

@akinomyoga akinomyoga added the NYI/NewFeat Not yet implemented or New Feature label Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NYI/NewFeat Not yet implemented or New Feature
Projects
None yet
Development

No branches or pull requests

2 participants