Skip to content

Commit 1f6ca87

Browse files
Revise agent preview command documentation
Updated the descriptions and examples for agent preview command to clarify usage and functionality, including details on simulated and live modes.
1 parent e890203 commit 1f6ca87

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

messages/agent.preview.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,54 @@
11
# summary
22

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).
44

55
# description
66

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.
88

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.
1010

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:
1212

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.
1415

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.
1621

1722
# flags.api-name.summary
1823

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.
2025

2126
# flags.authoring-bundle.summary
2227

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.
2429

2530
# flags.client-app.summary
2631

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.
2833

2934
# flags.output-dir.summary
3035

3136
Directory where conversation transcripts are saved.
3237

3338
# flags.use-live-actions.summary
3439

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.
3641

3742
# flags.apex-debug.summary
3843

3944
Enable Apex debug logging during the agent preview conversation.
4045

4146
# examples
4247

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":
4449

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
4651

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:
4853

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

Comments
 (0)