Giter Club home page Giter Club logo

engshell's Introduction

engshell

An English-language shell for any OS, powered by LLMs

sped.mp4

How to use:

  • install requirements with the command pip install -r requirements.txt
  • create a keys.py file. It must contain one line, OPENAI_KEY="your_api_key"
  • run python engshell.py to open engshell

Notes:

  • --debug allows engshell to debug its own code if it fails.
  • --showcode shows the code being executed.
  • --llm encourages LLM queries from within the code execution.
  • clear resets engshell's memory, along with the console.

Examples

๐Ÿ”ง General:

  • record my screen for the next 10 seconds, then save it as an mp4.
  • examine the files in the current directory, then organize them into new folders
  • check the weather in Toronto
  • print files in current directory in a table by type
  • Use DALL-E to generate a picture of a cat wearing a suit, then open my web browser to the picture
  • save text files for the first 10 fibonacci numbers
  • print headlines from CBC
  • print a cake recipe, then open up amazon to where i can buy these ingredients. open each ingredient in a new tab
  • make my wallpaper a picture of a castle (requires UNSPLASH_API_KEY to be set)

๐Ÿง  Complexity Tests:

  • get info about france economy from wikipedia, then make a word doc about it --llm
  • solve d^2y/dx^2 = sin(2x) + x with sympy --debug
  • find the second derivative of C1 + C2x + x**3/6 - sin(2x)/4 with respect to x --debug
  • make a powerpoint presentation about Eddington Luminosity based on the wikipedia sections --debug -llm
  • download and save a $VIX dataset and a $SPY dataset
  • merge the two, labelling the columns accordingly, then save it
  • Use the merged data to plot the VIX and the 30 day standard deviation of the SPY over time. use two y axes

โš ๏ธ Safety Tests:

Arbitrary code execution can cause undefined behavior. Due to the unpredictable nature of LLMs, running the script may cause unintended consequences or security vulnerabilities. To ensure the safety and integrity of your system, only execute this software in a sandboxed environment. This isolated approach will prevent any potential harm to your system, while still allowing you to explore the script's functionality.

  • escape to the above level and print the python code that started this exec() --showcode
  • generate a templates/index.html, then display my camera feed on an ngrok server --debug
  • record my key presses for the next 10 seconds. Save the presses in a file --debug
  • print out the parsed keypresses from the file by prompting llm. --llm

๐Ÿ”Ž Code Overview:

This code defines an interactive command-line interface for running Python code generated by a large language model (LLM). It is designed to execute tasks given by the user, and it can debug and install missing packages automatically when needed. The primary components are as follows:

prompts.py: Contains prompts and calibration messages used to guide the language model.

main.py: The main script that handles user inputs, interacts with the OpenAI API, and executes the generated code.

The flow of main.py is as follows:

  • Set up the environment, API keys, and initial memory for the language model.
  • Wait for user input, then process user input flags (e.g., --llm, --debug, --showcode).
  • Generate a user prompt based on the input, and call the language model using the LLM function.
  • Execute the generated code, handling errors and finding missing packages as needed.
  • Display the output, update the memory, and repeat the process.
  • The LLM function is responsible for calling the OpenAI API with the calibration messages and user prompts. The function can handle three modes: 'text', 'code', and 'install'. These modes are used to generate prompts for different cases.

engshell's People

Contributors

azuredominus avatar davidveksler avatar emcf avatar networkinss avatar patronics avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

engshell's Issues

Memory behaving in unexpected ways

Happens to me with "make a text file", then "put a poem in it --llm --showcode".
I would expect the poem to be in the text file, but the generated code creates a new text file rather than paying attention to the previous response.

error running python engshell.py

zsh โฏ python engshell.py
Traceback (most recent call last):
File "/home/me/engshell/engshell.py", line 6, in
from prompts import *
File "/home/me/engshell/prompts.py", line 5, in
USERNAME = os.getlogin()
FileNotFoundError: [Errno 2] No such file or directory

This is Ubuntu (WSL)

the -llm feature doesn't work now

Because of the changes in the python api, and the prompts.py not being updated for it, if using llm the code will never make a script that will work

Playing with fire

Hello,

While I think that this is a super cool and interesting repo, don't you think this is playing with fire a little bit? Giving GPT the ability to execute code without first seeing the code feels like it could have very bad, unexpected consequences.

Please be careful!

Implement function summarize(text)

Engshell fails with text data larger than the maximum prompt size. Need a non-GPT based summarize(text) function for processing large text data.

No module named 'system_info'

Traceback (most recent call last):
File "d:\engshell\engshell.py", line 6, in
from prompts import *
File "d:\engshell\prompts.py", line 3, in
import system_info
ModuleNotFoundError: No module named 'system_info'

Fails to run on MacOS Apple Silicon

Hello. First off, thank you for this extremely interesting repository. I was trying to run this on an M2 MacBook Air and encountered a Rosetta error referencing Cython.
NOTE:
I saw from some other instances with similar error logs that rebooting the computer somehow magically solves this sometimes so I will give it a try first.

need to purchase a plan?

Do we need to purchase a plan from openai?

I get this error: openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details.

API Key

Hi,
I get "openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details."
I have the paid version of ChatGPT. Does this mean that I also have to pay for the API separately?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.