Skip to content

Commit 34689f0

Browse files
authored
Merge pull request #71 from salesforcecli/sh/remove-v1-commands
W-17715328 - feat: remove v1 agent create and generate spec commands
2 parents bf0cf6d + bf78c52 commit 34689f0

14 files changed

Lines changed: 667 additions & 1142 deletions

command-snapshot.json

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
"alias": [],
44
"command": "agent:create",
55
"flagAliases": [],
6-
"flagChars": ["f", "n", "o"],
7-
"flags": ["api-version", "flags-dir", "json", "name", "spec", "target-org"],
8-
"plugin": "@salesforce/plugin-agent"
9-
},
10-
{
11-
"alias": [],
12-
"command": "agent:create-v2",
13-
"flagAliases": [],
146
"flagChars": ["o"],
157
"flags": [
168
"agent-api-name",
@@ -29,26 +21,6 @@
2921
"alias": [],
3022
"command": "agent:generate:spec",
3123
"flagAliases": [],
32-
"flagChars": ["d", "f", "o", "t"],
33-
"flags": [
34-
"api-version",
35-
"company-description",
36-
"company-name",
37-
"company-website",
38-
"file-name",
39-
"flags-dir",
40-
"json",
41-
"output-dir",
42-
"role",
43-
"target-org",
44-
"type"
45-
],
46-
"plugin": "@salesforce/plugin-agent"
47-
},
48-
{
49-
"alias": [],
50-
"command": "agent:generate:spec-v2",
51-
"flagAliases": [],
5224
"flagChars": ["o", "t"],
5325
"flags": [
5426
"agent-user",

messages/agent.create-v2.md

Lines changed: 0 additions & 51 deletions
This file was deleted.

messages/agent.create.md

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,51 @@
11
# summary
22

3-
Create an agent in your org from a local agent spec file.
3+
Create an agent in your org using a local agent spec file.
44

55
# description
66

7-
To generate an agent spec file, run the "agent generate spec" CLI command, which outputs a JSON 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.
7+
Before you run this command, you must first generate an agent spec file by running the "agent generate spec" CLI command, which outputs a YAML file with the agent properties and list of AI-generated topics. Topics define the range of jobs the agent can handle. Then specify the generated agent spec file to this command using the --spec flag, along with the name (label) of the new agent using the --agent-name flag.
88

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.
9+
When this command finishes, your org contains the new agent, which you can then edit in the Agent Builder UI. The new agent's topics are the same as the ones listed in the agent spec file. The agent might also have some AI-generated actions. This command also retrieves all the metadata files associated with the new agent to your local Salesforce DX project.
10+
11+
Use the --preview flag to review what the agent looks like without actually saving it in your org. Rather, the command creates a JSON file with all the agent details in the current directory.
1012

1113
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>".
1214

1315
# flags.spec.summary
1416

1517
Path to an agent spec file.
1618

17-
# flags.name.summary
19+
# flags.preview.summary
20+
21+
Preview the agent without saving it in your org.
22+
23+
# flags.agent-name.summary
24+
25+
Name (label) of the new agent.
26+
27+
# flags.agent-api-name.summary
28+
29+
API name of the new agent; if not specified, the API name is derived from the agent name (label); the API name must not exist in the org.
30+
31+
# flags.planner-id.summary
1832

19-
API name of the new agent.
33+
An existing GenAiPlanner ID to associate with the agent.
34+
35+
# error.missingRequiredFlags
36+
37+
Missing required flags: %s
38+
39+
# error.missingRequiredSpecProperties
40+
41+
Missing required spec file properties: %s
2042

2143
# examples
2244

23-
- Create an agent called "CustomerSupportAgent" in an org with alias "my-org" using the specified agent spec file:
45+
- Create an agent called "ResortManager" in an org with alias "my-org" using the specified agent spec file:
46+
47+
<%= config.bin %> <%= command.id %> --agent-name ResortManager --spec specs/resortManagerAgent.yaml --target-org my-org
48+
49+
- Preview the creation of an agent called "ResortManager" and use your default org:
2450

25-
<%= config.bin %> <%= command.id %> --name CustomerSupportAgent --spec ./config/agentSpec.json --target-org my-org
51+
<%= config.bin %> <%= command.id %> --agent-name ResortManager --spec specs/resortManagerAgent.yaml --preview

messages/agent.generate.spec-v2.md

Lines changed: 0 additions & 121 deletions
This file was deleted.

messages/agent.generate.spec.md

Lines changed: 84 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
# summary
22

3-
Generate an agent spec, which is the list of jobs that the agent performs.
3+
Generate an agent spec, which is a YAML file that captures what an agent can do.
44

55
# description
66

7-
When using Salesforce CLI to create an agent in your org, the first step is to generate the local JSON-formatted agent spec file with this command.
7+
Before you use Salesforce CLI to create an agent in your org, you must first generate an agent spec with this command. An agent spec is a YAML-formatted file that contains information about the agent, such as its role and company description, and then an AI-generated list of topics based on this information. Topics define the range of jobs your agent can handle.
88

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.
9+
Use flags, such as --role and --company-description, to provide details about your company and the role that the agent plays in your company. If you prefer, you can also be prompted for the information. Upon command execution, the large language model (LLM) associated with your org uses the information you provided to generate a list of topics for the agent. Because the LLM uses the company and role information to generate the topics, we recommend that you provide accurate and specific details so the LLM generates the best and most relevant topics. Once generated, you can edit the spec file; for example, you can remove topics that don't apply to your agent or change the description of a particular topic.
1010

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.
11+
You can iterate the spec generation process by using the --spec flag to pass an existing agent spec file to this command, and then using the --role, --company-description, etc, flags to refine your agent properties. Iteratively improving the description of your agent allows the LLM to generate progressively better topics.
12+
13+
You can also specify a custom prompt template that the agent uses, and ground the prompt template to add context and personalization to the agent's prompts.
14+
15+
When your agent spec is ready, you then create the agent in your org by running the "agent create" CLI command and specifying the spec with the --spec flag.
1216

1317
# flags.type.summary
1418

@@ -30,20 +34,88 @@ Description of your company.
3034

3135
Website URL of your company.
3236

33-
# flags.output-dir.summary
37+
# flags.output-file.summary
38+
39+
Path for the generated YAML agent spec file; can be an absolute or relative path.
40+
41+
# flags.max-topics.summary
42+
43+
Maximum number of topics to generate in the agent spec; default is 10.
44+
45+
# flags.max-topics.prompt
46+
47+
Max number of topics to generate (1-30)
48+
49+
# flags.prompt-template.summary
50+
51+
API name of a customized prompt template to use instead of the default prompt template.
52+
53+
# flags.grounding-context.summary
54+
55+
Context information and personalization that's added to your prompts when using a custom prompt template.
56+
57+
# flags.spec.summary
58+
59+
Agent spec file, in YAML format, to use as input to the command.
60+
61+
# flags.full-interview.summary
62+
63+
Prompt for both required and optional flags.
64+
65+
# flags.agent-user.summary
66+
67+
Username of a user in your org to assign to your agent; determines what your agent can access and do.
68+
69+
# flags.agent-user.prompt
3470

35-
Directory where the agent spec file is written; can be an absolute or relative path.
71+
Username for agent
3672

37-
# flags.file-name.summary
73+
# flags.enrich-logs.summary
3874

39-
Name of the generated agent spec file.
75+
Adds agent conversation data to event logs so you can view all agent session activity in one place.
76+
77+
# flags.enrich-logs.prompt
78+
79+
Enrich event logs
80+
81+
# flags.tone.summary
82+
83+
Conversational style of the agent, such as how it expresses your brand personality in its messages through word choice, punctuation, and sentence structure.
84+
85+
# flags.tone.prompt
86+
87+
Agent conversation tone
88+
89+
# flags.primary-language.summary
90+
91+
Language the agent uses in conversations.
92+
93+
# flags.no-prompt.summary
94+
95+
Don't prompt the user to confirm spec file overwrite.
4096

4197
# examples
4298

43-
- 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:
99+
- Generate an agent spec in the default location and use flags to specify the agent properties, such as its role and your company details; use your default org:
100+
101+
<%= config.bin %> <%= command.id %> --type customer --role "Field customer complaints and manage employee schedules." --company-name "Coral Cloud Resorts" --company-description "Provide customers with exceptional destination activities, unforgettable experiences, and reservation services."
102+
103+
- Generate an agent spec by being prompted for the required agent properties and generate a maxiumum of 5 topics; write the generated file to the "specs/resortManagerSpec.yaml" file and use the org with alias "my-org":
104+
105+
<%= config.bin %> <%= command.id %> --max-topics 5 --output-file specs/resortManagerAgent.yaml --target-org my-org
106+
107+
- Specify an existing agent spec file called "specs/resortManagerAgent.yaml", and then overwrite it with a new version that contains newly AI-generated topics based on the updated role information passed in with the --role flag:
108+
109+
<%= config.bin %> <%= command.id %> --spec specs/resortManagerAgent.yaml --output-file specs/resortManagerAgent.yaml --role "Field customer complaints, manage employee schedules, and ensure all resort operations are running smoothly" --target-org my-org
110+
111+
# error.missingRequiredFlags
112+
113+
Missing required flags: %s
114+
115+
# confirmSpecOverwrite
44116

45-
<%= 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"
117+
Confirm overwrite of spec file %s?
46118

47-
- 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":
119+
# commandCanceled
48120

49-
<%= config.bin %> <%= command.id %> --output-dir specs --target-org my-org
121+
Command canceled by user confirmation.

0 commit comments

Comments
 (0)