@salesforce/plugin-agent 1.7.1 → 1.7.2-dev.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/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.1/src/commands/agent/create.ts)_
|
|
114
|
+
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.2-dev.1/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.1/src/commands/agent/generate/definition.ts)_
|
|
139
|
+
_See code: [src/commands/agent/generate/definition.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.2-dev.1/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.1/src/commands/agent/generate/spec.ts)_
|
|
200
|
+
_See code: [src/commands/agent/generate/spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.2-dev.1/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.1/src/commands/agent/generate/testset.ts)_
|
|
223
|
+
_See code: [src/commands/agent/generate/testset.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.2-dev.1/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.1/src/commands/agent/preview.ts)_
|
|
258
|
+
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.2-dev.1/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.1/src/commands/agent/test/cancel.ts)_
|
|
295
|
+
_See code: [src/commands/agent/test/cancel.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.2-dev.1/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.1/src/commands/agent/test/results.ts)_
|
|
351
|
+
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.2-dev.1/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.1/src/commands/agent/test/resume.ts)_
|
|
414
|
+
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.2-dev.1/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.1/src/commands/agent/test/run.ts)_
|
|
477
|
+
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.2-dev.1/src/commands/agent/test/run.ts)_
|
|
478
478
|
|
|
479
479
|
<!-- commandsstop -->
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
-
type ExpectationType = 'topic_sequence_match' | 'action_sequence_match' | 'bot_response_rating';
|
|
3
2
|
export type TestSetInputs = {
|
|
4
3
|
utterance: string;
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
actionSequenceExpectedValue: string;
|
|
5
|
+
botRatingExpectedValue: string;
|
|
6
|
+
topicSequenceExpectedValue: string;
|
|
7
7
|
};
|
|
8
8
|
export declare function constructTestSetXML(testCases: TestSetInputs[]): string;
|
|
9
9
|
export default class AgentGenerateTestset extends SfCommand<void> {
|
|
@@ -14,4 +14,3 @@ export default class AgentGenerateTestset extends SfCommand<void> {
|
|
|
14
14
|
static readonly state = "beta";
|
|
15
15
|
run(): Promise<void>;
|
|
16
16
|
}
|
|
17
|
-
export {};
|
|
@@ -9,7 +9,6 @@ import { mkdir, writeFile } from 'node:fs/promises';
|
|
|
9
9
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
10
10
|
import { Messages } from '@salesforce/core';
|
|
11
11
|
import input from '@inquirer/input';
|
|
12
|
-
import select from '@inquirer/select';
|
|
13
12
|
import confirm from '@inquirer/confirm';
|
|
14
13
|
import { theme } from '../../../inquirer-theme.js';
|
|
15
14
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
@@ -20,19 +19,31 @@ async function promptForTestCase() {
|
|
|
20
19
|
validate: (d) => d.length > 0 || 'utterance cannot be empty',
|
|
21
20
|
theme,
|
|
22
21
|
});
|
|
23
|
-
const
|
|
24
|
-
message: 'What
|
|
25
|
-
|
|
22
|
+
const topicSequenceExpectedValue = await input({
|
|
23
|
+
message: 'What is the expected value for the topic expectation?',
|
|
24
|
+
validate: (d) => {
|
|
25
|
+
if (!d.length) {
|
|
26
|
+
return 'expected value cannot be empty';
|
|
27
|
+
}
|
|
28
|
+
return true;
|
|
29
|
+
},
|
|
26
30
|
theme,
|
|
27
31
|
});
|
|
28
|
-
const
|
|
29
|
-
message: 'What is the expected value for the expectation?',
|
|
32
|
+
const actionSequenceExpectedValue = await input({
|
|
33
|
+
message: 'What is the expected value for the action expectation?',
|
|
30
34
|
validate: (d) => {
|
|
31
35
|
if (!d.length) {
|
|
32
36
|
return 'expected value cannot be empty';
|
|
33
37
|
}
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
return true;
|
|
39
|
+
},
|
|
40
|
+
theme,
|
|
41
|
+
});
|
|
42
|
+
const botRatingExpectedValue = await input({
|
|
43
|
+
message: 'What is the expected value for the bot rating expectation?',
|
|
44
|
+
validate: (d) => {
|
|
45
|
+
if (!d.length) {
|
|
46
|
+
return 'expected value cannot be empty';
|
|
36
47
|
}
|
|
37
48
|
return true;
|
|
38
49
|
},
|
|
@@ -40,20 +51,15 @@ async function promptForTestCase() {
|
|
|
40
51
|
});
|
|
41
52
|
return {
|
|
42
53
|
utterance,
|
|
43
|
-
|
|
44
|
-
|
|
54
|
+
actionSequenceExpectedValue,
|
|
55
|
+
botRatingExpectedValue,
|
|
56
|
+
topicSequenceExpectedValue,
|
|
45
57
|
};
|
|
46
58
|
}
|
|
47
59
|
export function constructTestSetXML(testCases) {
|
|
48
60
|
const tab = ' ';
|
|
49
61
|
let xml = `<?xml version="1.0" encoding="UTF-8"?>\n<AiEvaluationTestSet>\n${tab}<subjectType>AGENT</subjectType>\n`;
|
|
50
62
|
testCases.forEach((testCase, i) => {
|
|
51
|
-
const expectedValue = testCase.expectationType === 'action_sequence_match'
|
|
52
|
-
? `[${testCase.expectedValue
|
|
53
|
-
.split(',')
|
|
54
|
-
.map((v) => `"${v}"`)
|
|
55
|
-
.join(',')}]`
|
|
56
|
-
: testCase.expectedValue;
|
|
57
63
|
xml += ` <testCase>
|
|
58
64
|
<number>${i + 1}</number>
|
|
59
65
|
<inputs>
|
|
@@ -61,8 +67,19 @@ export function constructTestSetXML(testCases) {
|
|
|
61
67
|
</inputs>
|
|
62
68
|
<expectations>
|
|
63
69
|
<expectation>
|
|
64
|
-
<name
|
|
65
|
-
<expectedValue>${
|
|
70
|
+
<name>topic_sequence_match</name>
|
|
71
|
+
<expectedValue>${testCase.topicSequenceExpectedValue}</expectedValue>
|
|
72
|
+
</expectation>
|
|
73
|
+
<expectation>
|
|
74
|
+
<name>action_sequence_match</name>
|
|
75
|
+
<expectedValue>${`[${testCase.actionSequenceExpectedValue
|
|
76
|
+
.split(',')
|
|
77
|
+
.map((v) => `"${v}"`)
|
|
78
|
+
.join(',')}]`}</expectedValue>
|
|
79
|
+
</expectation>
|
|
80
|
+
<expectation>
|
|
81
|
+
<name>bot_response_rating</name>
|
|
82
|
+
<expectedValue>${testCase.botRatingExpectedValue}</expectedValue>
|
|
66
83
|
</expectation>
|
|
67
84
|
</expectations>
|
|
68
85
|
</testCase>\n`;
|
|
@@ -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,KAAK,MAAM,iBAAiB,CAAC;AACpC,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,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,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,wBAAwB,CAAC,CAAC;AAS7F,KAAK,UAAU,iBAAiB;IAC9B,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC;QAC5B,OAAO,EAAE,wCAAwC;QACjD,QAAQ,EAAE,CAAC,CAAS,EAAoB,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,2BAA2B;QACtF,KAAK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,CAAC,CAAC;QACvG,MAAM,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACvD,IAAI,CAAC,GAAG,EAAE,CAAC;QACX,IAAI,CAAC,GAAG,CAAC,sCAAsC,WAAW,EAAE,CAAC,CAAC;QAC9D,MAAM,SAAS,CAAC,WAAW,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC;IAC/D,CAAC"}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-agent",
|
|
3
|
-
"version": "1.7.1",
|
|
3
|
+
"version": "1.7.2-dev.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@salesforce/plugin-agent",
|
|
9
|
-
"version": "1.7.1",
|
|
9
|
+
"version": "1.7.2-dev.1",
|
|
10
10
|
"license": "BSD-3-Clause",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@inquirer/confirm": "^5.1.0",
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-agent",
|
|
3
3
|
"description": "Commands to interact with Salesforce agents",
|
|
4
|
-
"version": "1.7.1",
|
|
4
|
+
"version": "1.7.2-dev.1",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/forcedotcom/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
@@ -222,7 +222,7 @@
|
|
|
222
222
|
"exports": "./lib/index.js",
|
|
223
223
|
"type": "module",
|
|
224
224
|
"sfdx": {
|
|
225
|
-
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.7.1.crt",
|
|
226
|
-
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.7.1.sig"
|
|
225
|
+
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.7.2-dev.1.crt",
|
|
226
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.7.2-dev.1.sig"
|
|
227
227
|
}
|
|
228
228
|
}
|