LogoLogo
Tabnine websiteContact Sales
  • 👋Welcome
    • Overview
      • Architecture
        • Deployment options
      • Security
      • Privacy
      • Protection
        • Provenance and Attribution
      • Personalization
        • Tabnine’s Personalization in Depth
        • Connection: Global Codebase Awareness
      • AI Models
        • Tabnine's private and protected Universal models
        • Tabnine's fine-tuned AI models
      • Integrations
        • Atlassian Jira
      • System Requirements
      • Supported Languages
      • Supported IDEs
      • Tabnine Subscription Plans
        • Dev Preview
        • Dev
        • Enterprise (SaaS)
        • Enterprise (private installation)
    • Support & Feedback
  • 🚀Getting started
    • Install
      • Client setup (SaaS)
        • VS Code
          • Install Tabnine in VS Code
          • Activate Tabnine in VS Code
        • JetBrains IDEs
          • Install Tabnine in a JetBrains IDE
          • Activate Tabnine in a JetBrains IDE
        • Visual Studio
          • Install Tabnine in Visual Studio 2022
          • Activate Tabnine in Visual Studio 2022
        • Eclipse
          • Install Tabnine in Eclipse
          • Activate Tabnine in Eclipse
        • Sign in
          • Using an email
          • Using an authentication token
      • Client setup (private installation)
        • Join your team (private installation)
        • VS Code (private installation)
        • JetBrains IDEs (private installation)
        • Visual Studio (private installation)
        • Eclipse (private installation)
    • Quickstart Guide
      • Menus and Icons
    • Getting the Most from Tabnine Code Completions
      • Pause (snooze)
    • Getting the Most from Inline Actions
    • Getting the Most from Tabnine Chat
      • Launching Tabnine Chat
      • Interacting with Tabnine Chat
      • Reviewing suggestions
      • Writing prompts
      • Chat Context
        • Understanding Context
        • Jira Connection
        • Context Scoping
      • Conversing with Tabnine Chat
      • Switching between chat AI models
      • Image Prompts
      • Tabnine's Prompting Guide
        • Getting Started
        • Basic Prompting
          • Be specific and clear
          • Define the context
          • Start a fresh conversation as appropriate
          • Include necessary details
          • Ask for examples
          • Be concise but complete
  • 💪Software Development with Tabnine
    • Overview
    • Plan
    • Create
    • Test
      • Intro to the Test Agent
      • Test Agent Workflow
      • Custom Commands
      • Generate Test Files with @Mentions
    • Review
    • Fix
    • Document
    • Explain
    • Maintain
  • 🏭Administering Tabnine
    • Start a team
    • Manage a team
    • SaaS
      • Enterprise (SaaS) team admin
        • Set up a Tabnine Enterprise (SaaS) account
        • Invite team members
        • Manage your team
        • AI models for Chat (Enterprise SaaS)
      • Enterprise (SaaS) team member
        • Join your Tabnine team by invitation email (team member)
        • Join Tabnine team by link (member)
    • Private installation
      • Server setup guide
        • Kubernetes (MicroK8s) Installation guide
        • Deployment guide
          • Tabnine update guide
        • Air-gapped deployment guide
      • Admin guide
        • Monitoring Tabnine
        • Prometheus Operator install
        • Audit logs
      • Managing your team
        • Tabnine teams
        • Roles in an enterprise
        • Inviting users to your team
        • Deactivating and reactivating users
        • Deleting PII data of a deactivated user
        • Reset user's password
        • Usage reports
          • Reports Glossary
          • CSV-based reports (V2)
            • Configuring scheduled CSV reports
            • CSV-based reports V1 (Depracted since version 5.7.0
          • Usage API
        • Settings
          • General
          • Single Sign-On (SSO)
          • Personalization (f.k.a. Workspace)
            • Connecting to External Code Repositories
          • Email
          • License
          • Models
          • Access Tokens
        • IdP Sync
      • Release Notes
  • 📣Product Updates
    • What's new?
      • What's new? (August 2024)
      • What's new? (July 2024)
      • What's new? (June 2024)
      • What's new? (May 2024)
      • What's new? (April 2024)
      • What's new? (March 2024)
      • What's new? (February 2024)
      • What's new? (January 2024)
Powered by GitBook
On this page
  • 1. Refer to the relevant entity or select it in the editor
  • 2. Using (or not using) workspace context
  • 3. Using Mentions to refer to a specific code element outside of the currently opened files

Was this helpful?

  1. Getting started
  2. Getting the Most from Tabnine Chat
  3. Tabnine's Prompting Guide
  4. Basic Prompting

Define the context

Last updated 6 months ago

Was this helpful?

General rule: Provide context about the task, the project, or the specific issue you are dealing with.

1. Refer to the relevant entity or select it in the editor

Here is the referenced function in the text editor:

As an alternative to mentioning the function name in the prompt, you can also select the code in the editor or use the CodeLens ask option just above the code. Selecting the code in the current open file provides Tabnine Chat with explicit context. If you'd like to perform operations on specific code, be sure to select the code in the IDE before you ask Chat to operate it.

Less effective: prompt Improve this code:

More effective: with the relevant code context made explicit as described above, prompt Refactor the function printCelsius to have the formula just once:

2. Using (or not using) workspace context

Here is the workspace context selector with the toggle switched off:

Using the same reference code in example 1 above, here is the response to the prompt Modify this code to convert from Celsius to Fahrenheit with workspace context on:

Here is the response to the same prompt with the workspace context turned off:

3. Using Mentions to refer to a specific code element outside of the currently opened files

Using workspace context is a form of that Tabnine offers to improve the quality of responses from an LLM that was not trained on your existing code base. If workspace context is enabled by your team admin, it is on by default. The toggle to control whether it is on or off is in the lower right corner of the Tabnine Chat window.

It is not always best to add more context (such as by opening a large number of files in the workspace). Only the most recently touched 2 files in the text editor will be loaded into the context window. In cases where you do not want to open additional files, you can use to reference specific files, methods or functions elsewhere in your local workspace as part of your prompt.

🚀
personalization
Mentions