@salesforce/plugin-agent 1.7.2 → 1.7.3-dev.0
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/README.md +9 -9
- package/lib/commands/agent/generate/definition.js +22 -22
- package/lib/commands/agent/generate/definition.js.map +1 -1
- package/lib/commands/agent/generate/spec.js +1 -2
- package/lib/commands/agent/generate/spec.js.map +1 -1
- package/lib/commands/agent/generate/testset.d.ts +3 -1
- package/lib/commands/agent/generate/testset.js +59 -30
- package/lib/commands/agent/generate/testset.js.map +1 -1
- package/lib/read-dir.d.ts +1 -0
- package/lib/read-dir.js +11 -0
- package/lib/read-dir.js.map +1 -0
- package/npm-shrinkwrap.json +493 -229
- package/oclif.lock +160 -36
- package/oclif.manifest.json +1 -1
- package/package.json +4 -6
package/README.md
CHANGED
|
@@ -111,7 +111,7 @@ EXAMPLES
|
|
|
111
111
|
$ sf agent create --name CustomerSupportAgent --spec ./config/agentSpec.json --target-org my-org
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
-
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.
|
|
114
|
+
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.0/src/commands/agent/create.ts)_
|
|
115
115
|
|
|
116
116
|
## `sf agent generate definition`
|
|
117
117
|
|
|
@@ -136,7 +136,7 @@ EXAMPLES
|
|
|
136
136
|
$ sf agent generate definition
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
_See code: [src/commands/agent/generate/definition.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.
|
|
139
|
+
_See code: [src/commands/agent/generate/definition.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.0/src/commands/agent/generate/definition.ts)_
|
|
140
140
|
|
|
141
141
|
## `sf agent generate spec`
|
|
142
142
|
|
|
@@ -197,7 +197,7 @@ EXAMPLES
|
|
|
197
197
|
$ sf agent generate spec --output-dir specs --target-org my-org
|
|
198
198
|
```
|
|
199
199
|
|
|
200
|
-
_See code: [src/commands/agent/generate/spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.
|
|
200
|
+
_See code: [src/commands/agent/generate/spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.0/src/commands/agent/generate/spec.ts)_
|
|
201
201
|
|
|
202
202
|
## `sf agent generate testset`
|
|
203
203
|
|
|
@@ -220,7 +220,7 @@ EXAMPLES
|
|
|
220
220
|
$ sf agent generate testset
|
|
221
221
|
```
|
|
222
222
|
|
|
223
|
-
_See code: [src/commands/agent/generate/testset.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.
|
|
223
|
+
_See code: [src/commands/agent/generate/testset.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.0/src/commands/agent/generate/testset.ts)_
|
|
224
224
|
|
|
225
225
|
## `sf agent preview`
|
|
226
226
|
|
|
@@ -255,7 +255,7 @@ FLAG DESCRIPTIONS
|
|
|
255
255
|
the API name of the agent? (TBD based on agents library)
|
|
256
256
|
```
|
|
257
257
|
|
|
258
|
-
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.
|
|
258
|
+
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.0/src/commands/agent/preview.ts)_
|
|
259
259
|
|
|
260
260
|
## `sf agent test cancel`
|
|
261
261
|
|
|
@@ -292,7 +292,7 @@ EXAMPLES
|
|
|
292
292
|
$ sf agent test cancel --job-id 4KBfake0000003F4AQ --target-org my-org
|
|
293
293
|
```
|
|
294
294
|
|
|
295
|
-
_See code: [src/commands/agent/test/cancel.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.
|
|
295
|
+
_See code: [src/commands/agent/test/cancel.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.0/src/commands/agent/test/cancel.ts)_
|
|
296
296
|
|
|
297
297
|
## `sf agent test results`
|
|
298
298
|
|
|
@@ -348,7 +348,7 @@ FLAG DESCRIPTIONS
|
|
|
348
348
|
test results aren't written.
|
|
349
349
|
```
|
|
350
350
|
|
|
351
|
-
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.
|
|
351
|
+
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.0/src/commands/agent/test/results.ts)_
|
|
352
352
|
|
|
353
353
|
## `sf agent test resume`
|
|
354
354
|
|
|
@@ -411,7 +411,7 @@ FLAG DESCRIPTIONS
|
|
|
411
411
|
test results aren't written.
|
|
412
412
|
```
|
|
413
413
|
|
|
414
|
-
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.
|
|
414
|
+
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.0/src/commands/agent/test/resume.ts)_
|
|
415
415
|
|
|
416
416
|
## `sf agent test run`
|
|
417
417
|
|
|
@@ -474,6 +474,6 @@ FLAG DESCRIPTIONS
|
|
|
474
474
|
test results aren't written.
|
|
475
475
|
```
|
|
476
476
|
|
|
477
|
-
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.
|
|
477
|
+
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.0/src/commands/agent/test/run.ts)_
|
|
478
478
|
|
|
479
479
|
<!-- commandsstop -->
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
6
|
*/
|
|
7
7
|
import { dirname, join } from 'node:path';
|
|
8
|
-
import { mkdir,
|
|
8
|
+
import { mkdir, writeFile } from 'node:fs/promises';
|
|
9
9
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
10
10
|
import { Messages, SfError } from '@salesforce/core';
|
|
11
|
-
import select from '@inquirer/
|
|
12
|
-
import input from '@inquirer/input';
|
|
11
|
+
import { input, select } from '@inquirer/prompts';
|
|
13
12
|
import { theme } from '../../../inquirer-theme.js';
|
|
13
|
+
import { readDir } from '../../../read-dir.js';
|
|
14
14
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
15
15
|
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.generate.definition');
|
|
16
16
|
export default class AgentGenerateDefinition extends SfCommand {
|
|
@@ -21,55 +21,55 @@ export default class AgentGenerateDefinition extends SfCommand {
|
|
|
21
21
|
static state = 'beta';
|
|
22
22
|
async run() {
|
|
23
23
|
const testSetDir = join('force-app', 'main', 'default', 'aiEvaluationTestSets');
|
|
24
|
-
const testSets = (await
|
|
24
|
+
const testSets = (await readDir(testSetDir)).map((testSet) => testSet.replace('.aiEvaluationTestSet-meta.xml', ''));
|
|
25
25
|
if (testSets.length === 0) {
|
|
26
26
|
throw new SfError(`No test sets found in ${testSetDir}`, 'NoTestSetsFoundError', [
|
|
27
27
|
'Run the "sf agent generate testset" command to create a test set',
|
|
28
28
|
]);
|
|
29
29
|
}
|
|
30
30
|
const botsDir = join('force-app', 'main', 'default', 'bots');
|
|
31
|
-
const bots = await
|
|
31
|
+
const bots = await readDir(botsDir);
|
|
32
32
|
if (bots.length === 0) {
|
|
33
|
-
throw new SfError(`No
|
|
33
|
+
throw new SfError(`No agents found in ${botsDir}`, 'NoAgentsFoundError');
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
message: '
|
|
37
|
-
choices:
|
|
35
|
+
const subjectType = await select({
|
|
36
|
+
message: 'What are you testing',
|
|
37
|
+
choices: ['AGENT'],
|
|
38
38
|
theme,
|
|
39
39
|
});
|
|
40
|
-
const
|
|
41
|
-
message: 'Select the
|
|
40
|
+
const agent = await select({
|
|
41
|
+
message: 'Select the Agent to test',
|
|
42
42
|
choices: bots,
|
|
43
43
|
theme,
|
|
44
44
|
});
|
|
45
|
+
const testSet = await select({
|
|
46
|
+
message: 'Select the test set to use',
|
|
47
|
+
choices: testSets,
|
|
48
|
+
theme,
|
|
49
|
+
});
|
|
45
50
|
const name = await input({
|
|
46
|
-
message: 'Enter a name for the
|
|
51
|
+
message: 'Enter a name for the test definition',
|
|
47
52
|
validate: (i) => (i.length > 0 ? true : 'Name cannot be empty'),
|
|
48
53
|
theme,
|
|
49
54
|
});
|
|
50
55
|
const description = await input({
|
|
51
|
-
message: 'Enter a description for
|
|
52
|
-
theme,
|
|
53
|
-
});
|
|
54
|
-
const subjectType = await select({
|
|
55
|
-
message: 'Select the type for the AiEvaluationDefinition',
|
|
56
|
-
choices: ['AGENT'],
|
|
56
|
+
message: 'Enter a description for test definition (optional)',
|
|
57
57
|
theme,
|
|
58
58
|
});
|
|
59
|
-
this.log(`Generating AiEvaluationDefinition for ${bot} using ${testSet} AiEvaluationTestSet`);
|
|
60
59
|
const xml = `<?xml version="1.0" encoding="UTF-8"?>
|
|
61
60
|
<AiEvaluationDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
62
61
|
${description ? `<description>${description}</description>` : ''}
|
|
63
62
|
<name>${name}</name>
|
|
64
63
|
<subjectType>${subjectType}</subjectType>
|
|
65
|
-
<subjectName>${
|
|
64
|
+
<subjectName>${agent}</subjectName>
|
|
66
65
|
<testSetName>${testSet}</testSetName>
|
|
67
66
|
</AiEvaluationDefinition>`;
|
|
68
67
|
// remove all empty lines
|
|
69
68
|
const cleanedXml = xml.replace(/^\s*[\r\n]/gm, '');
|
|
70
|
-
const definitionPath = join('force-app', 'main', 'default', 'aiEvaluationDefinitions', `${name}.xml`);
|
|
69
|
+
const definitionPath = join('force-app', 'main', 'default', 'aiEvaluationDefinitions', `${name}.aiEvaluationDefinition-meta.xml`);
|
|
71
70
|
await mkdir(dirname(definitionPath), { recursive: true });
|
|
72
|
-
this.log(
|
|
71
|
+
this.log();
|
|
72
|
+
this.log(`Created ${definitionPath}`);
|
|
73
73
|
await writeFile(definitionPath, cleanedXml);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/definition.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/definition.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,2BAA2B,CAAC,CAAC;AAEhG,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,SAAe;IAC3D,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC5D,MAAM,CAAU,cAAc,GAAG,KAAK,CAAC;IACvC,MAAM,CAAU,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YAC/C,QAAQ,EAAE,CAAC,CAAS,EAAoB,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,sBAAsB,CAAC;YACzF,KAAK;SACN,CAAC,CAAC;QAEH,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC;YAC9B,OAAO,EAAE,oDAAoD;YAC7D,KAAK;SACN,CAAC,CAAC;QAEH,MAAM,GAAG,GAAG;;MAEV,WAAW,CAAC,CAAC,CAAC,gBAAgB,WAAW,gBAAgB,CAAC,CAAC,CAAC,EAAE;YACxD,IAAI;mBACG,WAAW;mBACX,KAAK;mBACL,OAAO;0BACA,CAAC;QAEvB,yBAAyB;QACzB,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;QAEnD,MAAM,cAAc,GAAG,IAAI,CACzB,WAAW,EACX,MAAM,EACN,SAAS,EACT,yBAAyB,EACzB,GAAG,IAAI,kCAAkC,CAC1C,CAAC;QACF,MAAM,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1D,IAAI,CAAC,GAAG,EAAE,CAAC;QACX,IAAI,CAAC,GAAG,CAAC,WAAW,cAAc,EAAE,CAAC,CAAC;QACtC,MAAM,SAAS,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;IAC9C,CAAC"}
|
|
@@ -9,8 +9,7 @@ import { writeFileSync } from 'node:fs';
|
|
|
9
9
|
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
10
10
|
import { Messages } from '@salesforce/core';
|
|
11
11
|
import ansis from 'ansis';
|
|
12
|
-
import select from '@inquirer/
|
|
13
|
-
import inquirerInput from '@inquirer/input';
|
|
12
|
+
import { select, input as inquirerInput } from '@inquirer/prompts';
|
|
14
13
|
import figures from '@inquirer/figures';
|
|
15
14
|
import { Agent } from '@salesforce/agents';
|
|
16
15
|
import { theme } from '../../../inquirer-theme.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/spec.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAa,MAAM,kBAAkB,CAAC;AAEvD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/spec.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAa,MAAM,kBAAkB,CAAC;AAEvD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,KAAK,EAA8B,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAEnD,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,qBAAqB,CAAC,CAAC;AAuB1F,MAAM,iBAAiB,GAAG;IACxB,IAAI,EAAE;QACJ,OAAO,EAAE,QAAQ,CAAC,UA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|
|
2
4
|
export type TestSetInputs = {
|
|
3
5
|
utterance: string;
|
|
4
|
-
actionSequenceExpectedValue: string;
|
|
6
|
+
actionSequenceExpectedValue: string[];
|
|
5
7
|
botRatingExpectedValue: string;
|
|
6
8
|
topicSequenceExpectedValue: string;
|
|
7
9
|
};
|
|
@@ -8,39 +8,60 @@ import { dirname, join } from 'node:path';
|
|
|
8
8
|
import { mkdir, writeFile } from 'node:fs/promises';
|
|
9
9
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
10
10
|
import { Messages } from '@salesforce/core';
|
|
11
|
-
import input from '@inquirer/
|
|
12
|
-
import confirm from '@inquirer/confirm';
|
|
11
|
+
import { select, input, confirm, checkbox } from '@inquirer/prompts';
|
|
13
12
|
import { theme } from '../../../inquirer-theme.js';
|
|
13
|
+
import { readDir } from '../../../read-dir.js';
|
|
14
14
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
15
15
|
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.generate.testset');
|
|
16
|
-
|
|
16
|
+
export const FORTY_CHAR_API_NAME_REGEX = /^(?=.{1,57}$)[a-zA-Z]([a-zA-Z0-9]|_(?!_)){0,14}(__[a-zA-Z]([a-zA-Z0-9]|_(?!_)){0,39})?$/;
|
|
17
|
+
export const EIGHTY_CHAR_API_NAME_REGEX = /^(?=.{1,97}$)[a-zA-Z]([a-zA-Z0-9]|_(?!_)){0,14}(__[a-zA-Z]([a-zA-Z0-9]|_(?!_)){0,79})?$/;
|
|
18
|
+
async function promptForTestCase({ topics, actions }) {
|
|
17
19
|
const utterance = await input({
|
|
18
|
-
message: '
|
|
20
|
+
message: 'Utterance',
|
|
19
21
|
validate: (d) => d.length > 0 || 'utterance cannot be empty',
|
|
20
22
|
theme,
|
|
21
23
|
});
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return 'expected value cannot be empty';
|
|
27
|
-
}
|
|
28
|
-
return true;
|
|
29
|
-
},
|
|
24
|
+
const customKey = '<OTHER>';
|
|
25
|
+
let topicSequenceExpectedValue = await select({
|
|
26
|
+
message: 'Expected topic',
|
|
27
|
+
choices: [...topics, customKey],
|
|
30
28
|
theme,
|
|
31
29
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
if (topicSequenceExpectedValue === customKey) {
|
|
31
|
+
topicSequenceExpectedValue = await input({
|
|
32
|
+
message: 'Expected topic',
|
|
33
|
+
validate: (d) => {
|
|
34
|
+
if (!d.length) {
|
|
35
|
+
return 'expected value cannot be empty';
|
|
36
|
+
}
|
|
37
|
+
return true;
|
|
38
|
+
},
|
|
39
|
+
theme,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
let actionSequenceExpectedValue = await checkbox({
|
|
43
|
+
message: 'Expected action(s)',
|
|
44
|
+
choices: [...actions, customKey],
|
|
40
45
|
theme,
|
|
46
|
+
required: true,
|
|
41
47
|
});
|
|
48
|
+
if (actionSequenceExpectedValue.includes(customKey)) {
|
|
49
|
+
const additional = (await input({
|
|
50
|
+
message: 'Expected action(s)',
|
|
51
|
+
validate: (d) => {
|
|
52
|
+
if (!d.length) {
|
|
53
|
+
return 'expected value cannot be empty';
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
},
|
|
57
|
+
theme,
|
|
58
|
+
}))
|
|
59
|
+
.split(',')
|
|
60
|
+
.map((a) => a.trim());
|
|
61
|
+
actionSequenceExpectedValue = [...actionSequenceExpectedValue.filter((a) => a !== customKey), ...additional];
|
|
62
|
+
}
|
|
42
63
|
const botRatingExpectedValue = await input({
|
|
43
|
-
message: '
|
|
64
|
+
message: 'Expected response',
|
|
44
65
|
validate: (d) => {
|
|
45
66
|
if (!d.length) {
|
|
46
67
|
return 'expected value cannot be empty';
|
|
@@ -72,10 +93,7 @@ export function constructTestSetXML(testCases) {
|
|
|
72
93
|
</expectation>
|
|
73
94
|
<expectation>
|
|
74
95
|
<name>action_sequence_match</name>
|
|
75
|
-
<expectedValue>${`[${testCase.actionSequenceExpectedValue
|
|
76
|
-
.split(',')
|
|
77
|
-
.map((v) => `"${v}"`)
|
|
78
|
-
.join(',')}]`}</expectedValue>
|
|
96
|
+
<expectedValue>${`[${testCase.actionSequenceExpectedValue.map((v) => `"${v}"`).join(',')}]`}</expectedValue>
|
|
79
97
|
</expectation>
|
|
80
98
|
<expectation>
|
|
81
99
|
<name>bot_response_rating</name>
|
|
@@ -95,23 +113,34 @@ export default class AgentGenerateTestset extends SfCommand {
|
|
|
95
113
|
static state = 'beta';
|
|
96
114
|
async run() {
|
|
97
115
|
const testSetName = await input({
|
|
98
|
-
message: 'What is the name of the test set
|
|
116
|
+
message: 'What is the name of the test set',
|
|
117
|
+
validate(d) {
|
|
118
|
+
// check against FORTY_CHAR_API_NAME_REGEX
|
|
119
|
+
if (!FORTY_CHAR_API_NAME_REGEX.test(d)) {
|
|
120
|
+
return 'The non-namespaced portion an API name must begin with a letter, contain only letters, numbers, and underscores, not contain consecutive underscores, and not end with an underscore.';
|
|
121
|
+
}
|
|
122
|
+
return true;
|
|
123
|
+
},
|
|
99
124
|
});
|
|
125
|
+
const genAiPluginDir = join('force-app', 'main', 'default', 'genAiPlugins');
|
|
126
|
+
const genAiPlugins = (await readDir(genAiPluginDir)).map((genAiPlugin) => genAiPlugin.replace('.genAiPlugin-meta.xml', ''));
|
|
127
|
+
const genAiFunctionsDir = join('force-app', 'main', 'default', 'genAiFunctions');
|
|
128
|
+
const genAiFunctions = (await readDir(genAiFunctionsDir)).map((genAiFunction) => genAiFunction.replace('.genAiFunction-meta.xml', ''));
|
|
100
129
|
const testCases = [];
|
|
101
130
|
do {
|
|
102
131
|
this.log();
|
|
103
132
|
this.styledHeader(`Adding test case #${testCases.length + 1}`);
|
|
104
133
|
// eslint-disable-next-line no-await-in-loop
|
|
105
|
-
testCases.push(await promptForTestCase());
|
|
134
|
+
testCases.push(await promptForTestCase({ topics: genAiPlugins, actions: genAiFunctions }));
|
|
106
135
|
} while ( // eslint-disable-next-line no-await-in-loop
|
|
107
136
|
await confirm({
|
|
108
|
-
message: 'Would you like to add another test case
|
|
137
|
+
message: 'Would you like to add another test case',
|
|
109
138
|
default: true,
|
|
110
139
|
}));
|
|
111
|
-
const testSetPath = join('force-app', 'main', 'default', '
|
|
140
|
+
const testSetPath = join('force-app', 'main', 'default', 'aiEvaluationTestSets', `${testSetName}.aiEvaluationTestSet-meta.xml`);
|
|
112
141
|
await mkdir(dirname(testSetPath), { recursive: true });
|
|
113
142
|
this.log();
|
|
114
|
-
this.log(`
|
|
143
|
+
this.log(`Created ${testSetPath}`);
|
|
115
144
|
await writeFile(testSetPath, constructTestSetXML(testCases));
|
|
116
145
|
}
|
|
117
146
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testset.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/testset.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,
|
|
1
|
+
{"version":3,"file":"testset.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/testset.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,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AC,CAAC;IAC/D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function readDir(path: string): Promise<string[]>;
|
package/lib/read-dir.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024, salesforce.com, inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
import { readdir } from 'node:fs/promises';
|
|
8
|
+
export async function readDir(path) {
|
|
9
|
+
return (await readdir(path)).filter((bot) => !bot.startsWith('.'));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=read-dir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-dir.js","sourceRoot":"","sources":["../src/read-dir.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAY;IACxC,OAAO,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AACrE,CAAC"}
|