AutoBard Coder is Code generator and Code Interpreter for Google Bard.
AutoBard-Coder is a code generator and code interpreter for Google Bard.🙌👩💻👨💻 It uses the Unofficial Bard API by dsdanielpark which is licensed under the MIT license. to interact with Google bard and refine the results for coding purposes. The main purpose of this is for research and educational purposes. As this can be very useful for data analysis and Programmers.
To set up AutoBard-Coder, you will need to install the dependencies: streamlit
and bardapi
.
You will also need to authenticate with the Bard API by visiting https://bard.google.com/,
export _BARD_API_KEY=<__Secure-1PSID value>
Remember the _
before BARD_API_KEY
is important.
Do not expose the __Secure-1PSID value
.
Note that while it is referred to as an API KEY
for convenience, it is not an officially provided API KEY.
To install the dependencies, you can use pip to install from the requirements.txt file:
This will install streamlit, bard-coder-api, and any other dependencies listed in the requirements.txt
file.
There are 3 components of this application:
bardcoder.py
bardcode_interpreter.py
bardcoder_lib.py
To use BardCoder, you will need to run the following command:
python bardcoder.py
This will open the BardCoder UI in the terminal. And will be asked to enter prompts for bard.
Not this assumes you have already set the API KEY
in your local environment. If you have not, please refer to the setup process.
The code generated will be placed in folder codes
and the response will be placed in folder response
.
To use Code Interpreter, you will need to run the following command:
streamlit run bardcode_interpreter.py
If you need to Disable CORS Headers, you can run the following command:
streamlit run bardcode_interpreter.py --server.enableCORS false --server.enableXsrfProtection false
This will open the Code Interpreter UI in the Web Browser. And will be asked to enter prompts for bard.
Now this assumes you have already set the API KEY
in your local environment. If you have not, please refer to the setup process.
You can also setup the API KEY
in the UI settings.
Before prompting you should check the Options to change Filenames and Filepaths and other settings.
You can set the Upload Data
in Options to upload data for data analysis. (Right now this only supports Text files).
After uploading the files you can ask for the prompts from bard. And you will get the output like this.
You can also set the Expected Output
in Options to get the Accuracy of the code generated.
And output will be generated like this with hilighting the Accuracy of the code generated.
You can share code with others by using the ShareGPT feature. You will get sharable link for your code.
The code generated will be placed in folder codes
and the response will be placed in folder response
and upload files will be placed in folder uploads
.
This now has safety measures built in Code Interpreter and now it can detect the safety of the code generated and can fix it. So now all the repo and code in READ_ONLY mode. And you can only run the code in READ_ONLY mode. All the commands which changes,move,delete,rename files are disabled in READ_ONLY mode. This has advanced safety measures and can detect the safety of the code generated and can fix it.
To get Graphs and Charts output for your data visualization, you will install python packages matplotlib
, seaborn
, cartopy
, plotnine
and more. and run the following command:
python bardcode_interpreter.py
And ask for the prompts from bard. And you will get the output like this:
Example Prompt:
In Python write me program to.
1.Read the data from file called 'employees.json'
2.Count no. of Males and Females in file.
4.Draw PIE graph of these in using Python Matplotlib.
5.Show me that output.
And you will get output like this.
This application uses the Bard API to interact with bard and refine the results for coding purposes. All data that is generated is stored in the following directories:
response
: This directory contains all the responses from bard.codes
: This directory contains all the code generated from bard.uploads
: This directory contains all the data that is uploaded to bard.lib
: This directory contains all the libraries for bardcoder.resources
: This directory contains all the resources for bardcoder.Some of the features of AutoBard-Coder include:
Now you can get help directly from the application. You can get help by clicking on the Help button in the UI.
All notable changes to this project will be documented in this file.
Version | Date | Added | Fixed |
---|---|---|---|
1.3 | 2023-05-29 | - Updated with totally new UI and UX. 🎨 - Updated security for code checking and prompt checking. 🔒 - Added new Help section. 🆘 |
- Fixed API Key issues. |
1.2 | 2023-05-28 | - Advanced security for code and prompt checking. 🔒 - Support for graphs, charts, and tables. 📊 - More libraries for data science. 🧬 |
|
1.1 | 2023-05-27 | - Upload files option. 📤 - API key settings. 🔑 |
- Error handling from server. 🛠 |
1.0 | 2023-05-26 | - Auto barcode generator. 🏷 - Auto barcode interpreter. 🔎 |
AutoBard-Coder was created by HeavenHM and is licensed under the MIT license.