Skip to content

Commit e7d8c79

Browse files
committed
Merge branch 'main' into cw/feat-add-prompt-template-actions
2 parents 6864738 + 1fb6aaa commit e7d8c79

File tree

43 files changed

+268
-162
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+268
-162
lines changed

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
22
"recommendations": [
33
"salesforce.salesforcedx-vscode",
4+
"salesforce.salesforcedx-vscode-agents",
5+
"salesforce.agent-script-language-client",
46
"redhat.vscode-xml",
57
"dbaeumer.vscode-eslint",
68
"esbenp.prettier-vscode"
9+
]
710
}

README.md

Lines changed: 6 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@ A collection of easy-to-digest [Agent Script](https://developer.salesforce.com/d
1111

1212
- [Prerequisites](#prerequisites)
1313

14-
- Install the app with either one of these options:
15-
- **Option 1:** [Developer Edition Org installation](#installing-the-app-using-a-developer-edition-org) - Use this option if you want the app deployed to a more permanent environment than a Scratch org.
16-
- **Option 2:** [Scratch Org installation](#installing-the-app-using-a-scratch-org) - Use this option if you are a developer who wants to experience the app and the code in a temporary environment.
14+
- [Installing the app using a Developer Edition Org](#installing-the-app-using-a-developer-edition-org)
1715

1816
- [Optional installation instructions](#optional-installation-instructions)
1917

2018
## Prerequisites
2119

22-
Regardless of the installation type you chose, make sure to review the following prerequisites.
20+
Make sure to review the following prerequisites before installing the app.
2321

2422
### Salesforce CLI Version
2523

@@ -46,83 +44,28 @@ sf org assign permset -n EinsteinGPTPromptTemplateManager
4644

4745
## Installing the app using a Developer Edition Org
4846

49-
Follow this set of instructions if you want to deploy the app to a more permanent environment than a Scratch org.
50-
This includes non source-tracked orgs such as a free [Developer Edition Org](https://developer.salesforce.com/signup).
47+
If you don't have an org yet, you can sign up for a free [Developer Edition Org](https://developer.salesforce.com/signup).
5148

5249
> [!IMPORTANT]
5350
> Make sure to start from a brand-new environment to avoid conflicts with previous work you may have done.
5451
55-
3. Clone this repository:
56-
57-
```bash
58-
git clone https://github.com/trailheadapps/agent-script-recipes
59-
cd agent-script-recipes
60-
```
61-
62-
4. Authorize your Developer Edition org and provide it with an alias (**agent-script-recipes** in the command below):
63-
64-
```bash
65-
sf org login web -s -a agent-script-recipes
66-
```
67-
68-
5. Deploy the app to your org:
69-
70-
```bash
71-
sf project deploy start -d force-app
72-
```
73-
74-
6. Assign the `Agent_Script_Recipes_Data` and `Agent_Script_Recipes_App` permission sets to the default user:
75-
76-
```bash
77-
sf org assign permset -n Agent_Script_Recipes_Data
78-
sf org assign permset -n Agent_Script_Recipes_App
79-
```
80-
81-
7. Import some sample data:
82-
83-
```bash
84-
sf data import tree --plan data/data-plan.json
85-
```
86-
87-
8. Open your org with the **Agentforce Studio** app displayed:
88-
89-
```bash
90-
sf org open -p "/lightning/n/standard-AgentforceStudio?c__nav=agents"
91-
```
92-
93-
> [!TIP]
94-
> **Agentforce Studio** can be reached from the App Launcher. From there, click **View All** then select the **Agentforce Studio** app.
95-
96-
**Post installation:** when working with the recipes, assign the **Agent Script Recipes Data** permission set to your agent user to avoid access issues.
97-
98-
## Installing the app using a Scratch Org
99-
100-
1. Follow these steps if you haven't configured a Dev Hub org:
101-
1. [Select and enable a Dev Hub org](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_setup_enable_devhub.htm). You can use a free [Developer Edition Org](https://developer.salesforce.com/signup).
102-
103-
1. Authorize your Dev Hub org and provide it with an alias (**myhuborg** in the command below):
104-
105-
```bash
106-
sf org login web -d -a myhuborg
107-
```
108-
10952
1. Clone this repository:
11053

11154
```bash
11255
git clone https://github.com/trailheadapps/agent-script-recipes
11356
cd agent-script-recipes
11457
```
11558

116-
1. Create a scratch org and provide it with an alias (**agent-script-recipes** in the command below):
59+
1. Authorize your Developer Edition org and provide it with an alias (**agent-script-recipes** in the command below):
11760

11861
```bash
119-
sf org create scratch -d -f config/project-scratch-def.json -a agent-script-recipes
62+
sf org login web -s -a agent-script-recipes
12063
```
12164

12265
1. Deploy the app to your org:
12366

12467
```bash
125-
sf project deploy start
68+
sf project deploy start -d force-app
12669
```
12770

12871
1. Assign the `Agent_Script_Recipes_Data` and `Agent_Script_Recipes_App` permission sets to the default user:

bin/delete-data.apex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ delete [SELECT Id FROM ASR_Task__c];
1919
delete [SELECT Id FROM ASR_Transaction_Log__c];
2020
delete [SELECT Id FROM ASR_Customer_Interest__c];
2121
delete [SELECT Id FROM ASR_Experience__c];
22+
delete [SELECT Id FROM ASR_Order__c];
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"records": [
3+
{
4+
"attributes": {
5+
"type": "Account",
6+
"referenceId": "acc_adv_reasoning"
7+
},
8+
"Name": "Pinnacle Solutions Inc",
9+
"Churn_Risk_Score__c": 0.5,
10+
"Contacts": {
11+
"records": [
12+
{
13+
"attributes": {
14+
"type": "Contact",
15+
"referenceId": "con_adv_reasoning"
16+
},
17+
"FirstName": "Sarah",
18+
"LastName": "Mitchell",
19+
"User_ID__c": "USER-12345",
20+
"Loyalty_Status__c": "Gold",
21+
"Lifetime_Value__c": 1500.0
22+
}
23+
]
24+
}
25+
}
26+
]
27+
}

data/advanced-reasoning-case.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"records": [
3+
{
4+
"attributes": {
5+
"type": "Case",
6+
"referenceId": "case_adv1"
7+
},
8+
"Subject": "Unable to access premium features",
9+
"Status": "Open",
10+
"ContactId": "@con_adv_reasoning"
11+
},
12+
{
13+
"attributes": {
14+
"type": "Case",
15+
"referenceId": "case_adv2"
16+
},
17+
"Subject": "Subscription renewal inquiry",
18+
"Status": "Closed",
19+
"ContactId": "@con_adv_reasoning"
20+
}
21+
]
22+
}

data/advanced-reasoning-order.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"records": [
3+
{
4+
"attributes": {
5+
"type": "ASR_Order__c",
6+
"referenceId": "order_adv1"
7+
},
8+
"AccountId__c": "@acc_adv_reasoning",
9+
"TotalAmount__c": 500.0,
10+
"EffectiveDate__c": "2024-12-15"
11+
},
12+
{
13+
"attributes": {
14+
"type": "ASR_Order__c",
15+
"referenceId": "order_adv2"
16+
},
17+
"AccountId__c": "@acc_adv_reasoning",
18+
"TotalAmount__c": 750.0,
19+
"EffectiveDate__c": "2024-11-15"
20+
}
21+
]
22+
}

data/data-plan.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
"resolveRefs": false,
1818
"files": ["travel-cruise-contact.json"]
1919
},
20+
{
21+
"sobject": "Account",
22+
"saveRefs": true,
23+
"resolveRefs": false,
24+
"files": ["advanced-reasoning-account.json"]
25+
},
2026
{
2127
"sobject": "ASR_Product__c",
2228
"saveRefs": true,
@@ -89,6 +95,18 @@
8995
"resolveRefs": false,
9096
"files": ["service-case.json"]
9197
},
98+
{
99+
"sobject": "ASR_Order__c",
100+
"saveRefs": true,
101+
"resolveRefs": true,
102+
"files": ["advanced-reasoning-order.json"]
103+
},
104+
{
105+
"sobject": "Case",
106+
"saveRefs": true,
107+
"resolveRefs": true,
108+
"files": ["advanced-reasoning-case.json"]
109+
},
92110
{
93111
"sobject": "ASR_Agent_Event_Log__c",
94112
"saveRefs": false,

force-app/future_recipes/complexStateManagement/aiAuthoringBundles/ComplexStateManagement/ComplexStateManagement.agent

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ start_agent topic_selector:
3838
description: "Welcome users and begin task management"
3939

4040
reasoning:
41+
instructions:|
42+
Select the tool that best matches the user's message and conversation history. If it's unclear, make your best guess.
4143
actions:
4244
begin_task_management: @utils.transition to @topic.task_management
4345
description: "Start managing tasks with complex state operations"

force-app/future_recipes/conditionalLogicPatterns/aiAuthoringBundles/ConditionalLogicPatterns/ConditionalLogicPatterns.agent

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,8 @@ start_agent topic_selector:
4242
description: "Welcome applicants and begin loan evaluation process"
4343

4444
reasoning:
45-
instructions: ->
46-
| Welcome to the loan application process. I'll help evaluate your loan application
47-
using comprehensive conditional logic to assess eligibility fairly and consistently.
48-
Let's start by gathering your information.
49-
45+
instructions:|
46+
Select the tool that best matches the user's message and conversation history. If it's unclear, make your best guess.
5047
actions:
5148
start_evaluation: @utils.transition to @topic.loan_evaluation
5249
description: "Begin the loan evaluation with conditional logic"

force-app/future_recipes/contextHandling/aiAuthoringBundles/ContextHandling/ContextHandling.agent

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ start_agent topic_selector:
4444
description: "Welcome users with personalized greeting based on context"
4545

4646
reasoning:
47+
instructions:|
48+
Select the tool that best matches the user's message and conversation history. If it's unclear, make your best guess.
4749
actions:
4850
begin_service: @utils.transition to @topic.personalized_service
4951
description: "Start providing personalized service"

0 commit comments

Comments
 (0)