@salesforce/plugin-agent 1.7.3-dev.5 → 1.9.2-beta.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 +126 -9
- package/lib/commands/agent/create-v2.d.ts +26 -0
- package/lib/commands/agent/create-v2.js +202 -0
- package/lib/commands/agent/create-v2.js.map +1 -0
- package/lib/commands/agent/generate/spec-v2.d.ts +29 -0
- package/lib/commands/agent/generate/spec-v2.js +117 -0
- package/lib/commands/agent/generate/spec-v2.js.map +1 -0
- package/lib/commands/agent/generate/test-definition.js +1 -1
- package/lib/commands/agent/generate/test-definition.js.map +1 -1
- package/lib/flags.d.ts +45 -2
- package/lib/flags.js +99 -0
- package/lib/flags.js.map +1 -1
- package/lib/handleTestResults.js +5 -5
- package/lib/handleTestResults.js.map +1 -1
- package/lib/testStages.js +1 -1
- package/lib/testStages.js.map +1 -1
- package/messages/agent.create-v2.md +57 -0
- package/messages/agent.generate.spec-v2.md +45 -0
- package/messages/shared.md +28 -0
- package/npm-shrinkwrap.json +7851 -14323
- package/oclif.lock +178 -699
- package/oclif.manifest.json +294 -1
- package/package.json +6 -5
- package/schemas/agent-create.json +4 -2
- package/schemas/agent-create__v2.json +21 -0
- package/schemas/agent-generate-spec.json +4 -2
- package/schemas/agent-generate-spec__v2.json +85 -0
- package/schemas/agent-preview.json +1 -1
- package/schemas/agent-test-cancel.json +5 -2
- package/schemas/agent-test-results.json +4 -8
- package/schemas/agent-test-resume.json +5 -2
- package/schemas/agent-test-run.json +5 -2
package/lib/flags.d.ts
CHANGED
|
@@ -1,8 +1,51 @@
|
|
|
1
|
-
|
|
1
|
+
import { Interfaces } from '@oclif/core';
|
|
2
|
+
export type FlaggablePrompt = {
|
|
3
|
+
message: string;
|
|
4
|
+
options?: readonly string[] | string[];
|
|
5
|
+
validate: (d: string) => boolean | string;
|
|
6
|
+
char?: Interfaces.AlphabetLowercase | Interfaces.AlphabetUppercase;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
default?: string | boolean;
|
|
9
|
+
};
|
|
10
|
+
type FlagsOfPrompts<T extends Record<string, FlaggablePrompt>> = Record<keyof T, Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>>;
|
|
11
|
+
export declare const resultFormatFlag: Interfaces.FlagDefinition<"json" | "human" | "junit" | "tap", Interfaces.CustomOptions, {
|
|
2
12
|
multiple: false;
|
|
3
13
|
requiredOrDefaulted: true;
|
|
4
14
|
}>;
|
|
5
|
-
export declare const testOutputDirFlag:
|
|
15
|
+
export declare const testOutputDirFlag: Interfaces.FlagDefinition<string, Interfaces.CustomOptions, {
|
|
6
16
|
multiple: false;
|
|
7
17
|
requiredOrDefaulted: false;
|
|
8
18
|
}>;
|
|
19
|
+
export declare const FLAGGABLE_SPEC_PROMPTS: {
|
|
20
|
+
type: {
|
|
21
|
+
message: string;
|
|
22
|
+
validate: (d: string) => boolean | string;
|
|
23
|
+
char: "t";
|
|
24
|
+
options: string[];
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
role: {
|
|
28
|
+
message: string;
|
|
29
|
+
validate: (d: string) => boolean | string;
|
|
30
|
+
required: true;
|
|
31
|
+
};
|
|
32
|
+
'company-name': {
|
|
33
|
+
message: string;
|
|
34
|
+
validate: (d: string) => boolean | string;
|
|
35
|
+
required: true;
|
|
36
|
+
};
|
|
37
|
+
'company-description': {
|
|
38
|
+
message: string;
|
|
39
|
+
validate: (d: string) => boolean | string;
|
|
40
|
+
required: true;
|
|
41
|
+
};
|
|
42
|
+
'company-website': {
|
|
43
|
+
message: string;
|
|
44
|
+
validate: (d: string) => boolean | string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export declare function makeFlags<T extends Record<string, FlaggablePrompt>>(flaggablePrompts: T): FlagsOfPrompts<T>;
|
|
48
|
+
export declare const promptForFlag: (flagDef: FlaggablePrompt) => Promise<string>;
|
|
49
|
+
export declare const validateAgentType: (agentType?: string, required?: boolean) => string | undefined;
|
|
50
|
+
export declare const validateMaxTopics: (maxTopics?: number) => number | undefined;
|
|
51
|
+
export {};
|
package/lib/flags.js
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { Flags } from '@salesforce/sf-plugins-core';
|
|
8
8
|
import { Messages } from '@salesforce/core';
|
|
9
|
+
import { select, input as inquirerInput } from '@inquirer/prompts';
|
|
10
|
+
import { theme } from './inquirer-theme.js';
|
|
9
11
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
10
12
|
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'shared');
|
|
11
13
|
export const resultFormatFlag = Flags.option({
|
|
@@ -18,4 +20,101 @@ export const testOutputDirFlag = Flags.custom({
|
|
|
18
20
|
description: messages.getMessage('flags.output-dir.description'),
|
|
19
21
|
summary: messages.getMessage('flags.output-dir.summary'),
|
|
20
22
|
});
|
|
23
|
+
export const FLAGGABLE_SPEC_PROMPTS = {
|
|
24
|
+
type: {
|
|
25
|
+
message: messages.getMessage('flags.type.summary'),
|
|
26
|
+
validate: (d) => d.length > 0 || 'Type cannot be empty',
|
|
27
|
+
char: 't',
|
|
28
|
+
options: ['customer', 'internal'],
|
|
29
|
+
required: true,
|
|
30
|
+
},
|
|
31
|
+
role: {
|
|
32
|
+
message: messages.getMessage('flags.role.summary'),
|
|
33
|
+
validate: (d) => d.length > 0 || 'Role cannot be empty',
|
|
34
|
+
required: true,
|
|
35
|
+
},
|
|
36
|
+
'company-name': {
|
|
37
|
+
message: messages.getMessage('flags.company-name.summary'),
|
|
38
|
+
validate: (d) => d.length > 0 || 'Company name cannot be empty',
|
|
39
|
+
required: true,
|
|
40
|
+
},
|
|
41
|
+
'company-description': {
|
|
42
|
+
message: messages.getMessage('flags.company-description.summary'),
|
|
43
|
+
validate: (d) => d.length > 0 || 'Company description cannot be empty',
|
|
44
|
+
required: true,
|
|
45
|
+
},
|
|
46
|
+
'company-website': {
|
|
47
|
+
message: messages.getMessage('flags.company-website.summary'),
|
|
48
|
+
validate: (d) => {
|
|
49
|
+
// Allow empty string
|
|
50
|
+
if (d.length === 0)
|
|
51
|
+
return true;
|
|
52
|
+
try {
|
|
53
|
+
new URL(d);
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
catch (e) {
|
|
57
|
+
return 'Please enter a valid URL';
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
function validateInput(input, validate) {
|
|
63
|
+
const result = validate(input);
|
|
64
|
+
if (typeof result === 'string')
|
|
65
|
+
throw new Error(result);
|
|
66
|
+
return input;
|
|
67
|
+
}
|
|
68
|
+
export function makeFlags(flaggablePrompts) {
|
|
69
|
+
return Object.fromEntries(Object.entries(flaggablePrompts).map(([key, value]) => [
|
|
70
|
+
key,
|
|
71
|
+
Flags.string({
|
|
72
|
+
summary: value.message,
|
|
73
|
+
options: value.options,
|
|
74
|
+
char: value.char,
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
76
|
+
async parse(input) {
|
|
77
|
+
return validateInput(input, value.validate);
|
|
78
|
+
},
|
|
79
|
+
// NOTE: we purposely omit the required property here because we want to allow the flag to be missing in interactive mode
|
|
80
|
+
}),
|
|
81
|
+
]));
|
|
82
|
+
}
|
|
83
|
+
export const promptForFlag = async (flagDef) => {
|
|
84
|
+
const message = flagDef.message.replace(/\.$/, '');
|
|
85
|
+
if (flagDef.options) {
|
|
86
|
+
return select({
|
|
87
|
+
choices: flagDef.options.map((o) => ({ name: o, value: o })),
|
|
88
|
+
message,
|
|
89
|
+
theme,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
return inquirerInput({
|
|
93
|
+
message,
|
|
94
|
+
validate: flagDef.validate,
|
|
95
|
+
theme,
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
export const validateAgentType = (agentType, required = false) => {
|
|
99
|
+
if (required && !agentType) {
|
|
100
|
+
throw messages.createError('error.invalidAgentType', [agentType]);
|
|
101
|
+
}
|
|
102
|
+
if (agentType) {
|
|
103
|
+
if (!['customer', 'internal'].includes(agentType.trim())) {
|
|
104
|
+
throw messages.createError('error.invalidAgentType', [agentType]);
|
|
105
|
+
}
|
|
106
|
+
return agentType.trim();
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
export const validateMaxTopics = (maxTopics) => {
|
|
110
|
+
// Deliberately using: != null
|
|
111
|
+
if (maxTopics != null) {
|
|
112
|
+
if (!isNaN(maxTopics) && isFinite(maxTopics)) {
|
|
113
|
+
if (maxTopics > 0) {
|
|
114
|
+
return maxTopics;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
throw messages.createError('error.invalidMaxTopics', [maxTopics]);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
21
120
|
//# sourceMappingURL=flags.js.map
|
package/lib/flags.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../src/flags.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../src/flags.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,QAAQ,CAAC,CAAC;AAgB7E,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,CAAC;IAC3C,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,EAA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,CAAC;YAC7C,IAAI,SAAS,GAAG,CAAC,EAAE,CAAC;gBAClB,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;QACD,MAAM,QAAQ,CAAC,WAAW,CAAC,wBAAwB,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IACpE,CAAC;AACH,CAAC,CAAC"}
|
package/lib/handleTestResults.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { join } from 'node:path';
|
|
8
8
|
import { writeFile, mkdir } from 'node:fs/promises';
|
|
9
|
-
import {
|
|
9
|
+
import { convertTestResultsToFormat } from '@salesforce/agents';
|
|
10
10
|
import { Ux } from '@salesforce/sf-plugins-core/Ux';
|
|
11
11
|
async function writeFileToDir(outputDir, fileName, content) {
|
|
12
12
|
// if directory doesn't exist, create it
|
|
@@ -20,7 +20,7 @@ export async function handleTestResults({ id, format, results, jsonEnabled, outp
|
|
|
20
20
|
}
|
|
21
21
|
const ux = new Ux({ jsonEnabled });
|
|
22
22
|
if (format === 'human') {
|
|
23
|
-
const formatted = await
|
|
23
|
+
const formatted = await convertTestResultsToFormat(results, 'human');
|
|
24
24
|
if (outputDir) {
|
|
25
25
|
const file = `test-result-${id}.txt`;
|
|
26
26
|
await writeFileToDir(outputDir, file, formatted);
|
|
@@ -31,7 +31,7 @@ export async function handleTestResults({ id, format, results, jsonEnabled, outp
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
if (format === 'json') {
|
|
34
|
-
const formatted = await
|
|
34
|
+
const formatted = await convertTestResultsToFormat(results, 'json');
|
|
35
35
|
if (outputDir) {
|
|
36
36
|
const file = `test-result-${id}.json`;
|
|
37
37
|
await writeFileToDir(outputDir, file, formatted);
|
|
@@ -42,7 +42,7 @@ export async function handleTestResults({ id, format, results, jsonEnabled, outp
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
if (format === 'junit') {
|
|
45
|
-
const formatted = await
|
|
45
|
+
const formatted = await convertTestResultsToFormat(results, 'junit');
|
|
46
46
|
if (outputDir) {
|
|
47
47
|
const file = `test-result-${id}.xml`;
|
|
48
48
|
await writeFileToDir(outputDir, file, formatted);
|
|
@@ -53,7 +53,7 @@ export async function handleTestResults({ id, format, results, jsonEnabled, outp
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
if (format === 'tap') {
|
|
56
|
-
const formatted = await
|
|
56
|
+
const formatted = await convertTestResultsToFormat(results, 'tap');
|
|
57
57
|
if (outputDir) {
|
|
58
58
|
const file = `test-result-${id}.txt`;
|
|
59
59
|
await writeFileToDir(outputDir, file, formatted);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleTestResults.js","sourceRoot":"","sources":["../src/handleTestResults.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAA4B,
|
|
1
|
+
{"version":3,"file":"handleTestResults.js","sourceRoot":"","sources":["../src/handleTestResults.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAA4B,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAC1F,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAEpD,KAAK,UAAU,cAAc,CAAC,SAAiB,EAAE,QAAgB,EAAE,OAAe;IAChF,wCAAwC;IACxC,MAAM,KAAK,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE5C,MAAM,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC;AACtD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBA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AI,SAAS,EAAE,CAAC;YACd,MAAM,IAAI,GAAG,eAAe,EAAE,MAAM,CAAC;YACrC,MAAM,cAAc,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;YACjD,EAAE,CAAC,GAAG,CAAC,yBAAyB,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QAC3D,CAAC;aAAM,CAAC;YACN,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IAED,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;QACrB,MAAM,SAAS,GAAG,MAAM,0BAA0B,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACnE,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,IAAI,GAAG,eAAe,EAAE,MAAM,CAAC;YACrC,MAAM,cAAc,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;YACjD,EAAE,CAAC,GAAG,CAAC,uBAAuB,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QACzD,CAAC;aAAM,CAAC;YACN,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/lib/testStages.js
CHANGED
|
@@ -29,7 +29,7 @@ export class TestStages {
|
|
|
29
29
|
stage: 'Polling for Test Results',
|
|
30
30
|
type: 'dynamic-key-value',
|
|
31
31
|
label: 'Completed Test Cases',
|
|
32
|
-
get: (data) => data?.totalTestCases && data?.passingTestCases && data?.failingTestCases
|
|
32
|
+
get: (data) => data?.totalTestCases && data?.passingTestCases >= 0 && data?.failingTestCases >= 0
|
|
33
33
|
? `${data?.passingTestCases + data?.failingTestCases}/${data?.totalTestCases}`
|
|
34
34
|
: undefined,
|
|
35
35
|
},
|
package/lib/testStages.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testStages.js","sourceRoot":"","sources":["../src/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,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,0BAA0B,IAAI,CAAC,OAAO,WAAW,CAAC,CAAC;gBAC/D,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,QAAQ,CAAC,KAAK,EAAE,iCAAiC,EAAE,EAAE,CAAC,kCAAkC,CAAC,CAAC;gBAC7G,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;YAC7B,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,KAAK,EAAE,CAAC;gBACb,MAAM,CAAC,CAAC;YACV,CAAC;QACH,CAAC;IACH,CAAC;IAEM,MAAM,CAAC,IAAmB;QAC/B,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAEM,IAAI,CAAC,WAAqB;QAC/B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC7B,CAAC;IAEM,KAAK;QACV,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;IACnB,CAAC;IAEM,IAAI,CAAC,IAAoB;QAC9B,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Create an agent in your org from a local agent spec file.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
To generate an agent spec file, run the "agent generate spec" CLI command, which outputs a YAML file with the list of jobs and descriptions that the new agent can perform. Then specify this generated spec file to the --spec flag of this command, along with the name of the new agent.
|
|
8
|
+
|
|
9
|
+
When this command finishes, your org contains the new agent, which you can then edit in the Agent Builder UI. The new agent already has a list of topics and actions that were automatically created from the list of jobs in the provided agent spec file. This command also retrieves all the metadata files associated with the new agent to your local DX project.
|
|
10
|
+
|
|
11
|
+
To open the new agent in your org's Agent Builder UI, run this command: "sf org open agent --name <api-name-of-your-agent>".
|
|
12
|
+
|
|
13
|
+
# flags.spec.summary
|
|
14
|
+
|
|
15
|
+
Path to an agent spec file.
|
|
16
|
+
|
|
17
|
+
# flags.preview.summary
|
|
18
|
+
|
|
19
|
+
Preview the agent without saving in your org.
|
|
20
|
+
|
|
21
|
+
# flags.agent-name.summary
|
|
22
|
+
|
|
23
|
+
Name for the new agent.
|
|
24
|
+
|
|
25
|
+
# flags.agent-api-name.summary
|
|
26
|
+
|
|
27
|
+
API name for the new agent.
|
|
28
|
+
|
|
29
|
+
# flags.user-id.summary
|
|
30
|
+
|
|
31
|
+
Custom user ID for the agent.
|
|
32
|
+
|
|
33
|
+
# flags.enrich-logs.summary
|
|
34
|
+
|
|
35
|
+
Adds agent conversation data to event logs.
|
|
36
|
+
|
|
37
|
+
# flags.tone.summary
|
|
38
|
+
|
|
39
|
+
Conversational style of agent responses.
|
|
40
|
+
|
|
41
|
+
# flags.primary-language.summary
|
|
42
|
+
|
|
43
|
+
Language the agent uses in conversations.
|
|
44
|
+
|
|
45
|
+
# flags.planner-id.summary
|
|
46
|
+
|
|
47
|
+
The GenAiPlanner ID to associate with the agent.
|
|
48
|
+
|
|
49
|
+
# error.missingRequiredFlags
|
|
50
|
+
|
|
51
|
+
Missing required flags: %s
|
|
52
|
+
|
|
53
|
+
# examples
|
|
54
|
+
|
|
55
|
+
- Create an agent called "CustomerSupportAgent" in an org with alias "my-org" using the specified agent spec file:
|
|
56
|
+
|
|
57
|
+
<%= config.bin %> <%= command.id %> --name CustomerSupportAgent --spec ./config/agentSpec.json --target-org my-org
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Generate an agent spec, which is the list of jobs that the agent performs.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
When using Salesforce CLI to create an agent in your org, you can choose to generate a YAML-formatted agent spec file with this command as a first step.
|
|
8
|
+
|
|
9
|
+
An agent spec is a list of jobs and descriptions that capture what the agent can do. Use flags such as --role and --company-description to provide details about your company and the role that the agent plays in your company; you can also enter the information interactively if you prefer. When you then execute this command, the large language model (LLM) associated with your org uses the information to generate the list of jobs that the agent most likely performs. We recommend that you provide good details for --role, --company-description, etc, so that the LLM can generate the best and most relevant list of jobs and descriptions. Once generated, you can edit the spec file; for example, you can remove jobs that don't apply to your agent.
|
|
10
|
+
|
|
11
|
+
When your agent spec is ready, you then create the agent in your org by specifying the agent spec file to the --job-spec flag of the "agent create" CLI command.
|
|
12
|
+
|
|
13
|
+
# flags.output-file.summary
|
|
14
|
+
|
|
15
|
+
Path for the generated agent spec file (yaml); can be an absolute or relative path.
|
|
16
|
+
|
|
17
|
+
# flags.max-topics.summary
|
|
18
|
+
|
|
19
|
+
Maximum number of agent job topics to generate in the spec; default is 10.
|
|
20
|
+
|
|
21
|
+
# flags.prompt-template.summary
|
|
22
|
+
|
|
23
|
+
Developer name of a customized prompt template to use instead of the default.
|
|
24
|
+
|
|
25
|
+
# flags.grounding-context.summary
|
|
26
|
+
|
|
27
|
+
Context information to be used with the customized prompt template.
|
|
28
|
+
|
|
29
|
+
# flags.spec.summary
|
|
30
|
+
|
|
31
|
+
Spec file (yaml) to use as input to the command.
|
|
32
|
+
|
|
33
|
+
# examples
|
|
34
|
+
|
|
35
|
+
- Create an agent spec for your default org in the default location and use flags to specify the agent's role and your company details:
|
|
36
|
+
|
|
37
|
+
<%= config.bin %> <%= command.id %> --type customer --role "Assist users in navigating and managing bookings" --company-name "Coral Cloud" --company-description "Resort that manages guests and their reservations and experiences"
|
|
38
|
+
|
|
39
|
+
- Create an agent spec by being prompted for role and company details interactively; write the generated file to the "specs" directory and use the org with alias "my-org":
|
|
40
|
+
|
|
41
|
+
<%= config.bin %> <%= command.id %> --output-dir specs --target-org my-org
|
|
42
|
+
|
|
43
|
+
# error.missingRequiredFlags
|
|
44
|
+
|
|
45
|
+
Missing required flags: %s
|
package/messages/shared.md
CHANGED
|
@@ -9,3 +9,31 @@ Directory to write the agent test results into.
|
|
|
9
9
|
# flags.output-dir.description
|
|
10
10
|
|
|
11
11
|
If the agent test run completes, write the results to the specified directory. If the test is still running, the test results aren't written.
|
|
12
|
+
|
|
13
|
+
# flags.type.summary
|
|
14
|
+
|
|
15
|
+
Type of agent to create.
|
|
16
|
+
|
|
17
|
+
# flags.role.summary
|
|
18
|
+
|
|
19
|
+
Role of the agent.
|
|
20
|
+
|
|
21
|
+
# flags.company-name.summary
|
|
22
|
+
|
|
23
|
+
Name of your company.
|
|
24
|
+
|
|
25
|
+
# flags.company-description.summary
|
|
26
|
+
|
|
27
|
+
Description of your company.
|
|
28
|
+
|
|
29
|
+
# flags.company-website.summary
|
|
30
|
+
|
|
31
|
+
Website URL of your company.
|
|
32
|
+
|
|
33
|
+
# error.invalidAgentType
|
|
34
|
+
|
|
35
|
+
agentType must be either "customer" or "internal". Found: [%s]
|
|
36
|
+
|
|
37
|
+
# error.invalidMaxTopics
|
|
38
|
+
|
|
39
|
+
maxNumOfTopics must be a number greater than 0. Found: [%s]
|