{"id":22570402,"url":"https://github.com/haseeb-heaven/gemini-interpreter","last_synced_at":"2025-04-10T13:30:33.475Z","repository":{"id":167843856,"uuid":"642224541","full_name":"haseeb-heaven/gemini-interpreter","owner":"haseeb-heaven","description":"Gemini is Code generator and Code Interpreter for Google Gemini.","archived":false,"fork":false,"pushed_at":"2024-02-27T09:20:46.000Z","size":6114,"stargazers_count":78,"open_issues_count":2,"forks_count":21,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T08:59:50.812Z","etag":null,"topics":["auto-gpt","bard","bard-ai","bard-api","bing-ai","chatbot","code-generation","coder","google","google-ai","google-bard-api","google-cloud","google-palm","google-vertex-ai","googlebard","gpt","gpt-3","python"],"latest_commit_sha":null,"homepage":"https://bard-interpreter.streamlit.app","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haseeb-heaven.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOGS.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-05-18T05:08:38.000Z","updated_at":"2025-04-01T16:55:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"cf4e4d2a-b4e4-4d78-9cd1-744e924d320f","html_url":"https://github.com/haseeb-heaven/gemini-interpreter","commit_stats":null,"previous_names":["haseeb-heaven/autobard-coder","haseeb-heaven/gemini-interpreter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haseeb-heaven%2Fgemini-interpreter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haseeb-heaven%2Fgemini-interpreter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haseeb-heaven%2Fgemini-interpreter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haseeb-heaven%2Fgemini-interpreter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haseeb-heaven","download_url":"https://codeload.github.com/haseeb-heaven/gemini-interpreter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248225705,"owners_count":21068078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auto-gpt","bard","bard-ai","bard-api","bing-ai","chatbot","code-generation","coder","google","google-ai","google-bard-api","google-cloud","google-palm","google-vertex-ai","googlebard","gpt","gpt-3","python"],"created_at":"2024-12-08T01:08:46.370Z","updated_at":"2025-04-10T13:30:33.438Z","avatar_url":"https://github.com/haseeb-heaven.png","language":"Python","funding_links":["https://www.buymeacoffee.com/haseebheaven","https://img.buymeacoffee.com/button-api/?text=Buy"],"categories":[],"sub_categories":[],"readme":"# Gemini-Coder\n![cover_logo](https://github.com/haseeb-heaven/AutoBard-Coder/blob/master/resources/logo.png?raw=true \"\")\u003c/br\u003e\n### **Hosting and Spaces:**\n[![Plugin](https://img.shields.io/badge/Bard%20Coder-Repo-blue)](https://replit.com/@HaseebMir/AutoBard-Coder)\n[![Plugin](https://img.shields.io/badge/Bard%20Coder-Replit-blue)](https://autobard-coder.haseebmir.repl.co)\n[![Plugin](https://img.shields.io/badge/Code%20Interpreter-HuggingFace-blue)](https://huggingface.co/spaces/haseeb-heaven/AutoBard-Coder)\n[![Plugin](https://img.shields.io/badge/Code%20Interpreter-CodeSpace-blue)](https://haseeb-heaven-legendary-guide-x555j7vpv4phprg6-8501.preview.app.github.dev/)\u003c/br\u003e\n\u003ca href=\"https://www.buymeacoffee.com/haseebheaven\"\u003e\u003cimg src=\"https://img.buymeacoffee.com/button-api/?text=Buy me a coffee\u0026emoji=\u0026slug=haseebheaven\u0026button_colour=40DCA5\u0026font_colour=ffffff\u0026font_family=Cookie\u0026outline_colour=000000\u0026coffee_colour=FFDD00\" /\u003e\u003c/a\u003e\n\n## 🌟 General Information 🌟\n**Gemini-Coder** is a _code generator_ and _code interpreter_ for [Google Gemini](https://gemini.google.com/).🙌👩‍💻👨‍💻 It now uses the **Official** [Gemini API](https://makersuite.google.com/app/apikey) provided by Google, which is safe to use. 🛡️\nThis application interacts with Google Bard and refines the results for coding purposes. 🎯\nThe main purpose of this is for **research** 🧪 and **educational** 🎓 purposes. It can be very useful for **data analysis** 📊 and **Programmers** 💻.\n\n## Application main UI.\n### GeminiCoder:\n![gemini_coder](https://github.com/haseeb-heaven/AutoBard-Coder/blob/master/resources/bardcoder_main.png?raw=true \"\")\u003c/br\u003e\n\n### Code Interpreter:\n![code_interpreter](https://github.com/haseeb-heaven/AutoBard-Coder/blob/master/resources/code_interpreter_main_ui.png?raw=true \"\")\u003c/br\u003e\n\n## Setup Process - OUTDATED\n~~To set up AutoBard-Coder, you will need to install the dependencies: `streamlit` and `bardapi`.~~ \u003c/br\u003e\n~~You will also need to authenticate with the Bard API by visiting https://bard.google.com/,~~ \u003c/br\u003e\n~~- Opening the console with F12~~ \u003c/br\u003e\n~~- Going to **Application** → **Cookies**, and copying the value of the **__Secure-1PSID** cookie.~~\u003c/br\u003e\n~~- Then you can setup the key to your **local environment** by running the following command:~~\u003c/br\u003e\n~~```export _BARD_API_KEY=\u003c__Secure-1PSID value\u003e``` Remember the `_` before `BARD_API_KEY` is important.~~ \u003c/br\u003e\u003c/br\u003e\n\n\n## Installation Guide - UPDATED\n\n*Step 1:* **Obtain the Google Palm API key.**\n\n*Step 2:* Visit the following URL: *https://makersuite.google.com/app/apikey*\n\n*Step 3:* Click on the **Create API Key** button.\n\n*Step 4:* The generated key is your API key. Please make sure to **copy** it and **paste** it in the required field below.\n\n*Note:* The API key is crucial for the functioning of the AutoBard-Coder. Please ensure to keep it safe and do not share it with anyone.\n\n## Usage\nThere are 3 components of this application:\n1. **_Geminioder_**: A coding assistant from Gemini which automatically generates code from Gemini responses and refines it for coding purposes. This can be used by developers to get the correct code from Gemini when they need help because the output is refined and fixed multiple times to provide the correct code.\n- File: `bardcoder.py`\n\n2. **_Code Interpreter_**: This is an interpreter for Gemini which can be used to run the code generated from Geminicoder. This can be very useful for all users who want to do data analysis and machine learning with Gemini. This can generate graphs and charts from Gemini responses and can be used to do data analysis.\n- File: `Geminicode_interpreter.py`\n\n3. **_GeminiCoder Lib_**: This is a library for Geminicoder which can be used to generate code from bard responses and refine it for coding purposes. You can use it to build your own application using Gemini.\n- File: `bardcoder_lib.py`\n\n## Using BardCoder:\nTo use GeminiCoder, you will need to run the following command:\n```python bardcoder.py```\nThis will open the GeminiCoder UI in the terminal. And will be asked to enter prompts for Gemini.\n![bard_coder](https://github.com/haseeb-heaven/AutoBard-Coder/blob/master/resources/bardcoder_main.png?raw=true \"\")\u003c/br\u003e\nNot this assumes you have already set the `API KEY` in your local environment. If you have not, please refer to the setup process.\nThe code generated will be placed in folder `codes` and the response will be placed in folder `response`.\n\n## Using Code Interpreter:\nTo use Code Interpreter, you will need to run the following command:\u003c/br\u003e\n```streamlit run bardcode_interpreter.py```\u003c/br\u003e\u003c/br\u003e\nIf you need to Disable CORS Headers, you can run the following command:\u003c/br\u003e\n```streamlit run bardcode_interpreter.py --server.enableCORS false --server.enableXsrfProtection false```\u003c/br\u003e\u003c/br\u003e\nThis will open the Code Interpreter UI in the Web Browser. And will be asked to enter prompts for bard.\n![code_interpreter](https://github.com/haseeb-heaven/AutoBard-Coder/blob/master/resources/code_interpreter_main_ui.png?raw=true \"\")\u003c/br\u003e\n\nNow this assumes you have already set the `API KEY` in your local environment. If you have not, please refer to the setup process.\nYou can also setup the `API KEY` in the UI settings.\u003c/br\u003e\n![code_interpreter_settings](https://github.com/haseeb-heaven/AutoBard-Coder/blob/master/resources/code_interpreter_settings.png?raw=true \"\")\u003c/br\u003e\n\nBefore prompting you should check the **Options** to change **Filenames** and **Filepaths** and other settings.\u003c/br\u003e\n\n### Uploading data for data analysis:\nYou can set the `Upload Data` in **Options** to upload data for data analysis. (Right now this only supports Text files).\n![upload_data_ui](https://github.com/haseeb-heaven/AutoBard-Coder/blob/master/resources/upload_data_ui.png?raw=true \"\")\u003c/br\u003e\n\nAfter uploading the files you can ask for the prompts from Gemini. And you will get the output like this.\n![upload_data_output](https://github.com/haseeb-heaven/AutoBard-Coder/blob/master/resources/upload_data_output.png?raw=true \"\")\u003c/br\u003e\n\nYou can also set the `Expected Output` in **Options** to get the **Accuracy** of the code generated.\n![expected_output](https://github.com/haseeb-heaven/AutoBard-Coder/blob/master/resources/code_interpreter_expected_output.png?raw=true \"\")\u003c/br\u003e\n\nAnd output will be generated like this with hilighting the **Accuracy** of the code generated.\n![expected_output](https://github.com/haseeb-heaven/AutoBard-Coder/blob/master/resources/code_interpreter_output.png?raw=true \"\")\u003c/br\u003e\n\n### Sharing code with others:\nYou can share code with others by using the **ShareGPT** feature. You will get sharable link for your code.\n![bard_code_share](https://github.com/haseeb-heaven/AutoBard-Coder/blob/master/resources/bard_code_share.png?raw=true \"\")\u003c/br\u003e\n\n### Code Interpreter Demo:\n[Code Interpreter Demo](https://github.com/haseeb-heaven/AutoBard-Coder/blob/master/resources/code_interpreter_demo.webm)\u003c/br\u003e\n[![code_interpreter_demo](https://img.youtube.com/vi/Flg1qUzs9ew/0.jpg)](https://youtube.com/shorts/Flg1qUzs9ew)\n\nThe 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`.\n\n### Safety and Measures:\nThis now has **safety measures** built in _Code Interpreter_ and now it can detect the **safety** of the code generated and can **fix** it.\u003c/br\u003e\nSo now all the repo and code in **READ_ONLY** mode. And you can only run the code in **READ_ONLY** mode.\u003c/br\u003e\nAll the commands which **__changes,move,delete,rename__** files are disabled in **READ_ONLY** mode.\u003c/br\u003e\nThis has advanced **safety measures** and can detect the **safety** of the code generated and can **fix** it.\u003c/br\u003e\n![safety_output](https://github.com/haseeb-heaven/AutoBard-Coder/blob/master/resources/safety_output.png?raw=true \"\")\u003c/br\u003e\n\n\n### Graphs and Visual Charts output:\nTo 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: \u003c/br\u003e\n```python bardcode_interpreter.py``` \u003c/br\u003e\nAnd ask for the prompts from Gemini. And you will get the output like this:\nExample Prompt:\n```\nIn Python write me program to.\n1.Read the data from file called 'employees.json'\n2.Count no. of Males and Females in file.\n4.Draw PIE graph of these in using Python Matplotlib.\n5.Show me that output.\n```\n\nAnd you will get output like this.\n![expected_output](https://github.com/haseeb-heaven/AutoBard-Coder/blob/master/resources/employees_chart.png?raw=true \"\")\u003c/br\u003e\n\n## Directory Structure\nThis application uses the Gemini API to interact with Gemini and refine the results for coding purposes. All data that is generated is stored in the following directories:\n- `response`: This directory contains all the responses from Gemini.\n- `codes`: This directory contains all the code generated from Gemini.\n- `uploads`: This directory contains all the data that is uploaded to Gemini.\n- `lib`: This directory contains all the libraries for Geminicoder.\n- `resources`: This directory contains all the resources for Geminicoder.\n\n## Features\nSome of the features of Gemini-Coder include:\n- **Automatic** _code generation_ from Gemini responses\n- **Refinement** of code for coding purposes\n- Ability to **fix/debug** its own code\n- Ability to generate **single** or **multiple** responses from Gemini\n- Ability to **save** responses and run them locally\n- Ability to access _local files_ for code interpretation\n- **Data analysis** and machine learning capabilities\n- **Graphs** and **Charts** generation from Gemini responses\n- Ability to **upload files** for data analysis and machine learning.\n- Share code with others with powerered by **ShareGPT**.\n- Advanced **safety measures** to detect the safety of the code generated.\n\n## Help Section.\nNow you can get help directly from the application. You can get help by clicking on the **Help** button in the UI.\n![code_interpreter_help](https://github.com/haseeb-heaven/AutoBard-Coder/blob/master/resources/code_interpreter_help.png?raw=true \"\")\u003c/br\u003e\n\n## Changelog 📝\n\nAll notable changes to this project will be documented in this file.\n\n[CHANGELOGS](https://github.com/haseeb-heaven/AutoBard-Coder/blob/master/CHANGELOGS.md)\n\n---\n\n| Version | Date       | Added                                              | Fixed                |\n| ------- | ---------- | -------------------------------------------------- | -------------------- |\n| 1.4     | 2023-09-28 | - Added Palm 2 Official API now. | - Settings and Logs and Bug fixes |\n| 1.3     | 2023-05-29 | - **Updated** with totally new _UI_ and _UX_. 🎨\u003cbr\u003e- Updated security for code checking and prompt checking. 🔒\u003cbr\u003e- Added new Help section. 🆘 | - Fixed API Key issues. |\n| 1.2     | 2023-05-28 | - Advanced security for code and prompt checking. 🔒\u003cbr\u003e- Support for graphs, charts, and tables. 📊\u003cbr\u003e- More libraries for data science. 🧬 |                      |\n| 1.1     | 2023-05-27 | - Upload files option. 📤\u003cbr\u003e- API key settings. 🔑  | - Error handling from server. 🛠 |\n| 1.0     | 2023-05-26 | - Auto barcode generator. 🏷\u003cbr\u003e- Auto barcode interpreter. 🔎 |                      |\n\n\n\n\n## License and Author\nGemini-Coder was created by HeavenHM and is licensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaseeb-heaven%2Fgemini-interpreter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaseeb-heaven%2Fgemini-interpreter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaseeb-heaven%2Fgemini-interpreter/lists"}