Alita Code

Get Started with Alita Code

Welcome to the Alita Code your comprehensive resource for harnessing the power of the ultimate AI-powered IDE extension that's set to transform your coding workflow. Alita Code integrates seamlessly with VS Code and InteliiJ, offering intelligent suggestions, automating routine tasks, and providing a level of adaptability that's unmatched, all designed to elevate your coding experience.

Why Choose Alita Code?

Alita Code is not just another IDE extension. It's a revolutionary tool designed to:

Key Features

Alita Code comes packed with features designed to streamline your development process:

Alita Code for VS Code

Alita Code is a visual studio extension to handle prompt-engineering based code generation using ELITEA as a backend.

Installation

Getting started with Alita Code is straightforward and involves a few simple steps:

  1. Open VS Code and navigate to the Extensions section.
  2. In the Marketplace, search for Alita Code and click Install.

VS-AlitaCode_Install

Configuration on ELITEA HUB

To configure the necessary parameters for the Alita Code extension, follow these steps:

  1. Go to Settings → Configuration on the ELITEA HUB.
  2. Click the + icon to create a new token.
  3. Enter a name and set an expiration date for the token.
  4. Click Generate to create the token.
  5. Immediately copy and securely store the generated token; it will not be visible again once you close the pop-up window.
  6. From the Integration Option dropdown list, select the desired LLM model (e.g., gpt-4, gpt-4o, gpt-4-0125-preview, etc.).
  7. Once the LLM model is selected, the Download VS Code Settings icon will appear next to the created token.
  8. Click this icon to download the settings.json file, which contains all necessary configuration information for integration with VS Code.

Note: The settings.json file includes essential information such as Project ID, ELITEA HUB's URL, LLM model, Integration UID, and the generated token.

Important: Alternatively, you can manually copy and paste all required parameters into the Alita Code extension's settings in VS Code.

VS-Settings_Configuration

Configuration on VS Code

Once Alita Code is installed, setting it up to work with your project in ELITEA HUB involves:

  1. Open your project in VS Code.
  2. Navigate to the .vscode folder and open the settings.json file. If this folder does not exist, create it and add a settings.json file.
  3. Open the settings.json file downloaded from ELITEA HUB.
  4. Copy all information from this file into the .vscode/settings.json file in your project. Note: Be careful not to overwrite other configurations. If previous Alita Code configurations exist, remove them before adding new information.
  5. Save the file. The integration settings will now be applied under Alita Code → Extension Settings → Workspace tab.
  6. Go to Extensions → Alita Code → Extension Settings. Open the Workspace tab and verify that all parameters are correctly populated from the settings.json file. Note: Manual adjustments can be made if necessary.

VS-AlitaCode_Settings

Types of Settings in Alita Code

Alita Code offers two types of settings to cater to different needs:

The following settings are available in both tabs (which can either be prepopulated or manually configured):

Main Settings:

Integration Settings:

Alitacode: Select Integration: Click here to select link to select the available models from dropdown list for above selected environment. Note: After selection the corresponding information will be automatically populated for Alitacode: LLMModel Name, Alitacode: Integration Name and Alitacode: Integration Uid fields. * Alitacode: LLMModel Name: Write manually the desired LLM model name, if you don't want to preopoluate all information from . * Alitacode: Integration Name: This is the integration type which is used for selected LLM model setup in ELITEA→Settings-Integrations page. Will automatically be populated and set after selecting LLM model from Alitacode: Select Integration. * Alitacode: Integration Uid: Enter the Integration UID from the ELITEA backend. Will automatically be populated and set after selecting LLM model from Alitacode: Select Integration.

Advanced Settings:

These settings ensure that Alita Code is properly configured to interact with the ELITEA, allowing for seamless integration and efficient use of LLM models within your projects.

Note: Restarting VS Code may be necessary for changes to take effect.

Configuring Alita Code

To initialize Alita Code in your project:

  1. Open any file and right-click to select Alita → Alita:Init.
  2. This creates a .promptLib folder with default prompts and prompts.json files.

VS-AlitaCode_Init

Alita Code Usage

Getting Started with Extension Commands

Jumpstart your Alita Code experience with these essential commands:

Alita Code is designed to be your coding companion, offering a blend of AI-powered efficiency and customizable support. Whether you're looking to enhance your productivity, streamline your testing process, or simply make your code more understandable, Alita Code is here to help. Let's embark on this journey to revolutionize your coding experience together.

Synchronize External Prompts

Sync prompts and datasources created in the Alita HUB with your Alita Code setup for seamless integration:

  1. Open prompts.json: Locate and open the prompts.json file.
  2. Access Alita Menu: Right-click in the editor to see the Alita menu option.
  3. Sync Prompts Option: Select Alita: Sync External Prompts from the submenu.
  4. Synchronization: The prompts and datasources will be synced and added to the prompts.json file.
  5. Usage: These prompts and datasources are now ready to be used with Alita: Predict command.

VS-AlitaCode_Sync_Prompt)

Note: To sync and use prompts and datasources from ELITEA HUB, tag the prompt with code in ELITEA HUB.

Create a Prompt

Creating a custom prompt in Alita Code allows you to tailor Gen AI suggestions to your specific tasks. Here's how to create one:

  1. Open a File: Start by opening any file from your project, or create a new one.
  2. Access Alita Menu: Right-click in the editor view to bring up the context menu, where you'll find the Alita item.
  3. Create Prompt Option: Hover over Alita in the menu, and on the second level menu, select Create Prompt.
  4. Name Your Prompt: Enter a name for your prompt-template, such as "Generate unit-tests".
  5. Describe Your Prompt: Press Enter and provide a description for your prompt.
  6. Provide Prompt Content: Press Enter again and input the content of your prompt. This can be modified later in the .promptLib folder.
  7. Finalize Creation: Hit Enter to finalize. Alita will add a reference to the new prompt in prompts.json and create a corresponding .yaml file in the .promptLib folder, which can be edited to extend content and add examples.

VS-AlitaCode_Create_Prompt

Extend Prompt Context

Enhance the context of an existing prompt with selected text from your code, improving the relevance of AI suggestions:

  1. Open and Select: Open any file from your project and select a portion of the text.
  2. Access Alita Menu: Right-click to open the context menu and find the Alita item.
  3. Extend Context Option: Hover over Alita and select "Extend Context" from the submenu.
  4. Choose a Prompt: Pick the prompt you wish to extend the context for from the dropdown list.
  5. Extend Context: The selected text will be automatically added to the prompt's context, enriching its understanding for future suggestions.

Predict (Execute) Prompt

To predict (execute) a prompt or a datasource directly from VS Code to generate Gen AI-driven code suggestions:

  1. Open a File and Select Text: Open any project file and select the text you want to analyze or for which you need suggestions.
  2. Access Alita Menu: Right-click in the editor view to see the Alita menu item.
  3. Predict Option: Hover over Alita and choose Alita Predict from the submenu.
  4. Select a Prompt or Datasource:
  5. Choose the desired prompt or datasource from the dropdown list.
  6. Version Selection: Prompts may have multiple versions. Ensure you select the appropriate version from the dropdown list as different versions may vary in functionality and variables.
  7. Variable Management: If the selected prompt version includes variables, you will either see prepopulated values or you can provide your own values. Ensure that all required variables are correctly filled to execute the prompt accurately.
  8. View Predictions: After execution, the generated response will be displayed in your editor according to the method specified in your Alita Code: Default View Mode settings. This could be appended, replaced, split, or prepended based on your configuration.

VS-AlitaCode_Predict

VS-AlitaCode_Predict(Response)

Note: You can use default prompts, those you've created, or external prompts and datasources synced from ELITEA HUB.

AlitaCode for IntelliJ Idea

AlitaCode is a IntelliJ plugin to handle prompt-engineering based code generation using ELITEA as a backend.

Installation

Getting started with Alita Code is straightforward and involves a few simple steps:

  1. Navigate to the SettingsPlugins section in IntelliJ.
  2. Search for AlitaCode in the Marketplace and click Install.

IJ-AlitaCode_Install

Configuration on ELITEA HUB

To configure the necessary parameters for the Alita Code extension, follow these steps:

  1. Go to Settings → Configuration on the ELITEA HUB.
  2. Click the + icon to create a new token.
  3. Enter a name and set an expiration date for the token.
  4. Click Generate to create the token.
  5. Immediately copy and securely store the generated token; it will not be visible again once you close the pop-up window.
  6. From the Integration Option dropdown list, select the desired LLM model (e.g., gpt-4, gpt-4o, gpt-4-0125-preview, etc.).
  7. Once the LLM model is selected, the Download Jetbrains Settings icon will appear next to the created token.
  8. Click this icon to download the alita.xml file, which contains all necessary configuration information (except generated token) for integration with IntelliJ.

IJ-Settings_Configuration

Configuration on IntelliJ

Once Alita Code is installed, setting it up to work with your project in ELITEA HUB involves:

  1. Open your project in IntelliJ.
  2. Navigate to the .idea folder and open the alita.xml file. If this folder does not exist, create it and add a alita.xml file.
  3. Open the alita.xml file downloaded from ELITEA HUB.
  4. Copy all information from this file into the .idea/alita.xml file in your project. Note: If previous Alita Code configurations exist, remove them before adding new information.
  5. Save the file. The integration settings will now be applied under Settings → Tools → Alita tab.
  6. Go to Settings → Tools → Alita. Open it and verify that all parameters are correctly populated from the alita.xml file.
  7. Copy and paste generated token to the LLM Auth Token field.
  8. Check and apply configuration:
    • Click the Reload icon next to the Integration Name dropdown list.
    • Select the ai_dial as integration and click OK button.
  9. To complete the setup click the OK button.

IJ-AlitaCode_Settings

Settings in Alita Code

Alita Code includes the following settings:

IJ-AlitaCode_Settings(part1)

IJ-AlitaCode_Settings(part2)

IJ-AlitaCode_Settings(part3

These settings ensure that Alita Code is properly configured to interact with the ELITEA HUB, allowing for seamless integration and efficient use of LLM models within your projects.

Note: Restarting IntelliJ may be necessary for changes to take effect.

Configuration

To initialize Alita Code in your project:

  1. Open any file and right-click to select Alita → Alita:Init.
  2. This creates a .promptLib folder with default prompts and prompts.json files.

IJ-AlitaCode_Init

AlitaCode Usage

Getting Started with Extension Commands

Jumpstart your Alita Code experience with these essential commands:

Synchronize External Prompts

Sync prompts and datasources created in the ELITEA HUB with your Alita Code setup for seamless integration:

  1. Open prompts.json: Locate and open the prompts.json file.
  2. Access Alita Menu: Right-click in the editor to see the Alita Actions item.
  3. Sync Prompts Option: Select the Alita: Sync External Prompts option from the submenu.
  4. Synchronization: The prompts and datasources will be synced and added to the prompts.json file.
  5. Usage: These prompts and datasources are now ready to be used with Alita: Predict command.

IJ-AlitaCode_Sync_Prompt)

Note: To sync and use prompts and datasources from ELITEA HUB, tag the prompt with code in ELITEA HUB.

Create a Prompt

Creating a custom prompt in Alita Code allows you to tailor Gen AI suggestions to your specific tasks. Here's how to create one:

  1. Open a File: Start by opening any file from your project, or create a new one.
  2. Access Alita Menu: Right-click in the editor view to bring up the context menu, where you'll find the Alita Actions item.
  3. Create Prompt Option: Hover over Alita Actions in the menu, and on the second level menu, select Alita: Create Prompt. The Create Prompt window is opened:
    • Name: Assign a descriptive name that clearly reflects the aim of the prompt.
    • Description: Summarize the purpose of the prompt, detailing what it intends to achieve.
    • Context: Well crafted prompt corresponding to well-acceppted Frameworks for creating prompts (e.g. CREATE, CRISPE, Elavis Saravia, etc.). In case the prompt's context contains Variables, then provide the names and values of the variables in the Variables section.
    • Click the Use the project integration settings in the context file checkbox to configure Model, Top-P, Top-K, Tempreature and MaX Tokens settings.
  4. Click the Ok button to create a prompt. This can be modified later in the .promptLib folder. Alita Code will add a reference to the new prompt in prompts.json and create a corresponding .yaml file in the .promptLib folder, which can be edited to extend content and add examples.

IJ-AlitaCode_Create_Prompt

Edit Prompt Context

Enhance the context of an existing prompt with selected text from your code, improving the relevance of AI suggestions:

  1. Open and Select: Open any file from your project and select a portion of the text.
  2. Access Alita Menu: Right-click to open the context menu and find the Alita Actions item.
  3. Edit Context Option: Hover over Alita Actions and select Alita: Edit Context from the submenu.
  4. Choose a Prompt: Select the prompt you wish to modify for from the list and click the Edit button.
  5. Edit Context The selected prompt's yaml file will be opened where you can make the changes.

IJ-AlitaCode_Edit_Prompt

Predict (Execute) Prompt

To predict (execute) a prompt or a datasource directly from VS Code to generate Gen AI-driven code suggestions:

  1. Open a File and Select Text: Open any project file and select the text you want to analyze or for which you need suggestions.
  2. Access Alita Menu: Right-click in the editor view to see the Alita Actions item.
  3. Predict Option: Hover over Alita Actions and choose Alita: Predict from the submenu.
  4. Select a Prompt or Datasource:
  5. Choose the desired prompt or datasource from the dropdown list.
  6. Version Selection: Prompts may have multiple versions. Ensure you select the appropriate version from the dropdown list as different versions may vary in functionality and variables.
  7. Variable Management: If the selected prompt version includes variables, you will either see prepopulated values or you can provide your own values. Ensure that all required variables are correctly filled to execute the prompt accurately.
  8. View Predictions: After execution, the generated response will be displayed in your editor according to the method specified in your AlitaCode: Display Type.

IJ-AlitaCode_Predict

IJ-AlitaCode_Predict(Response)

Note: You can use default prompts, those you've created, or external prompts and datasources synced from ELITEA HUB.