@salesforce/plugin-agent 1.19.5 → 1.20.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.
@@ -1,20 +1,49 @@
1
1
  # summary
2
2
 
3
- Interact with an active agent, as a user would, to preview responses
3
+ Interact with an active agent to preview how the agent responds to your statements, questions, and commands (utterances).
4
4
 
5
5
  # description
6
6
 
7
- XXX
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.
8
8
 
9
- # flags.name.summary
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.
10
10
 
11
- The name of the agent you want to preview
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.
12
12
 
13
- # flags.name.description
13
+ Find the agent's API name in its main details page in your org's Agent page in Setup.
14
14
 
15
- the API name of the agent? (TBD based on agents library)
15
+ Before you use this command, you must complete these steps:
16
+
17
+ 1. Create a connected app in your org as described in the "Create a Connected App" section here: https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#create-a-connected-app. Do these additional steps:
18
+
19
+ 1. When specifying the connected app's Callback URL, add this second callback URL on a new line: http://localhost:1717/OauthRedirect
20
+
21
+ 2. Make note of the user that you specified as the "Run As" user when updating the Client Credentials Flow section.
22
+
23
+ 2. Add the connected app to your agent as described in the "Add Connected App to Agent" section here: https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#add-connected-app-to-agent.
24
+
25
+ 3. Using the username of the user you specified as the "Run As" user above, authorize your org using the JWT flow, as described in this document: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_jwt_flow.htm.
26
+
27
+ 4. When you run this command to interact with an agent, specify the username you authorized in the preceding step with the --connected-app-user (-a) flag.
28
+
29
+ # flags.api-name.summary
30
+
31
+ API name of the agent you want to interact with.
32
+
33
+ # flags.connected-app-user.summary
34
+
35
+ Username or alias of the connected app user that's configured with JWT-based access tokens to the agent.
36
+
37
+ # flags.output-dir.summary
38
+
39
+ Directory where conversation transcripts are saved.
16
40
 
17
41
  # examples
18
42
 
19
- - <%= config.bin %> <%= command.id %> --name HelpDeskAgent
20
- - <%= config.bin %> <%= command.id %> --name ConciergeAgent --target-org production
43
+ - Interact with an agent with API name "Resort_Manager" in the org with alias "my-org". Connect to your agent using the alias "my-jwt-user"; this alias must point to the username who is authorized using JWT:
44
+
45
+ <%= config.bin %> <%= command.id %> --api-name "Resort_Manager" --target-org my-org --connected-app-user my-jwt-user
46
+
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":
48
+
49
+ <%= config.bin %> <%= command.id %> --api-name "Resort_Manager" --target-org my-org --connected-app-user my-jwt-user --output-dir "transcripts/my-preview"