Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/404wolf/everything
From everything import anything
https://github.com/404wolf/everything
automation function generativeai openai python tooling utility
Last synced: 7 days ago
JSON representation
From everything import anything
- Host: GitHub
- URL: https://github.com/404wolf/everything
- Owner: 404Wolf
- License: mit
- Created: 2024-07-03T17:36:29.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-07-05T18:05:39.000Z (4 months ago)
- Last Synced: 2024-07-05T23:31:03.220Z (4 months ago)
- Topics: automation, function, generativeai, openai, python, tooling, utility
- Language: Python
- Homepage:
- Size: 36.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Literally everything!
## The ultimate abstraction.### from everything import anything!
Real example:
```py
from everything import sort_list, stylized_greeting# Print a greeting for Wolf
print(stylized_greeting("Wolf", "Angry"))# Sort a list
print(sort_list([3, 2, 1, 0, -5, 2.5]))
``````cmd
>> OPENAI_API_TOKEN=...
>> python example.py
WHAT DO YOU WANT, WOLF?!
[-5, 0, 1, 2, 2.5, 3]
```### How's it work?
Using [OpenAI's](https://openai.com)'s state-of-the-art AI technology, we can literally import anything from everything! Any function you can imagine, dynamically generated at runtime, accessible with a simple import.
When you `import from everything`, `dothething` will use Python's [AST](https://docs.python.org/3/library/ast.html) library to scan your source code, and find all usages of ``. It then will merge a few lines of context on both sides of every function call, along with the call itself. Then, it will use OpenAI's `gpt-4o` model to generate a Python function, which you can then use in your code.
### How to use
First, set the `OPENAI_API_TOKEN` to a valid API token. Then install the package with `pip install dothething`. Finally, import anything from everything!
### Words of caution
You **probably** don't want to use this in production. `dothething` provides no guarantees! This is my escape hatch after of 6 weeks of learning `nix`.