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.
- Clone the Nuggt repository from GitHub:
git clone https://github.com/Nuggt-dev/Nuggt.git
- Install the required dependencies:
pip install -r requirements.txt
- Navigate to the project directory:
cd nuggt-wizcoder
- 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:
- Add the model path to
server.py
(Model used for testing: TheBloke/WizardCoder-15B-1.0-GPTQ) - Set the environment variable for local inference:
export SERVER_TYPE=local
- Add the model path to
- For API inference:
- Adjust the
booga_api_url
inserver.py
to point to your desired API URL. - Set the environment variable for API inference:
export SERVER_TYPE=api
- Adjust the
- Run server.py using python:
python3 run server.py
- Launch streamlit:
streamlit run nuggt.py
For this version you do not need to setup the .env
file.
Nuggt provides a flexible and customizable way to automate tasks. The following sections explain the key aspects of using Nuggt.
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.
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}
To execute a task using Nuggt, follow these steps:
-
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}
-
Provide the necessary inputs and tools for each step, following the prompt format. Replace
<variable>
with any variable name. -
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.
-
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.
These examples cover a variety of tasks and demonstrate how to structure your prompts for efficient automation.
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.
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.
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.
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.
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!