forcedotcom / Einstein-GPT-for-Developers

Einstein GPT For Developers
BSD 3-Clause "New" or "Revised" License
37 stars 9 forks source link

Generated response often creates a new Apex class when I'm already within an Apex file #2

Closed AnanyaJha closed 1 year ago

AnanyaJha commented 1 year ago

Sometimes when I submit a prompt to generate an Apex method, I still get an Apex class in response. I'm already within an Apex file at this point, so the class declaration is unneccessary.

Repro Steps:

  1. Navigate to an existing Apex class file. Run the command from the Command Palette
  2. Input prompt like: Write an Apex method to compute the total opportunity value of all the Opportunities within a given Account, considering only the opportunities that are larger than the MINIMUM_OPP_SIZE constant which is declared elsewhere in the class.

Actual Response: Contains the class declaration public class OpportunityValueCompute { public static Decimal computeOpportunityValue(Account account) { xxx }}

Expected Response: Should not contain the class declaration

abrantes23 commented 1 year ago

Just 2 cents ideia: Salesforce model should be "aware" where in the code the mouse pointer is selected. If the apex class is empty, for me would be useful to create the class + method. If the class already is written with other methods, I would prefer to have just the method created.

gbockus-sf commented 1 year ago

This was largely addressed with the LLM update prior to DF. Closing for now as resolved, but please reopen if new situations where unexpected class/methods are generated.