-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add az aks ai command #6629
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
Add az aks ai command #6629
Conversation
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| aks copilot | cmd aks copilot added |
|
Hi @sulixu, |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
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, cli command does not accept positional arguments. May be set an option for this?
src/aks-preview/setup.py
Outdated
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.
Better pin the dependency to a fixed version
749599e to
619aa54
Compare
FumingZhang
left a comment
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.
LGTM
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.
Can you leave a note (or a link) about where/how to acquire these keys in the command help message?
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.
Maybe "copilot" is better than "ai"?
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.
| long-summary: This command initiates a chat assistant with expertise in Azure Kubernetes Service, offering guidance on troubleshooting issues using az commands. | |
| long-summary: |- | |
| This command initiates a chat assistant with expertise in Azure Kubernetes Service, offering guidance on troubleshooting issues using az commands. |
Maybe we could use |- to preserves the newlines in long-summary?
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.
How about naming it as aks assistant or aks copilot?
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.
Using general name instead of professional terminology may be more user-friendly, especially for some customers who may not be familiar with ChatGPT related fields
| c.argument('prompt', options_list=['--prompt', '-p'], validator=validate_prompt_input, | |
| help='The question you want to ask, e.g: How to create a AKS cluster') | |
| c.argument('question', options_list=['--question', '-q'], validator=validate_prompt_input, | |
| help='The question you want to ask, e.g: How to create a AKS cluster') |
src/aks-preview/setup.py
Outdated
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.
Please note that the colorama is already defined in core CLI code link , so there is no need for duplicate definitions to avoid dependency conflicts in the future
f9f5591 to
754331d
Compare
…vice expert Summary of changes in each file: - `_help.py`: Added help text for the new `aks ai` command. - `_openai_wrapper.py`: Added a new file that contains the implementation of the OpenAI chat assistant. - `commands.py`: Added the `aks ai` command to the command table. - `custom.py`: Added the `start_chat` function that launches the OpenAI interactive shell. - `tests/latest/test_aks_commands.py`: Added tests for the `aks ai` command. - `setup.py`: Updated the version number and dependencies
Summary of changes in each file: - `_help.py`: Renamed the command 'aks ai' to 'aks copilot' in the help text. - `_params.py`: Renamed the command 'aks ai' to 'aks copilot' in the argument context. - `commands.py`: Renamed the command 'aks ai' to 'aks copilot' in the command group. - `test_aks_commands.py`: Updated the test case to use the new command 'aks copilot' instead of 'aks ai'.
e56bb8d to
71b95d6
Compare
|
Please take a look at this comment #6629 (comment) You need to add the description of PR change into the |
| # Handle user input | ||
| user_input = getch() | ||
| if user_input in ('p', 'P'): | ||
| scripts, messages = prompt_chat_gpt(messages, params, insist=False, scripts=scripts) |
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.
Could you please help explain the purpose of passing insist=False for prompt_char_gpt?
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.
at the very beginning of the session, we need to start with a user mission/task
"Prompt: I need to create a aks cluster"
If user just press enter without entering anything, we have so objective, so insist is default to True to prompt the user until they supply to task to work with
for example, user might hit enter by mistake multiple times until typed "Create a AKS cluster", so I only show "Prompt:"

Once that is started, user can always re-prompt the LLM to refine their objectives or add more requirements by re-prompting. But they would trigger that by mistake or they change their mind, so insist=False allow the user to not enter anything (= cancel out of the prompt)
from 0.5.155 to 0.5.156
|
[Release] Update index.json for extension [ aks-preview ] : https://dev.azure.com/azclitools/internal/_build/results?buildId=88397&view=results |
The
az aks aicommand initiates a chat with an Azure Kubernetes Service AI Expert, providing scripts for az commands along with instructions ('re-prompt', 'run', 'quit') for interactive use.Summary of changes in each file:
_help.py: Added help text for the newaks aicommand._openai_wrapper.py: Added a new file that contains the implementation of the OpenAI chat assistant.commands.py: Added theaks aicommand to the command table.custom.py: Added thestart_chatfunction that launches the OpenAI interactive shell.tests/latest/test_aks_commands.py: Added tests for theaks aicommand.setup.py: Updated the version number and dependenciesThis checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az extension update --name aks-preview
az aks copilot
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally?For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.