Skip to content

Commit a79c7b8

Browse files
author
Shichao Qiu
committed
Merge remote-tracking branch 'remotes/origin/main' into shiqiu/supportShell1031
2 parents e137422 + 8774f74 commit a79c7b8

File tree

338 files changed

+8425
-6776
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

338 files changed

+8425
-6776
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@
240240

241241
/src/quota/ @kairu-ms @ZengTaoxu
242242

243-
/src/containerapp/ @ruslany @sanchitmehta @ebencarek @JennyLawrance @howang-ms @vinisoto @chinadragon0515 @vturecek @torosent @pagariyaalok @Juliehzl @jijohn14
243+
/src/containerapp/ @ruslany @sanchitmehta @ebencarek @JennyLawrance @howang-ms @vinisoto @chinadragon0515 @vturecek @torosent @pagariyaalok @Juliehzl @jijohn14 @Greedygre @ShichaoQiu @bowen5
244244

245245
/src/scvmm/ @nascarsayan @hsurana06
246246

src/aks-agent/HISTORY.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ To release a new version, please select a new version number (usually plus 1 to
1111

1212
Pending
1313
+++++++
14+
15+
1.0.0b8
16+
+++++++
17+
* Error handling: dont raise traceback for init prompt and holmesgpt interaction.
18+
* Improve aks agent-init user experience
19+
* Improve the user holmesgpt interaction error handling
1420
* Fix stdin reading hang in CI/CD pipelines by using select with timeout for non-interactive mode.
1521
* Update pytest marker registration and fix datetime.utcnow() deprecation warning in tests.
1622
* Improve test framework with real-time stderr output visibility and subprocess timeout.

src/aks-agent/README.rst

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,98 @@ For more details about supported model providers and required
3737
variables, see: https://docs.litellm.ai/docs/providers
3838

3939

40+
LLM Configuration Explained
41+
---------------------------
42+
43+
The AKS Agent uses YAML configuration files to define LLM connections. Each configuration contains a provider specification and the required environment variables for that provider.
44+
45+
Configuration Structure
46+
^^^^^^^^^^^^^^^^^^^^^^^^
47+
48+
.. code-block:: yaml
49+
50+
llms:
51+
- provider: azure
52+
MODEL_NAME: gpt-4.1
53+
AZURE_API_KEY: *******
54+
AZURE_API_BASE: https://{azure-openai-service}.openai.azure.com/
55+
AZURE_API_VERSION: 2025-04-01-preview
56+
57+
Field Explanations
58+
^^^^^^^^^^^^^^^^^^
59+
60+
**provider**
61+
The LiteLLM provider route that determines which LLM service to use. This follows the LiteLLM provider specification from https://docs.litellm.ai/docs/providers.
62+
63+
Common values:
64+
65+
* ``azure`` - Azure OpenAI Service
66+
* ``openai`` - OpenAI API and OpenAI-compatible APIs (e.g., local models, other services)
67+
* ``anthropic`` - Anthropic Claude
68+
* ``gemini`` - Google's Gemini
69+
* ``openai_compatible`` - OpenAI-compatible APIs (e.g., local models, other services)
70+
71+
**MODEL_NAME**
72+
The specific model or deployment name to use. This varies by provider:
73+
74+
* For Azure OpenAI: Your deployment name (e.g., ``gpt-4.1``, ``gpt-35-turbo``)
75+
* For OpenAI: Model name (e.g., ``gpt-4``, ``gpt-3.5-turbo``)
76+
* For other providers: Check the specific model names in LiteLLM documentation
77+
78+
**Environment Variables by Provider**
79+
80+
The remaining fields are environment variables required by each provider. These correspond to the authentication and configuration requirements of each LLM service:
81+
82+
**Azure OpenAI (provider: azure)**
83+
* ``AZURE_API_KEY`` - Your Azure OpenAI API key
84+
* ``AZURE_API_BASE`` - Your Azure OpenAI endpoint URL (e.g., https://your-resource.openai.azure.com/)
85+
* ``AZURE_API_VERSION`` - API version (e.g., 2024-02-01, 2025-04-01-preview)
86+
87+
**OpenAI (provider: openai)**
88+
* ``OPENAI_API_KEY`` - Your OpenAI API key (starts with sk-)
89+
90+
**Gemini (provider: gemini)**
91+
* ``GOOGLE_API_KEY`` - Your Google Cloud API key
92+
* ``GOOGLE_API_ENDPOINT`` - Base URL for the Gemini API endpoint
93+
94+
**Anthropic (provider: anthropic)**
95+
* ``ANTHROPIC_API_KEY`` - Your Anthropic API key
96+
97+
**OpenAI Compatible (provider: openai_compatible)**
98+
* ``OPENAI_API_BASE`` - Base URL for the API endpoint
99+
* ``OPENAI_API_KEY`` - API key (if required by the service)
100+
101+
Multiple Model Configuration
102+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
103+
104+
You can configure multiple models in a single file:
105+
106+
.. code-block:: yaml
107+
108+
llms:
109+
- provider: azure
110+
MODEL_NAME: gpt-4
111+
AZURE_API_KEY: your-azure-key
112+
AZURE_API_BASE: https://your-azure-endpoint.openai.azure.com/
113+
AZURE_API_VERSION: 2024-02-01
114+
- provider: openai
115+
MODEL_NAME: gpt-4
116+
OPENAI_API_KEY: your-openai-key
117+
- provider: anthropic
118+
MODEL_NAME: claude-3-sonnet-20240229
119+
ANTHROPIC_API_KEY: your-anthropic-key
120+
121+
When using ``--model``, specify the provider and model as ``provider/model_name`` (e.g., ``azure/gpt-4``, ``openai/gpt-4``).
122+
123+
Security Note
124+
^^^^^^^^^^^^^
125+
126+
API keys and credentials in configuration files should be kept secure. Consider using:
127+
128+
* Restricted file permissions (``chmod 600 config.yaml``)
129+
* Environment variable substitution where supported
130+
* Separate configuration files for different environments (dev/prod)
131+
40132
Quick start and examples
41133
=========================
42134

src/aks-agent/azext_aks_agent/__init__.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,20 @@
44
# --------------------------------------------------------------------------------------------
55

66

7-
from azure.cli.core import AzCommandsLoader
7+
import os
88

99
# pylint: disable=unused-import
1010
import azext_aks_agent._help
11+
from azext_aks_agent._consts import (
12+
CONST_AGENT_CONFIG_PATH_DIR_ENV_KEY,
13+
CONST_AGENT_NAME,
14+
CONST_AGENT_NAME_ENV_KEY,
15+
CONST_DISABLE_PROMETHEUS_TOOLSET_ENV_KEY,
16+
CONST_PRIVACY_NOTICE_BANNER,
17+
CONST_PRIVACY_NOTICE_BANNER_ENV_KEY,
18+
)
19+
from azure.cli.core import AzCommandsLoader
20+
from azure.cli.core.api import get_config_dir
1121

1222

1323
class ContainerServiceCommandsLoader(AzCommandsLoader):
@@ -34,3 +44,14 @@ def load_arguments(self, command):
3444

3545

3646
COMMAND_LOADER_CLS = ContainerServiceCommandsLoader
47+
48+
49+
# NOTE(mainred): holmesgpt leverages the environment variables to customize its behavior.
50+
def customize_holmesgpt():
51+
os.environ[CONST_DISABLE_PROMETHEUS_TOOLSET_ENV_KEY] = "true"
52+
os.environ[CONST_AGENT_CONFIG_PATH_DIR_ENV_KEY] = get_config_dir()
53+
os.environ[CONST_AGENT_NAME_ENV_KEY] = CONST_AGENT_NAME
54+
os.environ[CONST_PRIVACY_NOTICE_BANNER_ENV_KEY] = CONST_PRIVACY_NOTICE_BANNER
55+
56+
57+
customize_holmesgpt()

src/aks-agent/azext_aks_agent/_help.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
from knack.help_files import helps
1010

11-
1211
helps[
1312
"aks agent"
1413
] = """
@@ -78,10 +77,11 @@
7877
Here is an example of config file:
7978
```json
8079
llms:
81-
- provider: "azure"
82-
MODEL_NAME: "gpt-4.1"
83-
AZURE_API_BASE: "https://<your-base-url>"
84-
AZURE_API_KEY: "<your-api-key>"
80+
- provider: azure
81+
MODEL_NAME: gpt-4.1
82+
AZURE_API_KEY: *******
83+
AZURE_API_BASE: https://{azure-openai-service-name}.openai.azure.com/
84+
AZURE_API_VERSION: 2025-04-01-preview
8585
# define a list of mcp servers, mcp server can be defined
8686
mcp_servers:
8787
aks_mcp:

0 commit comments

Comments
 (0)