@salesforce/plugin-agent 1.27.3 → 1.27.4-preview.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 +33 -17
- package/lib/commands/agent/preview.d.ts +7 -2
- package/lib/commands/agent/preview.js +39 -2
- package/lib/commands/agent/preview.js.map +1 -1
- package/messages/agent.preview.md +28 -0
- package/oclif.manifest.json +551 -528
- package/package.json +4 -4
- package/schemas/agent-preview.json +11 -1
package/README.md
CHANGED
|
@@ -112,7 +112,7 @@ EXAMPLES
|
|
|
112
112
|
$ sf agent activate --api-name Resort_Manager --target-org my-org
|
|
113
113
|
```
|
|
114
114
|
|
|
115
|
-
_See code: [src/commands/agent/activate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.
|
|
115
|
+
_See code: [src/commands/agent/activate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/activate.ts)_
|
|
116
116
|
|
|
117
117
|
## `sf agent create`
|
|
118
118
|
|
|
@@ -179,7 +179,7 @@ EXAMPLES
|
|
|
179
179
|
$ sf agent create --name "Resort Manager" --spec specs/resortManagerAgent.yaml --preview
|
|
180
180
|
```
|
|
181
181
|
|
|
182
|
-
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.
|
|
182
|
+
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/create.ts)_
|
|
183
183
|
|
|
184
184
|
## `sf agent deactivate`
|
|
185
185
|
|
|
@@ -219,7 +219,7 @@ EXAMPLES
|
|
|
219
219
|
$ sf agent deactivate --api-name Resort_Manager --target-org my-org
|
|
220
220
|
```
|
|
221
221
|
|
|
222
|
-
_See code: [src/commands/agent/deactivate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.
|
|
222
|
+
_See code: [src/commands/agent/deactivate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/deactivate.ts)_
|
|
223
223
|
|
|
224
224
|
## `sf agent generate agent-spec`
|
|
225
225
|
|
|
@@ -326,7 +326,7 @@ EXAMPLES
|
|
|
326
326
|
$ sf agent generate agent-spec --tone formal --agent-user resortmanager@myorg.com
|
|
327
327
|
```
|
|
328
328
|
|
|
329
|
-
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.
|
|
329
|
+
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/generate/agent-spec.ts)_
|
|
330
330
|
|
|
331
331
|
## `sf agent generate authoring-bundle`
|
|
332
332
|
|
|
@@ -392,7 +392,7 @@ EXAMPLES
|
|
|
392
392
|
other-package-dir/main/default --target-org my-dev-org
|
|
393
393
|
```
|
|
394
394
|
|
|
395
|
-
_See code: [src/commands/agent/generate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.
|
|
395
|
+
_See code: [src/commands/agent/generate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/generate/authoring-bundle.ts)_
|
|
396
396
|
|
|
397
397
|
## `sf agent generate template`
|
|
398
398
|
|
|
@@ -440,7 +440,7 @@ EXAMPLES
|
|
|
440
440
|
force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml --agent-version 1
|
|
441
441
|
```
|
|
442
442
|
|
|
443
|
-
_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.
|
|
443
|
+
_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/generate/template.ts)_
|
|
444
444
|
|
|
445
445
|
## `sf agent generate test-spec`
|
|
446
446
|
|
|
@@ -501,7 +501,7 @@ EXAMPLES
|
|
|
501
501
|
force-app//main/default/aiEvaluationDefinitions/Resort_Manager_Tests.aiEvaluationDefinition-meta.xml
|
|
502
502
|
```
|
|
503
503
|
|
|
504
|
-
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.
|
|
504
|
+
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/generate/test-spec.ts)_
|
|
505
505
|
|
|
506
506
|
## `sf agent preview`
|
|
507
507
|
|
|
@@ -509,8 +509,8 @@ Interact with an agent to preview how it responds to your statements, questions,
|
|
|
509
509
|
|
|
510
510
|
```
|
|
511
511
|
USAGE
|
|
512
|
-
$ sf agent preview -o <value> [--flags-dir <value>] [--api-version <value>] [-n <value>]
|
|
513
|
-
<value>] [-d <value>] [-x] [--use-live-actions]
|
|
512
|
+
$ sf agent preview -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-n <value>]
|
|
513
|
+
[--authoring-bundle <value>] [-d <value>] [-x] [--use-live-actions] [--utterance <value>] [--session-id <value>]
|
|
514
514
|
|
|
515
515
|
FLAGS
|
|
516
516
|
-d, --output-dir=<value> Directory where conversation transcripts are saved.
|
|
@@ -521,11 +521,16 @@ FLAGS
|
|
|
521
521
|
--api-version=<value> Override the api version used for api requests made by this command
|
|
522
522
|
--authoring-bundle=<value> API name of the authoring bundle metadata component that contains the agent's Agent
|
|
523
523
|
Script file.
|
|
524
|
+
--session-id=<value> Session ID of an in-progress preview session; use with --utterance to send a message
|
|
525
|
+
to that session and return the response without starting the interactive preview.
|
|
524
526
|
--use-live-actions Use real actions in the org; if not specified, preview uses AI to simulate (mock)
|
|
525
527
|
actions.
|
|
528
|
+
--utterance=<value> Message to send to the agent; creates a new session, returns the response, and exits
|
|
529
|
+
without starting the interactive preview.
|
|
526
530
|
|
|
527
531
|
GLOBAL FLAGS
|
|
528
532
|
--flags-dir=<value> Import flag values from a directory.
|
|
533
|
+
--json Format output as json.
|
|
529
534
|
|
|
530
535
|
DESCRIPTION
|
|
531
536
|
Interact with an agent to preview how it responds to your statements, questions, and commands (utterances).
|
|
@@ -572,9 +577,20 @@ EXAMPLES
|
|
|
572
577
|
"./transcripts/my-preview" directory, enable the Apex debug logs, and use your default org:
|
|
573
578
|
|
|
574
579
|
$ sf agent preview --use-live-actions --apex-debug --output-dir transcripts/my-preview
|
|
580
|
+
|
|
581
|
+
Send a message to the agent and print the response without starting the interactive preview (requires --api-name or
|
|
582
|
+
--authoring-bundle):
|
|
583
|
+
|
|
584
|
+
$ sf agent preview --authoring-bundle My_Agent_Bundle --utterance "What can you help me with?" --target-org \
|
|
585
|
+
my-dev-org
|
|
586
|
+
|
|
587
|
+
Send a follow-up message to an existing preview session:
|
|
588
|
+
|
|
589
|
+
$ sf agent preview --authoring-bundle My_Agent_Bundle --session-id <session-id> --utterance "Tell me more" \
|
|
590
|
+
--target-org my-dev-org
|
|
575
591
|
```
|
|
576
592
|
|
|
577
|
-
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.
|
|
593
|
+
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/preview.ts)_
|
|
578
594
|
|
|
579
595
|
## `sf agent publish authoring-bundle`
|
|
580
596
|
|
|
@@ -623,7 +639,7 @@ EXAMPLES
|
|
|
623
639
|
$ sf agent publish authoring-bundle --api-name MyAuthoringbundle --target-org my-dev-org
|
|
624
640
|
```
|
|
625
641
|
|
|
626
|
-
_See code: [src/commands/agent/publish/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.
|
|
642
|
+
_See code: [src/commands/agent/publish/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/publish/authoring-bundle.ts)_
|
|
627
643
|
|
|
628
644
|
## `sf agent test create`
|
|
629
645
|
|
|
@@ -678,7 +694,7 @@ EXAMPLES
|
|
|
678
694
|
$ sf agent test create --spec specs/Resort_Manager-testSpec.yaml --api-name Resort_Manager_Test --preview
|
|
679
695
|
```
|
|
680
696
|
|
|
681
|
-
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.
|
|
697
|
+
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/test/create.ts)_
|
|
682
698
|
|
|
683
699
|
## `sf agent test list`
|
|
684
700
|
|
|
@@ -713,7 +729,7 @@ EXAMPLES
|
|
|
713
729
|
$ sf agent test list --target-org my-org
|
|
714
730
|
```
|
|
715
731
|
|
|
716
|
-
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.
|
|
732
|
+
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/test/list.ts)_
|
|
717
733
|
|
|
718
734
|
## `sf agent test results`
|
|
719
735
|
|
|
@@ -779,7 +795,7 @@ FLAG DESCRIPTIONS
|
|
|
779
795
|
expression when using custom evaluations.
|
|
780
796
|
```
|
|
781
797
|
|
|
782
|
-
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.
|
|
798
|
+
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/test/results.ts)_
|
|
783
799
|
|
|
784
800
|
## `sf agent test resume`
|
|
785
801
|
|
|
@@ -852,7 +868,7 @@ FLAG DESCRIPTIONS
|
|
|
852
868
|
expression when using custom evaluations.
|
|
853
869
|
```
|
|
854
870
|
|
|
855
|
-
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.
|
|
871
|
+
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/test/resume.ts)_
|
|
856
872
|
|
|
857
873
|
## `sf agent test run`
|
|
858
874
|
|
|
@@ -926,7 +942,7 @@ FLAG DESCRIPTIONS
|
|
|
926
942
|
expression when using custom evaluations.
|
|
927
943
|
```
|
|
928
944
|
|
|
929
|
-
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.
|
|
945
|
+
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/test/run.ts)_
|
|
930
946
|
|
|
931
947
|
## `sf agent validate authoring-bundle`
|
|
932
948
|
|
|
@@ -973,6 +989,6 @@ EXAMPLES
|
|
|
973
989
|
$ sf agent validate authoring-bundle --api-name MyAuthoringBundle --target-org my-dev-org
|
|
974
990
|
```
|
|
975
991
|
|
|
976
|
-
_See code: [src/commands/agent/validate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.
|
|
992
|
+
_See code: [src/commands/agent/validate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/validate/authoring-bundle.ts)_
|
|
977
993
|
|
|
978
994
|
<!-- commandsstop -->
|
|
@@ -10,12 +10,15 @@ export type AgentData = {
|
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
export declare const UNSUPPORTED_AGENTS: string[];
|
|
13
|
-
export type AgentPreviewResult =
|
|
13
|
+
export type AgentPreviewResult = {
|
|
14
|
+
sessionId: string;
|
|
15
|
+
response: string;
|
|
16
|
+
};
|
|
14
17
|
export default class AgentPreview extends SfCommand<AgentPreviewResult> {
|
|
15
18
|
static readonly summary: string;
|
|
16
19
|
static readonly description: string;
|
|
17
20
|
static readonly examples: string[];
|
|
18
|
-
static readonly enableJsonFlag =
|
|
21
|
+
static readonly enableJsonFlag = true;
|
|
19
22
|
static readonly requiresProject = true;
|
|
20
23
|
static readonly flags: {
|
|
21
24
|
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -25,6 +28,8 @@ export default class AgentPreview extends SfCommand<AgentPreviewResult> {
|
|
|
25
28
|
'output-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
26
29
|
'apex-debug': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
27
30
|
'use-live-actions': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
31
|
+
utterance: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
32
|
+
'session-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
28
33
|
};
|
|
29
34
|
run(): Promise<AgentPreviewResult>;
|
|
30
35
|
}
|
|
@@ -29,7 +29,7 @@ export default class AgentPreview extends SfCommand {
|
|
|
29
29
|
static summary = messages.getMessage('summary');
|
|
30
30
|
static description = messages.getMessage('description');
|
|
31
31
|
static examples = messages.getMessages('examples');
|
|
32
|
-
static enableJsonFlag =
|
|
32
|
+
static enableJsonFlag = true;
|
|
33
33
|
static requiresProject = true;
|
|
34
34
|
static flags = {
|
|
35
35
|
'target-org': Flags.requiredOrg(),
|
|
@@ -53,14 +53,27 @@ export default class AgentPreview extends SfCommand {
|
|
|
53
53
|
summary: messages.getMessage('flags.use-live-actions.summary'),
|
|
54
54
|
default: false,
|
|
55
55
|
}),
|
|
56
|
+
utterance: Flags.string({
|
|
57
|
+
summary: messages.getMessage('flags.utterance.summary'),
|
|
58
|
+
}),
|
|
59
|
+
'session-id': Flags.string({
|
|
60
|
+
summary: messages.getMessage('flags.session-id.summary'),
|
|
61
|
+
}),
|
|
56
62
|
};
|
|
63
|
+
// eslint-disable-next-line complexity
|
|
57
64
|
async run() {
|
|
58
65
|
// STAGES OF PREVIEW
|
|
59
66
|
// get user's agent selection either from flags, or interaction
|
|
60
67
|
// if .agent selected, use the AgentSimulate class to preview
|
|
61
68
|
// if published agent, use AgentPreview for preview
|
|
62
69
|
const { flags } = await this.parse(AgentPreview);
|
|
63
|
-
const { 'api-name': apiNameOrId, 'use-live-actions': useLiveActions, 'authoring-bundle': aabName } = flags;
|
|
70
|
+
const { 'api-name': apiNameOrId, 'use-live-actions': useLiveActions, 'authoring-bundle': aabName, utterance, 'session-id': sessionId, } = flags;
|
|
71
|
+
if (sessionId && !utterance) {
|
|
72
|
+
throw new SfError(messages.getMessage('error.sessionIdRequiresUtterance'), 'SessionIdRequiresUtterance');
|
|
73
|
+
}
|
|
74
|
+
if (utterance && !aabName && !apiNameOrId) {
|
|
75
|
+
throw new SfError(messages.getMessage('error.utteranceRequiresAgent'), 'UtteranceRequiresAgent');
|
|
76
|
+
}
|
|
64
77
|
const conn = flags['target-org'].getConnection(flags['api-version']);
|
|
65
78
|
let selectedAgent;
|
|
66
79
|
if (aabName) {
|
|
@@ -105,6 +118,28 @@ export default class AgentPreview extends SfCommand {
|
|
|
105
118
|
// Otherwise, let user decide when exiting
|
|
106
119
|
const outputDir = flags['output-dir'] ? resolve(flags['output-dir']) : undefined;
|
|
107
120
|
selectedAgent.preview.setApexDebugging(flags['apex-debug']);
|
|
121
|
+
if (utterance) {
|
|
122
|
+
// Non-interactive: send message and return response
|
|
123
|
+
if (sessionId) {
|
|
124
|
+
// @ts-expect-error - access protected member here
|
|
125
|
+
selectedAgent.sessionId = sessionId;
|
|
126
|
+
const response = await selectedAgent.preview.send(utterance);
|
|
127
|
+
const responseMessage = response.messages[0]?.message ?? '';
|
|
128
|
+
if (!this.jsonEnabled()) {
|
|
129
|
+
this.log(responseMessage);
|
|
130
|
+
}
|
|
131
|
+
return { sessionId, response: responseMessage };
|
|
132
|
+
}
|
|
133
|
+
// New session: start, send, end
|
|
134
|
+
const session = await selectedAgent.preview.start();
|
|
135
|
+
const response = await selectedAgent.preview.send(utterance);
|
|
136
|
+
const responseMessage = response.messages[0]?.message ?? '';
|
|
137
|
+
if (!this.jsonEnabled()) {
|
|
138
|
+
this.log(messages.getMessage('output.sessionId', [session.sessionId]));
|
|
139
|
+
this.log(responseMessage);
|
|
140
|
+
}
|
|
141
|
+
return { sessionId: session.sessionId, response: responseMessage };
|
|
142
|
+
}
|
|
108
143
|
const instance = render(React.createElement(AgentPreviewReact, {
|
|
109
144
|
agent: selectedAgent.preview,
|
|
110
145
|
name: selectedAgent.name ?? '',
|
|
@@ -112,6 +147,8 @@ export default class AgentPreview extends SfCommand {
|
|
|
112
147
|
isLocalAgent: selectedAgent instanceof ScriptAgent,
|
|
113
148
|
}), { exitOnCtrlC: false });
|
|
114
149
|
await instance.waitUntilExit();
|
|
150
|
+
// Interactive mode: return empty result for --json (non-interactive --utterance returns sessionId/response)
|
|
151
|
+
return { sessionId: '', response: '' };
|
|
115
152
|
}
|
|
116
153
|
}
|
|
117
154
|
export const agentIsUnsupported = (devName) => UNSUPPORTED_AGENTS.includes(devName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview.js","sourceRoot":"","sources":["../../../src/commands/agent/preview.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,WAAW,EAAoB,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACxG,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAE5E,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,eAAe,CAAC,CAAC;AAYpF,sGAAsG;AACtG,MAAM,CAAC,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AE;YACrC,KAAK,EAAE,aAAa,CAAC,OAAO;YAC5B,IAAI,EAAE,aAAa,CAAC,IAAI,IAAI,EAAE;YAC9B,SAAS;YACT,YAAY,EAAE,aAAa,YAAY,WAAW;SACnD,CAAC,EACF,EAAE,WAAW,EAAE,KAAK,EAAE,CACvB,CAAC;QACF,MAAM,QAAQ,CAAC,aAAa,EAAE,CAAC;QAC/B,4GAA4G;QAC5G,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IACzC,CAAC;;AAGH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAe,EAAW,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAErG,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAgB,EAAW,EAAE;AAC3D,qGAAqG;AACrG,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC;AAEpF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAgB,EAAW,EAAE;IACzD,yCAAyC;IACzC,IAAI,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,OAAO,CAAC,SAAS,KAAK,CAAC,aAAa,eAAe,CAAC,CAAC;IACjE,CAAC;IACD,qCAAqC;IACrC,IAAI,kBAAkB,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,OAAO,CAAC,SAAS,KAAK,CAAC,aAAa,oBAAoB,EAAE,0BAA0B,EAAE;YAC9F,yGAAyG;SAC1G,CAAC,CAAC;IACL,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -39,6 +39,26 @@ Use real actions in the org; if not specified, preview uses AI to simulate (mock
|
|
|
39
39
|
|
|
40
40
|
Enable Apex debug logging during the agent preview conversation.
|
|
41
41
|
|
|
42
|
+
# flags.utterance.summary
|
|
43
|
+
|
|
44
|
+
Message to send to the agent; creates a new session, returns the response, and exits without starting the interactive preview.
|
|
45
|
+
|
|
46
|
+
# flags.session-id.summary
|
|
47
|
+
|
|
48
|
+
Session ID of an in-progress preview session; use with --utterance to send a message to that session and return the response without starting the interactive preview.
|
|
49
|
+
|
|
50
|
+
# error.sessionIdRequiresUtterance
|
|
51
|
+
|
|
52
|
+
When using --session-id, you must also specify --utterance.
|
|
53
|
+
|
|
54
|
+
# error.utteranceRequiresAgent
|
|
55
|
+
|
|
56
|
+
When using --utterance, specify the agent with --api-name or --authoring-bundle.
|
|
57
|
+
|
|
58
|
+
# output.sessionId
|
|
59
|
+
|
|
60
|
+
Session ID: %s
|
|
61
|
+
|
|
42
62
|
# examples
|
|
43
63
|
|
|
44
64
|
- Preview an agent by choosing from the list of available local Agent Script or published agents. If previewing a local Agent Script agent, use simulated mode. Use the org with alias "my-dev-org".
|
|
@@ -48,3 +68,11 @@ Enable Apex debug logging during the agent preview conversation.
|
|
|
48
68
|
- Preview an agent in live mode by choosing from a list of authoring bundles. Save the conversation transcripts to the "./transcripts/my-preview" directory, enable the Apex debug logs, and use your default org:
|
|
49
69
|
|
|
50
70
|
<%= config.bin %> <%= command.id %> --use-live-actions --apex-debug --output-dir transcripts/my-preview
|
|
71
|
+
|
|
72
|
+
- Send a message to the agent and print the response without starting the interactive preview (requires --api-name or --authoring-bundle):
|
|
73
|
+
|
|
74
|
+
<%= config.bin %> <%= command.id %> --authoring-bundle My_Agent_Bundle --utterance "What can you help me with?" --target-org my-dev-org
|
|
75
|
+
|
|
76
|
+
- Send a follow-up message to an existing preview session:
|
|
77
|
+
|
|
78
|
+
<%= config.bin %> <%= command.id %> --authoring-bundle My_Agent_Bundle --session-id <session-id> --utterance "Tell me more" --target-org my-dev-org
|