@inkeep/agents-cli 0.41.0 → 0.41.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -21,6 +21,11 @@ const PROVIDER_CONFIGS = [
|
|
|
21
21
|
name: "google",
|
|
22
22
|
envVars: ["GOOGLE_GENERATIVE_AI_API_KEY"],
|
|
23
23
|
model: "gemini-2.5-flash"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "azure",
|
|
27
|
+
envVars: ["AZURE_API_KEY"],
|
|
28
|
+
model: ""
|
|
24
29
|
}
|
|
25
30
|
];
|
|
26
31
|
/**
|
|
@@ -35,9 +40,10 @@ function getAvailableModel() {
|
|
|
35
40
|
case "anthropic": return anthropic(config.model);
|
|
36
41
|
case "openai": return openai(config.model);
|
|
37
42
|
case "google": return google(config.model);
|
|
43
|
+
case "azure": continue;
|
|
38
44
|
default: throw new Error(`Unknown provider: ${config.name}`);
|
|
39
45
|
}
|
|
40
|
-
throw new Error("No API keys detected. Please set ANTHROPIC_API_KEY, OPENAI_API_KEY, or
|
|
46
|
+
throw new Error("No API keys detected. Please set ANTHROPIC_API_KEY, OPENAI_API_KEY, GOOGLE_GENERATIVE_AI_API_KEY, or AZURE_API_KEY");
|
|
41
47
|
}
|
|
42
48
|
|
|
43
49
|
//#endregion
|
|
@@ -36,6 +36,10 @@ async function promptForModelConfiguration() {
|
|
|
36
36
|
{
|
|
37
37
|
value: "google",
|
|
38
38
|
label: "Google (Gemini)"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
value: "azure",
|
|
42
|
+
label: "Azure OpenAI"
|
|
39
43
|
}
|
|
40
44
|
],
|
|
41
45
|
required: true
|
|
@@ -126,10 +130,73 @@ async function promptForModelConfiguration() {
|
|
|
126
130
|
value: GOOGLE_MODELS.GEMINI_2_5_FLASH_LITE
|
|
127
131
|
}
|
|
128
132
|
];
|
|
133
|
+
const azureConfigs = {};
|
|
134
|
+
if (providers.includes("azure")) {
|
|
135
|
+
p.note("Azure OpenAI requires custom deployment configuration.");
|
|
136
|
+
const deploymentName = await p.text({
|
|
137
|
+
message: "Enter your Azure deployment name:",
|
|
138
|
+
placeholder: "my-gpt-4o-deployment",
|
|
139
|
+
validate: (value) => {
|
|
140
|
+
if (!value?.trim()) return "Deployment name is required";
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
if (p.isCancel(deploymentName)) {
|
|
144
|
+
p.cancel("Operation cancelled");
|
|
145
|
+
process.exit(0);
|
|
146
|
+
}
|
|
147
|
+
const connectionMethod = await p.select({
|
|
148
|
+
message: "How would you like to connect to Azure?",
|
|
149
|
+
options: [{
|
|
150
|
+
value: "resource",
|
|
151
|
+
label: "Azure Resource Name (recommended)"
|
|
152
|
+
}, {
|
|
153
|
+
value: "url",
|
|
154
|
+
label: "Custom Base URL"
|
|
155
|
+
}]
|
|
156
|
+
});
|
|
157
|
+
if (p.isCancel(connectionMethod)) {
|
|
158
|
+
p.cancel("Operation cancelled");
|
|
159
|
+
process.exit(0);
|
|
160
|
+
}
|
|
161
|
+
if (connectionMethod === "resource") {
|
|
162
|
+
const resourceName = await p.text({
|
|
163
|
+
message: "Enter your Azure resource name:",
|
|
164
|
+
placeholder: "your-azure-resource",
|
|
165
|
+
validate: (value) => {
|
|
166
|
+
if (!value?.trim()) return "Resource name is required";
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
if (p.isCancel(resourceName)) {
|
|
170
|
+
p.cancel("Operation cancelled");
|
|
171
|
+
process.exit(0);
|
|
172
|
+
}
|
|
173
|
+
azureConfigs.resourceName = resourceName;
|
|
174
|
+
} else {
|
|
175
|
+
const baseURL = await p.text({
|
|
176
|
+
message: "Enter your Azure base URL:",
|
|
177
|
+
placeholder: "https://your-endpoint.openai.azure.com/openai",
|
|
178
|
+
validate: (value) => {
|
|
179
|
+
if (!value?.trim()) return "Base URL is required";
|
|
180
|
+
if (!value.startsWith("https://")) return "Base URL must start with https://";
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
if (p.isCancel(baseURL)) {
|
|
184
|
+
p.cancel("Operation cancelled");
|
|
185
|
+
process.exit(0);
|
|
186
|
+
}
|
|
187
|
+
azureConfigs.baseURL = baseURL;
|
|
188
|
+
}
|
|
189
|
+
azureConfigs.deploymentName = deploymentName;
|
|
190
|
+
azureConfigs.model = `azure/${deploymentName}`;
|
|
191
|
+
}
|
|
129
192
|
const availableModels = [];
|
|
130
193
|
if (providers.includes("anthropic")) availableModels.push(...anthropicModels);
|
|
131
194
|
if (providers.includes("openai")) availableModels.push(...openaiModels);
|
|
132
195
|
if (providers.includes("google")) availableModels.push(...googleModels);
|
|
196
|
+
if (providers.includes("azure") && azureConfigs.model) availableModels.push({
|
|
197
|
+
label: `${azureConfigs.deploymentName} (Azure)`,
|
|
198
|
+
value: azureConfigs.model
|
|
199
|
+
});
|
|
133
200
|
const baseModel = await p.select({
|
|
134
201
|
message: "Select your default model for general tasks (required):",
|
|
135
202
|
options: availableModels
|
|
@@ -172,9 +239,27 @@ async function promptForModelConfiguration() {
|
|
|
172
239
|
}
|
|
173
240
|
summarizerModel = summarizerResponse;
|
|
174
241
|
}
|
|
242
|
+
const addProviderOptions = (model) => {
|
|
243
|
+
if (model.startsWith("azure/") && (azureConfigs.resourceName || azureConfigs.baseURL)) {
|
|
244
|
+
const providerOptions = {};
|
|
245
|
+
if (azureConfigs.resourceName) providerOptions.resourceName = azureConfigs.resourceName;
|
|
246
|
+
if (azureConfigs.baseURL) providerOptions.baseURL = azureConfigs.baseURL;
|
|
247
|
+
return providerOptions;
|
|
248
|
+
}
|
|
249
|
+
};
|
|
175
250
|
const modelSettings = { base: { model: baseModel } };
|
|
176
|
-
|
|
177
|
-
if (
|
|
251
|
+
const baseProviderOptions = addProviderOptions(baseModel);
|
|
252
|
+
if (baseProviderOptions) modelSettings.base.providerOptions = baseProviderOptions;
|
|
253
|
+
if (structuredOutputModel) {
|
|
254
|
+
modelSettings.structuredOutput = { model: structuredOutputModel };
|
|
255
|
+
const structuredProviderOptions = addProviderOptions(structuredOutputModel);
|
|
256
|
+
if (structuredProviderOptions) modelSettings.structuredOutput.providerOptions = structuredProviderOptions;
|
|
257
|
+
}
|
|
258
|
+
if (summarizerModel) {
|
|
259
|
+
modelSettings.summarizer = { model: summarizerModel };
|
|
260
|
+
const summarizerProviderOptions = addProviderOptions(summarizerModel);
|
|
261
|
+
if (summarizerProviderOptions) modelSettings.summarizer.providerOptions = summarizerProviderOptions;
|
|
262
|
+
}
|
|
178
263
|
return { modelSettings };
|
|
179
264
|
}
|
|
180
265
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-cli",
|
|
3
|
-
"version": "0.41.
|
|
3
|
+
"version": "0.41.1",
|
|
4
4
|
"description": "Inkeep CLI tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"ts-morph": "^26.0.0",
|
|
41
41
|
"tsx": "^4.20.5",
|
|
42
42
|
"yaml": "^2.7.0",
|
|
43
|
-
"@inkeep/agents-core": "^0.41.
|
|
44
|
-
"@inkeep/agents-sdk": "^0.41.
|
|
43
|
+
"@inkeep/agents-core": "^0.41.1",
|
|
44
|
+
"@inkeep/agents-sdk": "^0.41.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/degit": "^2.8.6",
|