Commit 6da271a
authored
fix(cli): recognize all providers in install and improve missing key error (#1716)
Closes #1622.
`GetModelProvider` was missing Gemini, GeminiVertexAI, AnthropicVertexAI
and Bedrock from its switch. Any of those values in
`KAGENT_DEFAULT_MODEL_PROVIDER` fell through to the default and came
back as OpenAI, which then required `OPENAI_API_KEY` even though the
user had no intention of using OpenAI.
`GetProviderAPIKey` now also covers Gemini (`GOOGLE_API_KEY`). Providers
that rely on cloud credentials rather than an API key (Ollama, Bedrock,
VertexAI variants) already returned empty string and are left as is.
The error message now mentions `KAGENT_DEFAULT_MODEL_PROVIDER` so users
know they can switch providers instead of being stuck.
Signed-off-by: mesutoezdil <mesudozdil@gmail.com>1 parent ce59f67 commit 6da271a
2 files changed
Lines changed: 22 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
31 | 39 | | |
32 | 40 | | |
33 | 41 | | |
| |||
42 | 50 | | |
43 | 51 | | |
44 | 52 | | |
45 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
46 | 56 | | |
47 | 57 | | |
48 | 58 | | |
| |||
51 | 61 | | |
52 | 62 | | |
53 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
54 | 71 | | |
| 72 | + | |
| 73 | + | |
55 | 74 | | |
56 | 75 | | |
57 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| |||
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
| 131 | + | |
130 | 132 | | |
131 | 133 | | |
132 | 134 | | |
| |||
0 commit comments