diff --git a/docs/_articles/en/einstein/einstein-example-prompts.md b/docs/_articles/en/einstein/einstein-example-prompts.md index 62db1c3e5a..0defab86a1 100644 --- a/docs/_articles/en/einstein/einstein-example-prompts.md +++ b/docs/_articles/en/einstein/einstein-example-prompts.md @@ -29,25 +29,13 @@ Currently the CodeGen2.5 model can pick up on the following context from your pr We’re listing some tips for prompt writing and also providing you with some examples that help you craft your prompts. An effective prompt consists of these four parts: -1. **The Action**: The task you want the AI to accomplish. +**Action**: The task you want the AI to accomplish. For example, "_Create an Apex batch class named "OpenPositionMatcher"_". -For example: -_Create an Apex batch class named "OpenPositionMatcher"_. +**Context Details**: Information about the context you want the AI to use. This includes important context such as org metadata and awareness about the presence of custom objects and fields in your org. Run **SFDX:Refresh SObjects Definitions** to retrieve org metadata into your project. You can then add custom fields to your existing query. For example, "_Create an Apex batch class named "OpenPositionMatcher" that processes "Position\_\_c" records created within the past 15 days. The class should match these open positions with suitable candidates based on their skills._". -2. **Context Details**: Information about the context you want the AI to use. This includes important context such as org metadata and awareness about the presence of custom objects and fields in your org. Run **SFDX:Refresh SObjects Definitions** to retrieve org metadata into your project. You can then add custom fields to your existing query. +**Best Practices**: Details about best practices you want the AI to follow such as security and formatting best practices. For example, "_Create an Apex batch class named "OpenPositionMatcher" that processes custom objects "Position\_\_c" records created within the past 15 days. The class aims to match these open positions with suitable candidates based on their skills. Order the results by candidate names in descending order. Make sure the generated code follows security best practices. Separate operators with a new line._". -For example: -_Create an Apex batch class named "OpenPositionMatcher" that processes "Position\_\_c" records created within the past 15 days. The class should match these open positions with suitable candidates based on their skills._ - -3. **Best Practices**: Details about best practices you want the AI to follow. For example, security and formatting best practices and so on. - -For example: -_Create an Apex batch class named "OpenPositionMatcher" that processes custom objects "Position\_\_c" records created within the past 15 days. The class aims to match these open positions with suitable candidates based on their skills. Order the results by candidate names in descending order. Make sure the generated code follows security best practices. Separate operators with a new line._ - -4. **Additional Context**: Any additional information that you want to provide. - -For example: -_Create an Apex batch class named "OpenPositionMatcher" that processes custom objects "Position\_\_c" records created within the past 15 days. The class should match these open positions with suitable candidates based on their skills." Order the results by candidate names in descending order. Make sure the generated code follows security best practices. Separate operators with a new line. The class is used in an LWC component._ +**Additional Context**: Any additional information that you want to provide. For example, "_Create an Apex batch class named "OpenPositionMatcher" that processes custom objects "Position\_\_c" records created within the past 15 days. The class should match these open positions with suitable candidates based on their skills." Order the results by candidate names in descending order. Make sure the generated code follows security best practices. Separate operators with a new line. The class is used in an LWC component._". The final prompt gives you a response that looks something like this: @@ -82,40 +70,25 @@ public with sharing class OpenPositionMatcher { ``` ## Example Prompts and Context Descriptions -
Prompt | -Context Description | -
---|---|
Create a class named `OpportunityController`. Create a method called `getNumberofOpportunities`. The method takes `AccountId` as a parameter and returns the number of opportunities for that `AccountId`. I’m working on an LWC component. Make sure the SOQL uses security best practices like user mode data operations. | -
- |
-
Write an Apex class called `VehiclePartInventoryClass` for the custom object `Vehicle__c`, which has a many-to-many relationship with the `Parts__c` custom object. The class includes a method called `getVehiclesByParts` that accepts a Set of Strings. This method retrieves all the vehicle records associated with each part and returns a `Map |
-
-
|
- Create a method that takes a `settingName` as input and returns the value of the first record in `Setting__mdt` where `QualifiedApiName` matches the `settingName`; return null if no records are found. | -
-
|
Write a method that takes an Id as an argument. It compares the input Id with the value returned by the getStagingOrgId() method, and returns a boolean based on whether they match. | -
|