|
1 | 1 | # summary |
2 | 2 |
|
3 | | -Interact with an active agent to preview how the agent responds to your statements, questions, and commands (utterances). |
| 3 | +Interact with an agent to preview how it responds to your statements, questions, and commands (utterances). |
4 | 4 |
|
5 | 5 | # description |
6 | 6 |
|
7 | | -Use this command to have a natural language conversation with an active agent in your org, as if you were an actual user. The interface is simple: in the "Start typing..." prompt, enter a statement, question, or command; when you're done, enter Return. Your utterance is posted on the right along with a timestamp. The agent then responds on the left. To exit the conversation, hit ESC or Control+C. |
| 7 | +Use this command to have a natural language conversation with an agent while you code its Agent Script file. Previewing an agent works like an initial test to make sure it responds to your utterances as you expect. For example, you can test that the agent uses a particular topic when asked a question, and then whether it invokes the correct action associated with that topic. This command is the CLI-equivalent of the Preview panel in your org's Agentforce Builder UI. |
8 | 8 |
|
9 | | -This command is useful to test if the agent responds to your utterances as you expect. For example, you can test that the agent uses a particular topic when asked a question, and then whether it invokes the correct action associated with that topic. This command is the CLI-equivalent of the Conversation Preview panel in your org's Agent Builder UI. |
| 9 | +This command uses the agent's local authoring bundle, which contains its Agent Script file. You can let the command provide a list of authoring bundles (labeled "(Agent Script)") to choose from or use the --authoring-bundle flag to specify a bundle's API name. |
10 | 10 |
|
11 | | -When the session concludes, the command asks if you want to save the API responses and chat transcripts. By default, the files are saved to the "./temp/agent-preview" directory. Specify a new default directory by setting the environment variable "SF_AGENT_PREVIEW_OUTPUT_DIR" to the directory. Or you can pass the directory to the --output-dir flag. |
| 11 | +You can use these two modes when previewing an agent from its Agent Script file: |
12 | 12 |
|
13 | | -Find the agent's API name in its Agent Details page of your org's Agentforce Studio UI in Setup. If your agent is currently deactivated, use the "agent activate" CLI command to activate it. |
| 13 | +- Simulated mode (Default): Uses only the Agent Script file to converse, and it simulates (mocks) all the actions. Use this mode if none of the Apex classes, flows, and prompt templates that implement your actions are available yet. The LLM uses the information about topics in the Agent Script file to simulate what the action does or how it responds. |
| 14 | +- Live mode: Uses the actual Apex classes, flows, and prompt templates in your development org in the agent preview. If you've changed the Apex classe, flows, or prompt templates in your local DX project, then you must deploy them to your development org if you want to use them in your live preview. You can use the Apex Replay Debugger to debug your Apex classes when using live mode. |
14 | 15 |
|
15 | | -IMPORTANT: Before you use this command, you must complete a number of configuration steps in your org and your DX project. For example, you must first create the link to a client connected app using the "org login web --client-app" CLI command to then get the value of the --client-app flag of this command. The examples in this help assume you've completed the steps. See "Preview an Agent" in the "Agentforce Developer Guide" for complete documentation: https://developer.salesforce.com/docs/einstein/genai/guide/agent-dx-preview.html. |
| 16 | +The interface is simple: in the "Start typing..." prompt, enter a statement, question, or command; when you're done, enter Return. Your utterance is posted on the right along with a timestamp. The agent then responds on the left. To exit the conversation, hit ESC or Control+C. |
| 17 | + |
| 18 | +When the session concludes, the command asks if you want to save the API responses and chat transcripts. By default, the files are saved to the "./temp/agent-preview" directory. Specify a new default directory with the --output-dir flag. |
| 19 | + |
| 20 | +NOTE: You can also use this command to connect to a published and active agent, which are labeled "(Published)" if you let this command provide the list of agents to preview. That use case, however, requires additional security and configuration in both your org and your DX project. The examples in this help are for previewing an agent from its Agent Script file in your DX project and require only simple authorization of your org, such as with the "org login web" command. The --client-app and --api-name flags are used only for previewing published and active agents, they don't apply to Agent Script agents. See "Connect to a Published Agent" in the "Agentforce Developer Guide" for complete documentation: https://developer.salesforce.com/docs/einstein/genai/guide/agent-dx-preview.html. |
16 | 21 |
|
17 | 22 | # flags.api-name.summary |
18 | 23 |
|
19 | | -API name of the agent you want to interact with. |
| 24 | +API name of the published and active agent you want to interact with. |
20 | 25 |
|
21 | 26 | # flags.authoring-bundle.summary |
22 | 27 |
|
23 | | -Preview a next-gen agent by specifying the API name of the authoring bundle metadata component that implements it. |
| 28 | +API name of the authoring bundle metadata component that contains the agent's Agent Script file. |
24 | 29 |
|
25 | 30 | # flags.client-app.summary |
26 | 31 |
|
27 | | -Name of the linked client app to use for the agent connection. |
| 32 | +Name of the linked client app to use for the connection to the published and active agent. |
28 | 33 |
|
29 | 34 | # flags.output-dir.summary |
30 | 35 |
|
31 | 36 | Directory where conversation transcripts are saved. |
32 | 37 |
|
33 | 38 | # flags.use-live-actions.summary |
34 | 39 |
|
35 | | -Use real actions in the org; if not specified, preview uses AI to mock actions. |
| 40 | +Use real actions in the org; if not specified, preview uses AI to simulate (mock) actions. |
36 | 41 |
|
37 | 42 | # flags.apex-debug.summary |
38 | 43 |
|
39 | 44 | Enable Apex debug logging during the agent preview conversation. |
40 | 45 |
|
41 | 46 | # examples |
42 | 47 |
|
43 | | -- Interact with an agent with API name Resort_Manager in the org with alias "my-org" and the linked "agent-app" connected app: |
| 48 | +- Preview an agent in simulated mode by choosing from a list of authoring bundles provided by the command; use the org with alias "my-dev-org": |
44 | 49 |
|
45 | | - <%= config.bin %> <%= command.id %> --api-name Resort_Manager --target-org my-org --client-app agent-app |
| 50 | + <%= config.bin %> <%= command.id %> --target-org my-dev-org |
46 | 51 |
|
47 | | -- Same as the preceding example, but this time save the conversation transcripts to the "./transcripts/my-preview" directory rather than the default "./temp/agent-preview": |
| 52 | +- 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: |
48 | 53 |
|
49 | | - <%= config.bin %> <%= command.id %> --api-name Resort_Manager --target-org my-org --client-app agent-app --output-dir transcripts/my-preview |
| 54 | + <%= config.bin %> <%= command.id %> --use-live-actions --apex-debug --output-dir transcripts/my-preview |
0 commit comments