You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generate an agent template from an existing agent in your DX project so you can then package the template in a managed package.
3
+
Generate an agent template from an existing agent in your DX project so you can then package the template in a second-generation managed package.
4
4
5
5
# description
6
6
7
-
At a high-level, agents are defined by the Bot, BotVersion, and GenAiPlannerBundle metadata types. The GenAiPlannerBundle type in turn defines the agent's topics and actions. This command uses the metadata files for these three types, located in your local DX project, to generate a BotTemplate file for a specific agent (Bot). You then use the BotTemplate file, along with the GenAiPlannerBundle file that references the BotTemplate, to package the template in a managed package that you can share between orgs or on AppExchange.
7
+
WARNING: This command doesn't work for agents that were created from an Agent Script file. In other words, you can't currently package an agent template for agents that use Agent Script.
8
8
9
-
Use the --agent-file flag to specify the relative or full pathname of the Bot metadata file, such as force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml. A single Bot can have multiple BotVersions, so use the --agent-version flag to specify the version. The corresponding BotVersion file must exist locally. For example, if you specify "--agent-version 4", then the file force-app/main/default/bots/My_Awesome_Agent/v4.botVersion-meta.xml must exist.
9
+
At a high-level, agents are defined by the Bot, BotVersion, and GenAiPlannerBundle metadata types. The GenAiPlannerBundle type in turn defines the agent's topics and actions. This command uses the metadata files for these three types, located in your local DX project, to generate a BotTemplate metadata file for a specific agent (Bot). You then use the BotTemplate metadata file, along with the GenAiPlannerBundle metadata file that references the BotTemplate, to package the template in a managed package that you can share between orgs or on AppExchange.
10
10
11
-
The new BotTemplate file is generated in the "botTemplates" directory in your local package directory, and has the name <Agent_API_name>_v<Version>_Template.botTemplate-meta.xml, such as force-app/main/default/botTemplates/My_Awesome_Agent_v4_Template.botTemplate-meta.xml. The command displays the full pathname of the generated files when it completes.
11
+
Use the --agent-file flag to specify the relative or full pathname of the Bot metadata file, such as force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml. A single Bot can have multiple BotVersions, so use the --agent-version flag to specify the version. The corresponding BotVersion metadata file must exist locally. For example, if you specify "--agent-version 4", then the file force-app/main/default/bots/My_Awesome_Agent/v4.botVersion-meta.xml must exist.
12
+
13
+
The new BotTemplate metadata file is generated in the "botTemplates" directory in the output directory specified with the --output-dir flag, and has the name <Agent_API_name>\_v<Version>\_Template.botTemplate-meta.xml, such as my-package/botTemplates/My_Awesome_Agent_v4_Template.botTemplate-meta.xml. The command displays the full pathname of the generated files when it completes.
14
+
15
+
See "Develop and Package Agent Templates Using Scratch Orgs" (https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/dev2gp_package_agent_templates.htm) for details about the complete process, which includes using a scratch org to create and test the agent, retrieving the agent metadata to your DX project, running this command to create the agent template, and then packaging the template.
12
16
13
17
# examples
14
18
15
-
- Generate an agent template from a Bot metadata file in your DX project that corresponds to the My_Awesome_Agent agent; use version 1 of the agent.
19
+
- Generate an agent template from the My_Awesome_Agent Bot metadata file in your DX project and save the BotTemplate and GenAiPlannerBundle to the specified directory; use version 1 of the agent. The agent that the template is based on is in the org with alias "my-scratch-org":
@@ -24,22 +28,59 @@ Version of the agent (BotVersion).
24
28
25
29
Path to an agent (Bot) metadata file.
26
30
31
+
# flags.output-dir.summary
32
+
33
+
Directory where the generated BotTemplate and GenAiPlannerBundle files are saved.
34
+
35
+
# flags.source-org.summary
36
+
37
+
Username or alias of the namespaced scratch org that contains the agent which this template is based on.
38
+
27
39
# error.invalid-agent-file
28
40
29
-
Invalid Agent file. Must be a Bot metadata file. Example: force-app/main/default/bots/MyBot/MyBot.bot-meta.xml
41
+
Invalid Agent file. Must be a Bot metadata file. Example: force-app/main/default/bots/MyBot/MyBot.bot-meta.xml.
30
42
31
43
# error.no-entry-dialog
32
44
33
-
No entryDialog found in BotVersion file.
45
+
No entryDialog found in the BotVersion metadata file.
34
46
35
47
# error.invalid-bot-type
36
48
37
49
The 'type' attribute of this Bot metadata component XML file can't have a value of 'Bot', which indicates that it's an Einstein Bot and not an agent: %s.
38
50
39
51
# error.no-label
40
52
41
-
No label found in Agent (Bot) file: %s.
53
+
No label found in Agent (Bot) metadata file: %s.
42
54
43
55
# error.no-ml-domain
44
56
45
57
No botMlDomain found in Agent (Bot) file: %s.
58
+
59
+
# error.local-topics-without-source
60
+
61
+
The local topic (genAiPlugin) you're trying to include in the agent template doesn't have a reference to a global topic. All topics in the agent template must be global assets defined in the Agent Asset Library in the source org that contains the agent that the template is based on.
62
+
%s.
63
+
64
+
# error.local-actions-without-source
65
+
66
+
The local action (genAiFunction) you're trying to include in the agent template doesn't have a reference to a global action. All actions in the agent template must be global assets defined in the Agent Asset Library in the source org that contains the agent that the template is based on.
67
+
%s.
68
+
69
+
# warn.reference-asset-from-managed-package
70
+
71
+
The local asset (genAiPlugin or genAiFunction) that you're including in the agent template references an asset from a managed package. Make sure that the managed package is defined as a dependency in the sfdx-project.json file:
72
+
%s.
73
+
74
+
# error.global-asset-not-found
75
+
76
+
The following assets (genAiPlugin or genAiFunction) that you're including in the agent template reference an asset that isn't in the source org:
77
+
%s.
78
+
79
+
# error.nga-agent-not-supported
80
+
81
+
This command doesn't work for agents that were created from an Agent Script file. In other words, you can't currently package an agent template for agents that use Agent Script.
82
+
83
+
# warn.copied-asset-directories
84
+
85
+
The following directories have been copied to the target path. Review their contents and remove any unnecessary assets:
0 commit comments