Add the #DF24 Developer Keynote to your agenda. Join us in-person on 9/19 at 2:30 p.m. PT or on Salesforce+ at 5 p.m. PT for the must-see session built just for developers.

Chat with Dev Assistant

Dev Assistant is like having a coding partner who's ready to help you write Apex and LWC code. Just chat with it, write instructions, or ask questions. To access the chat interface, click the Einstein icon in the Activity Bar. Once activated, Einstein is grounded in the context of your open file, and the ongoing conversation. Dev Assistant will suggest code based on what you write and the file you're working on in your Visual Studio Code editor. After you receive a response from Einstein, you can make a follow-up request to fine-tune the response.

See Effective Prompt Writing to learn more about interacting with Dev Assistant.

Einstein MTC

To frame your query, use slash commands.They’re like ready-made prompt templates. Use them as-is or add details to get more specific responses. Type ‘/’ to see a list of available commands. After you get a response, keep chatting to increase the response accuracy.

CommandPrompt Description
/explainExplain the code in the active editor.
/testGenerate a test case.
/documentGenerate documentation for the given code block in the default documentation scheme for the current file's programming language.

Some users, who’ve been picked at random, are getting an additional benefit of having Retrieval Augmented Generation (RAG) turned on for their workspace. RAG generates context-aware responses to your prompts. This means that with RAG activated, Einstein considers information about SObjects in your DX project, the currently active file, and previous messages in the chat when generating a response. To get the right information to the RAG framework, run SFDX: Refresh SObjects Definitions to bring in org metadata in the form of object definitions into your project before making your request.

To verify if RAG is activated in your workspace, go to Settings and search for "Einstein for Developers". There you'll see a setting checkbox for RAG if you have it turned on. You can toggle this setting to turn RAG off and on at any time. For best outcomes, we recommend using RAG on devices with more than than 8 GB of RAM.

  • Ask general questions about building on Salesforce

    How do I expose my Apex method to a Lightning Web Component?

  • Ask questions about your Salesforce project

    /explain What is the getSimilarProducts() method doing?

  • Write Apex and LWC code

    Create a Lightning web component that uses the lightning-input attribute

  • Once you receive a response, follow up with:

    In fact, I'd like to add a rich text input area to my LWC. Let's use the lightning-input-rich-text attribute.

  • Generate a test for a given Apex method

    /test Generate a test for the getSimilarProducts() method

  • What level of Apex code coverage do I currently have in my SFDX project?

  • Give me an example of how I would enforce USER_MODE in Apex

  • Add error handling to getSimilarProducts() from my editor

This is a list of known issues with Dev Assistant. The team is working on them internally. Check our github repo for issues related to Einstein for Developers.

  • We know that there can be incorrect spacing between words in the generated output. We're working on it.
  • /explain explains everything in your active editor, regardless of your current selection.
  • Even if you have multiple tabs open in the IDE, Einstein considers the context of the active tab.
  • Einstein occasionally generates code or metadata that you don't have locally. Sometimes, Einstein makes grammatical errors. To help us improve the model, report any errors you find in the prompt, response, and code by creating an issue in our GitHub repo.
  • The model that powers Dev Assistant has been specifically trained to iteratively generate Apex code. This means it can generate more accurate and higher quality Apex code compared to its other responses. With continued fine-tuning efforts, we expect the model to iteratively serve better responses for other request types.