Interacting with Tabnine Chat
Last updated
Was this helpful?
Last updated
Was this helpful?
How to interact with Tabnine Chat
You can interact and trigger Tabnine Chat in three ways:
Go to the bottom of the Tabnine Chat panel, enter a free text question or instruction, and then click Enter.
Tabnine Chat's answer will be rendered quickly:
Another recommended option is to select a block of code from the current open file and then ask a question regarding this code. This draws Tabnine Chat's attention to the relevant code:
You can ask 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.
In the natural language prompt, you can use Mentions.
Mentions (using the @ symbol) are a way to ask Tabnine Chat to use a specific code element (type, method, or class) from the workspace in the query context. Mentions allow the user to leverage their domain knowledge and help the AI by explicitly focusing it on relevant context from the workspace.
Notes:
Mentions work for each language with Language Server Protocol (LSP) support in the IDE.
Type 2-3 characters after the “@” to view the available code elements.
Learn more about the Tabnine Chat context and prompt engineering.
Some tasks or instructions are common, so Tabnine Chat includes them as built-in actions.
The following actions operate on the selected code:
explain-code: Explains what the selected code is doing
generate-test-for-code: Writes tests for the selected code
document-code: Suggests documentation for the selected code
fix-code: Fixes the errors (detected by the IDE) for the selected code
You can trigger quick actions by clicking the relevant links when you start a new chat session:
Another option is to use "/" to view the available quick actions. Select the action you want and click Enter.
In addition to the predefined commands provided by Tabnine, you can define your own custom commands. This can be useful for repetitive tasks that are specific to your domain:
To define your own quick action, follow these steps:
On the Chat settings tab, click Add in the Define custom commands section.
Fill in the slash command name, description, and prompt template fields in the Define new Command dialog. Use $ to include a reference to the selected code or open file and save the custom command.
Use the slash ("/") to trigger your custom commands in the chat prompt.
Note: Custom commands are personal and saved on the local machine, per IDE. They're not shared between different users or between different IDEs on the same machine. However, they can be shared through an SCM tool.
You can then choose to share with your team members, which will prompt Tabnine to create a .tabnine_commands file within each repository.
Users can easily create, edit, and delete commands through this file. The shared file is the single source of truth for commands, making collaboration more seamless and efficient. Each team will be responsible for managing this file. At this time, shared commands do not support mentions.
Available in these IDEs (for these languages):
VS Code (Java, Python, TypeScript & TSX, JavaScript & JSX, Ruby, Go, Rust, Swift, C/C++, C#, PHP)
JetBrains (Java, Python, TypeScript, Rust, Kotlin, PHP, GO, C/CPP, C#)
Visual Studio (all supported languages)
You can trigger the quick actions for the scope of a specific method by clicking the floating Tabnine quick actions:
You can now customize your Tabnine AI Chat experience even further, allowing for more control over chat response length and style. Users can pick between “Concise” for a shorter answer, and “Comprehensive” for a longer, further explanation to your prompts in Chat.
On the Chat settings tab, click the Response Length section.
From there, you can select either Concise or Comprehensive.
Concise is the default Chat Response Length.
You can specify how Tabnine AI Chat will behave in certain ways (e.g., “Respond like a mentor with step-by-step instructions and examples” or “Respond in German/Spanish”).
Follow these steps to define your custom chat behavior:
On the Chat settings tab, click Set in the Define custom behavior section.
From there, you can determine how Tabnine will act before you prompt the AI Chat.
Click on the Settings () icon in Tabnine Chat.
Click on the Settings () icon in Tabnine Chat.
Click on the Settings () icon in Tabnine Chat.