Creation and Generation

In Pieces for Developers, we make 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 models, and other 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. You can access this menu by:

  1. Opening the "Describe a Snippet" Overlay:

    • Selecting the "Add +" button beneath the carousel
    • Pressing CMD + Shift + P / CTRL + Shift + 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 your carousel.

  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.

Discover Related Snippets#

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.

Discovering Related Snippets with Pieces for Developers:#

  1. From the Carousel, 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 the snippets 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 the future!

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, and we're excited for you to try it out!