-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Core] Add the suggestion to fix an error from a command by using LLM #27801
[Core] Add the suggestion to fix an error from a command by using LLM #27801
Conversation
Hi @kceiw, |
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
Core |
…nse from OpenAI. Need to engineer prompt better and fix formatting.
- The library knack's code is modified to pass the arguments to the function handle_exception. That's not correct. Revert that change. And we find a different way of getting the full command line when we handle the exception.
- This is needed when the function is called directly in the user code e.g. interative extension. - This is not used when the called is routed through knack.
@jiasli, @zhoxing-ms, @ReaNAiveD |
- We get the argument and its value by parsing the shell command that handles special characters in the argument value. We should also join the argument in the shell way that handles special characters.
_DEEPPROMPT_ENDPOINT = "<url>" | ||
_DEEPPROMPT_APP = "<appid>" | ||
_AAD_TENANT = "<tenant>" | ||
_SCOPES = [f"{_DEEPPROMPT_APP}/.default"] | ||
_TIMEOUT = 180 |
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.
As far as I know, Azure CLI previously requested another Aladdin service endpoint https://app.aladdin.microsoft.com/api/v1.0/suggestions. May I ask if Azure CLI can request a unified Aladdin endpoint , while the internal logic of the Aladdin service handles different situations? Perhaps this can reduce duplicate code and maintenance costs?
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Related command
This change is applied to the core of the azure cli, when a command runs into an error.
Description
When users run a command, they may run into various errors from syntax error to the error from Azure service. It may take some time research on those errors. Especially for the beginners, it may be more difficult for them to get the information to fix the error. In this PR, we're using the LLM to help with getting the fix to the error. We need to get the whole command line and the errors, then send it to the service, and then get the response and show that on the terminal.
Two separate configurations are used to control whether to enable the feature for interactive mode and the default CLI. These configurations can be set as follows:
Testing Guide
Start the interactive mode and then run some commands.
We need the change in the interactive mode code base to use this feature. The change in interactive mode is in this pull request Azure/azure-cli-extensions#6966
History Notes
[Component Name 1] BREAKING CHANGE:
az command a
: Make some customer-facing breaking change[Component Name 2]
az command b
: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.