Skip to content

Commit e0fad72

Browse files
committed
{AKS} Clarify model parameter (cherry-pick PR Azure#9145)
Squashed cherry-pick of PR Azure#9145 commits:\n- clarify model parameter\n- adjust command example to pretty print recommendation\n- fix disallowed html tag in deployment name\n- update examples to use model name as deployment name\n- remove redundant starting space in parameter help\n\nExcluded changes to HISTORY.rst and setup.py as requested.
1 parent 8d28b82 commit e0fad72

2 files changed

Lines changed: 40 additions & 20 deletions

File tree

src/aks-agent/azext_aks_agent/_help.py

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,14 @@
2626
short-summary: Name of the resource group.
2727
- name: --model
2828
type: string
29-
short-summary: Model to use for the LLM.
29+
short-summary: Specify the LLM provider and model or deployment to use for the AI assistant.
30+
long-summary: |-
31+
The --model parameter determines which large language model (LLM) and provider will be used to analyze your cluster.
32+
For OpenAI, use the model name directly (e.g., gpt-4o).
33+
For Azure OpenAI, use `azure/<deployment name>` (e.g., azure/gpt-4.1).
34+
Each provider may require different environment variables and model naming conventions.
35+
For a full list of supported providers, model patterns, and required environment variables, see https://docs.litellm.ai/docs/providers.
36+
Note: For Azure OpenAI, it is recommended to set the deployment name as the model name until https://github.com/BerriAI/litellm/issues/13950 is resolved.
3037
- name: --api-key
3138
type: string
3239
short-summary: API key to use for the LLM (if not given, uses environment variables AZURE_API_KEY, OPENAI_API_KEY).
@@ -61,31 +68,17 @@
6168
export AZURE_API_BASE="https://my-azureopenai-service.openai.azure.com/"
6269
export AZURE_API_VERSION="2025-01-01-preview"
6370
export AZURE_API_KEY="sk-xxx"
64-
az aks agent "Why are my pods not starting?" --name MyManagedCluster --resource-group MyResourceGroup --model azure/my-gpt4.1-deployment
71+
az aks agent "Why are my pods not starting?" --name MyManagedCluster --resource-group MyResourceGroup --model azure/gpt-4.1
6572
- name: Ask about pod issues in the cluster with OpenAI
6673
text: |-
6774
export OPENAI_API_KEY="sk-xxx"
6875
az aks agent "Why are my pods not starting?" --name MyManagedCluster --resource-group MyResourceGroup --model gpt-4o
69-
- name: Run in interactive mode without a question
70-
text: az aks agent "Check the pod status in my cluster" --name MyManagedCluster --resource-group MyResourceGroup --model azure/my-gpt4.1-deployment --api-key "sk-xxx"
71-
- name: Run in non-interactive batch mode
72-
text: az aks agent "Diagnose networking issues" --no-interactive --max-steps 15 --model azure/my-gpt4.1-deployment
73-
- name: Show detailed tool output during analysis
74-
text: az aks agent "Why is my service workload unavailable in namespace workload-ns?" --show-tool-output --model azure/my-gpt4.1-deployment
75-
- name: Use custom configuration file
76-
text: az aks agent "Check kubernetes pod resource usage" --config-file /path/to/custom.yaml --model azure/my-gpt4.1-deployment
77-
- name: Run agent with no echo of the original question
78-
text: az aks agent "What is the status of my cluster?" --no-echo-request --model azure/my-gpt4.1-deployment
79-
- name: Refresh toolsets to get the latest available tools
80-
text: az aks agent "What is the status of my cluster?" --refresh-toolsets --model azure/my-gpt4.1-deployment
81-
- name: Show agent status (MCP readiness)
82-
text: az aks agent --status
8376
- name: Run agent with config file
8477
text: |
85-
az aks agent "Check kubernetes pod resource usage" --config-file /path/to/custom.yaml
78+
az aks agent "Check kubernetes pod resource usage" --config-file /path/to/custom.yaml --name MyManagedCluster --resource-group MyResourceGroup
8679
Here is an example of config file:
8780
```json
88-
model: "gpt-4o"
81+
model: "azure/gpt-4.1"
8982
api_key: "..."
9083
# define a list of mcp servers, mcp server can be defined
9184
mcp_servers:
@@ -111,4 +104,30 @@
111104
aks/core:
112105
enabled: false
113106
```
107+
- name: Run in interactive mode without a question
108+
text: az aks agent "Check the pod status in my cluster" --name MyManagedCluster --resource-group MyResourceGroup --model azure/gpt-4.1 --api-key "sk-xxx"
109+
- name: Run in non-interactive batch mode
110+
text: az aks agent "Diagnose networking issues" --no-interactive --max-steps 15 --model azure/gpt-4.1
111+
- name: Show detailed tool output during analysis
112+
text: az aks agent "Why is my service workload unavailable in namespace workload-ns?" --show-tool-output --model azure/gpt-4.1
113+
- name: Use custom configuration file
114+
text: az aks agent "Check kubernetes pod resource usage" --config-file /path/to/custom.yaml --model azure/gpt-4.1
115+
- name: Run agent with no echo of the original question
116+
text: az aks agent "What is the status of my cluster?" --no-echo-request --model azure/gpt-4.1
117+
- name: Refresh toolsets to get the latest available tools
118+
text: az aks agent "What is the status of my cluster?" --refresh-toolsets --model azure/gpt-4.1
119+
- name: Show agent status (MCP readiness)
120+
text: az aks agent --status
121+
- name: Run in interactive mode without a question
122+
text: az aks agent "Check the pod status in my cluster" --name MyManagedCluster --resource-group MyResourceGroup --model azure/my-gpt4.1-deployment --api-key "sk-xxx"
123+
- name: Run in non-interactive batch mode
124+
text: az aks agent "Diagnose networking issues" --no-interactive --max-steps 15 --model azure/my-gpt4.1-deployment
125+
- name: Show detailed tool output during analysis
126+
text: az aks agent "Why is my service workload unavailable in namespace workload-ns?" --show-tool-output --model azure/my-gpt4.1-deployment
127+
- name: Use custom configuration file
128+
text: az aks agent "Check kubernetes pod resource usage" --config-file /path/to/custom.yaml --model azure/my-gpt4.1-deployment
129+
- name: Run agent with no echo of the original question
130+
text: az aks agent "What is the status of my cluster?" --no-echo-request --model azure/my-gpt4.1-deployment
131+
- name: Refresh toolsets to get the latest available tools
132+
text: az aks agent "What is the status of my cluster?" --refresh-toolsets --model azure/my-gpt4.1-deployment
114133
"""

src/aks-agent/azext_aks_agent/_params.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def load_arguments(self, _):
1919
"prompt",
2020
nargs='?',
2121
help="Ask any question and answer using available tools.",
22+
required=False,
2223
)
2324
c.argument(
2425
"resource_group_name",
@@ -48,12 +49,12 @@ def load_arguments(self, _):
4849
)
4950
c.argument(
5051
"model",
51-
help="The model to use for the LLM.",
52+
help=" Specify the LLM provider and model or deployment to use for the AI assistant.",
5253
required=False,
5354
type=str,
5455
)
5556
c.argument(
56-
"api-key",
57+
"api_key",
5758
help="API key to use for the LLM (if not given, uses environment variables AZURE_API_KEY, OPENAI_API_KEY)",
5859
required=False,
5960
type=str,

0 commit comments

Comments
 (0)