@inkeep/create-agents 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.
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +96 -2
- package/package.json +2 -2
package/dist/utils.d.ts
CHANGED
package/dist/utils.js
CHANGED
|
@@ -68,7 +68,7 @@ export const defaultAnthropicModelConfigurations = {
|
|
|
68
68
|
},
|
|
69
69
|
};
|
|
70
70
|
export const createAgents = async (args = {}) => {
|
|
71
|
-
let { dirName, openAiKey, anthropicKey, googleKey, template, customProjectId, disableGit, localAgentsPrefix, localTemplatesPrefix, skipInkeepCli, skipInkeepMcp, } = args;
|
|
71
|
+
let { dirName, openAiKey, anthropicKey, googleKey, azureKey, template, customProjectId, disableGit, localAgentsPrefix, localTemplatesPrefix, skipInkeepCli, skipInkeepMcp, } = args;
|
|
72
72
|
const tenantId = 'default';
|
|
73
73
|
let projectId;
|
|
74
74
|
let templateName;
|
|
@@ -112,13 +112,14 @@ export const createAgents = async (args = {}) => {
|
|
|
112
112
|
throw new Error(validationError);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
if (!anthropicKey && !openAiKey && !googleKey) {
|
|
115
|
+
if (!anthropicKey && !openAiKey && !googleKey && !azureKey) {
|
|
116
116
|
const providerChoice = await p.select({
|
|
117
117
|
message: 'Which AI provider would you like to use?',
|
|
118
118
|
options: [
|
|
119
119
|
{ value: 'anthropic', label: 'Anthropic' },
|
|
120
120
|
{ value: 'openai', label: 'OpenAI' },
|
|
121
121
|
{ value: 'google', label: 'Google' },
|
|
122
|
+
{ value: 'azure', label: 'Azure' },
|
|
122
123
|
],
|
|
123
124
|
});
|
|
124
125
|
if (p.isCancel(providerChoice)) {
|
|
@@ -173,6 +174,22 @@ export const createAgents = async (args = {}) => {
|
|
|
173
174
|
}
|
|
174
175
|
googleKey = googleKeyResponse;
|
|
175
176
|
}
|
|
177
|
+
else if (providerChoice === 'azure') {
|
|
178
|
+
const azureKeyResponse = await p.password({
|
|
179
|
+
message: 'Enter your Azure API key:',
|
|
180
|
+
validate: (value) => {
|
|
181
|
+
if (!value || value.trim() === '') {
|
|
182
|
+
return 'Azure API key is required';
|
|
183
|
+
}
|
|
184
|
+
return undefined;
|
|
185
|
+
},
|
|
186
|
+
});
|
|
187
|
+
if (p.isCancel(azureKeyResponse)) {
|
|
188
|
+
p.cancel('Operation cancelled');
|
|
189
|
+
process.exit(0);
|
|
190
|
+
}
|
|
191
|
+
azureKey = azureKeyResponse;
|
|
192
|
+
}
|
|
176
193
|
}
|
|
177
194
|
let defaultModelSettings = {};
|
|
178
195
|
if (anthropicKey) {
|
|
@@ -184,6 +201,81 @@ export const createAgents = async (args = {}) => {
|
|
|
184
201
|
else if (googleKey) {
|
|
185
202
|
defaultModelSettings = defaultGoogleModelConfigurations;
|
|
186
203
|
}
|
|
204
|
+
else if (azureKey) {
|
|
205
|
+
// Azure requires custom configuration - prompt for deployment details
|
|
206
|
+
p.note('Azure OpenAI requires custom deployment configuration.');
|
|
207
|
+
const deploymentName = await p.text({
|
|
208
|
+
message: 'Enter your Azure deployment name:',
|
|
209
|
+
placeholder: 'my-gpt-4o-deployment',
|
|
210
|
+
validate: (value) => {
|
|
211
|
+
if (!value?.trim())
|
|
212
|
+
return 'Deployment name is required';
|
|
213
|
+
},
|
|
214
|
+
});
|
|
215
|
+
if (p.isCancel(deploymentName)) {
|
|
216
|
+
p.cancel('Operation cancelled');
|
|
217
|
+
process.exit(0);
|
|
218
|
+
}
|
|
219
|
+
const connectionMethod = await p.select({
|
|
220
|
+
message: 'How would you like to connect to Azure?',
|
|
221
|
+
options: [
|
|
222
|
+
{ value: 'resource', label: 'Azure Resource Name (recommended)' },
|
|
223
|
+
{ value: 'url', label: 'Custom Base URL' },
|
|
224
|
+
],
|
|
225
|
+
});
|
|
226
|
+
if (p.isCancel(connectionMethod)) {
|
|
227
|
+
p.cancel('Operation cancelled');
|
|
228
|
+
process.exit(0);
|
|
229
|
+
}
|
|
230
|
+
const azureProviderOptions = {};
|
|
231
|
+
if (connectionMethod === 'resource') {
|
|
232
|
+
const resourceName = await p.text({
|
|
233
|
+
message: 'Enter your Azure resource name:',
|
|
234
|
+
placeholder: 'your-azure-resource',
|
|
235
|
+
validate: (value) => {
|
|
236
|
+
if (!value?.trim())
|
|
237
|
+
return 'Resource name is required';
|
|
238
|
+
},
|
|
239
|
+
});
|
|
240
|
+
if (p.isCancel(resourceName)) {
|
|
241
|
+
p.cancel('Operation cancelled');
|
|
242
|
+
process.exit(0);
|
|
243
|
+
}
|
|
244
|
+
azureProviderOptions.resourceName = resourceName;
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
const baseURL = await p.text({
|
|
248
|
+
message: 'Enter your Azure base URL:',
|
|
249
|
+
placeholder: 'https://your-endpoint.openai.azure.com/openai',
|
|
250
|
+
validate: (value) => {
|
|
251
|
+
if (!value?.trim())
|
|
252
|
+
return 'Base URL is required';
|
|
253
|
+
if (!value.startsWith('https://'))
|
|
254
|
+
return 'Base URL must start with https://';
|
|
255
|
+
},
|
|
256
|
+
});
|
|
257
|
+
if (p.isCancel(baseURL)) {
|
|
258
|
+
p.cancel('Operation cancelled');
|
|
259
|
+
process.exit(0);
|
|
260
|
+
}
|
|
261
|
+
azureProviderOptions.baseURL = baseURL;
|
|
262
|
+
}
|
|
263
|
+
// Create Azure model configuration with user's deployment
|
|
264
|
+
defaultModelSettings = {
|
|
265
|
+
base: {
|
|
266
|
+
model: `azure/${deploymentName}`,
|
|
267
|
+
providerOptions: azureProviderOptions,
|
|
268
|
+
},
|
|
269
|
+
structuredOutput: {
|
|
270
|
+
model: `azure/${deploymentName}`,
|
|
271
|
+
providerOptions: azureProviderOptions,
|
|
272
|
+
},
|
|
273
|
+
summarizer: {
|
|
274
|
+
model: `azure/${deploymentName}`,
|
|
275
|
+
providerOptions: azureProviderOptions,
|
|
276
|
+
},
|
|
277
|
+
};
|
|
278
|
+
}
|
|
187
279
|
if (Object.keys(defaultModelSettings).length === 0) {
|
|
188
280
|
p.cancel('Cannot continue without a model configuration for project. Please provide an API key for at least one AI provider.');
|
|
189
281
|
process.exit(1);
|
|
@@ -217,6 +309,7 @@ export const createAgents = async (args = {}) => {
|
|
|
217
309
|
openAiKey,
|
|
218
310
|
anthropicKey,
|
|
219
311
|
googleKey,
|
|
312
|
+
azureKey,
|
|
220
313
|
modelSettings: defaultModelSettings,
|
|
221
314
|
customProject: !!customProjectId,
|
|
222
315
|
disableGit: disableGit,
|
|
@@ -338,6 +431,7 @@ DATABASE_URL=postgresql://appuser:password@localhost:5432/inkeep_agents
|
|
|
338
431
|
ANTHROPIC_API_KEY=${config.anthropicKey || 'your-anthropic-key-here'}
|
|
339
432
|
OPENAI_API_KEY=${config.openAiKey || 'your-openai-key-here'}
|
|
340
433
|
GOOGLE_GENERATIVE_AI_API_KEY=${config.googleKey || 'your-google-key-here'}
|
|
434
|
+
AZURE_API_KEY=${config.azureKey || 'your-azure-key-here'}
|
|
341
435
|
|
|
342
436
|
# Inkeep API URLs
|
|
343
437
|
# Internal URLs (server-side, Docker internal networking)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/create-agents",
|
|
3
|
-
"version": "0.41.
|
|
3
|
+
"version": "0.41.1",
|
|
4
4
|
"description": "Create an Inkeep Agent Framework project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"degit": "^2.8.4",
|
|
34
34
|
"fs-extra": "^11.0.0",
|
|
35
35
|
"picocolors": "^1.0.0",
|
|
36
|
-
"@inkeep/agents-core": "0.41.
|
|
36
|
+
"@inkeep/agents-core": "0.41.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/degit": "^2.8.6",
|