Skip to main content

Creation and Generation

Pieces for Developers makes it simple to add materials as you find them. But, sometimes the best solution is written or generated code, instead of a more general solution.

Utilizing the power of ChatGPT, in-house AI models, and other multimodal strategies employed by the Pieces team, you can generate and create new snippets based off of others that you have saved.

Create Code from a Description

Use natural language to fully describe the code that will assist you in your project from the "Describe a Snippet" menu. To access this feature:

  1. Open the "Describe a Snippet" Overlay:

    • Select the "Add +" button beneath the carousel in Gallery View or the "+ Add Snippets" button in List View
    • Press ⌘/⌃ + ⇧ + P to open the overlay immediately
  2. After the menu opens, you can begin typing in the search bar (marked with a ">"). Here is an example phrase for you to try:

    Split a string based on spaces and print each item

    Before pressing enter - be sure to set the language to the output language that you would like to get back. This will be automatically set to the same language as the last snippet that you were focused on in the Gallery or List View.

  3. After generation completes, you will see the snippet in the language that you selected! You can save this snippet, or you can change the language and re-run generation.

Based on the snippets that you save and use daily, Pieces for Developers will help you discover related code snippets that are useful to you. By using semantic information, context, and usage, Pieces may surface the snippets that you've been looking for.

Using advanced AI, we generate these snippets based on the tags, links, and descriptions of existing snippets. Please note that this feature is not available for Images.

  1. From the Gallery View, select the pill that says "Discover Related" located under your current material

    Sometimes discovering related snippets can take 10 - 15 seconds as Pieces evaluates your saved snippets finds other relatable materials.

  2. Once Discovery is complete, you can select the snippets you'd like to save from those presented. Navigate these using your arrow keys or by hovering and pressing the arrows that reveal themselves.

  3. Hit Save in the top right and any selected snippets will be added into Pieces for Developers for future reference, sharing, and reuse.

While we continue to improve the prompts, we recognize that results may be mixed at times. We're committed to making this feature as helpful as possible, but if you encounter any issues, please reach out to us.