Skip to content

Latest commit

 

History

History
121 lines (78 loc) · 5.82 KB

guide.md

File metadata and controls

121 lines (78 loc) · 5.82 KB

Welcome to the Nuggt Wizcoder documentation!

This guide will provide you with the necessary information to start using Nuggt (Wizcoder Version) and harness its capabilities for automating tasks using AI agents.

Table of Contents

Installation

  1. Clone the Nuggt repository from GitHub: git clone https://github.com/Nuggt-dev/Nuggt.git
  2. Install the required dependencies: pip install -r requirements.txt
  3. Navigate to the project directory: cd nuggt-wizcoder
  4. The tool now supports both local and API inference. The inference mode can be set by using the SERVER_TYPE environment variable.
  • For local inference:
    1. Add the model path to server.py (Model used for testing: TheBloke/WizardCoder-15B-1.0-GPTQ)
    2. Set the environment variable for local inference:
      export SERVER_TYPE=local
  • For API inference:
    1. Adjust the booga_api_url in server.py to point to your desired API URL.
    2. Set the environment variable for API inference:
      export SERVER_TYPE=api
  1. Run server.py using python: python3 run server.py
  2. Launch streamlit: streamlit run nuggt.py

For this version you do not need to setup the .env file.

Usage

Nuggt provides a flexible and customizable way to automate tasks. The following sections explain the key aspects of using Nuggt.

Prompt Template

Nuggt utilizes a step-by-step prompt template to define the actions required for task execution. Each step consists of the following elements:

  • Step: A brief description of the current step.
  • Reason: The reason behind taking this step.
  • Action: The action to be performed, selected from the available tools.
  • Action Input: The input required for the action.
  • Observation: The result or output obtained from the action.

Tool Integration

Take Note: Currently only python and display tools are available for the Wizcoder version. New tools coming in soon!

  • Python: Execute Python scripts using a Python shell. Syntax: {tool:python}
  • Display: Print tables/visualisations to console. Syntax: {tool:display}

Step-by-Step Execution

To execute a task using Nuggt, follow these steps:

  1. Define a prompt using the following inputs:

    • {text:<variable>}: Create an input field and assign its value to <variable>
    • {upload:<variable>}: Create a file upload button and save the uploaded file by the name <variable>
    • {tool:<tool_name>}: Specify a tool to use.

    For example: Open {upload:document} using {tool:python} and display its content using {tool:display}

  2. Provide the necessary inputs and tools for each step, following the prompt format. Replace <variable> with any variable name.

  3. Execute the task using Nuggt by clicking the submit button, which will process the prompt and perform the specified actions based on the inputs provided.

  4. Review the observations and final answer generated by Nuggt to obtain the desired output.

By utilizing the {tool:<tool_name>} input format, you can seamlessly integrate various tools into your prompts, such as Python, document processing, video analysis, Google search, and web browsing. Combine these inputs with {text:<variable>} and {upload:<variable>} to create dynamic and interactive prompts tailored to your specific requirements.

Examples

These examples cover a variety of tasks and demonstrate how to structure your prompts for efficient automation.

Example 1: Creating Visualisations from data

Prompt: Print the head of {upload:data} with print() using {tool:python}. Create a bar plot between {text:column1} column and {text:column2} column with matplotlib using {tool:python}. Display the bar plot with proper labels with streamlit library using {tool:python}

Output format: I have displayed the visualisations using streamlit

Description: This example creates a barplot comparision for two columns.

Example 2: Stock Data Analysis

Prompt: Get past 7 days OHLC data for stock {text:stock} using {tool:python}. Calculate the MACD and save the MACD table as {text:file} using {tool:python}. Save line plots between MACD and Signal data as {text:image} using {tool:python}.

Output format: I have saved the tables and visualisations for the given stock.

Description: This example analyses stock data and saves the MACD data file together with line plot visualisation between MACD and Signal Data.

Example 3: Machine Learning

Prompt: Print a glimpse of {upload:data} using {tool:python}. Preprocess the data to train a machine learning model using {tool:python}. Train a Random Forest model to predict the {text:column} column using {tool:python}. Use GridCV to improve accuracy using {tool:python}. Save the ROC Curve as {text:file} using {tool:python}.

Output format: I have trained the machine learning model and saved the ROC Curve.

Description: This example creates a RandomForest model and trains on a given dataset. It then saves the ROC Curver and displays the best parameters (Hyperparameter Tuning with GridCV)

Feel free to adapt and explore these examples based on your specific use cases and requirements.

Contributing

We welcome contributions from the community! If you would like to contribute to Nuggt, please refer to the contributing guidelines for more information on how to get involved.

Support

If you encounter any issues or have questions regarding Nuggt, please feel free to reach out to our support team at Discord Server. We are here to assist you and ensure a smooth experience with Nuggt.

Thank you for choosing Nuggt. Happy automating!