Writing prompts

How to write the most effective prompts in Tabnine Chat

  • Don't ask for multiple tasks at once.

  • Plan your task step by step.

  • For each step, be as specific and detailed as you can.

  • Write clear, well-written prompts.

  • Write prompts in English. You can try other languages, but English will probably return better results.

  • Select the most relevant context: Select or mention the most relevant function or block of code.

You can try and type anything you want, but keep in mind that Tabnine Chat was designed to answer questions related to code. If you write good prompts, that are specific, detailed, and to the point, you increase the chances of getting an accurate and useful result.

Learn more on the Tabnine Chat context and prompt engineering.

Example 1: Sort a list of words

  • sort words This is too generic

  • write a method that sorts a list of Strings This is ok

  • write a function that gets a list of Strings as an input and returns that list of Strings ordered by Strings lengths and then alphabetically This is great

Example 2: Refactor to meaningful variable names

  • refactor this code This is too generic

  • change var names This is not explicit enough

  • how would you improve the variable names in this code? This is great

Last updated