A Jupyter/IPython magic command for generating code using GPT.
Project description
GPT magic
A Jupyter/IPython magic command for generating code using GPT
Usage
Generating code with GPT by loading the extension and prefixing your line with %gpt
.
%load_ext gpt
%gpt Your request here
Install
Install with pip
pip install gpt-magic
Please note that users will need to provide their own OpenAI API key. Set an environment variable called OPEN_AI_KEY
with your key. Or pass the API key when loading the extension, by running the following line before %load_ext gpt_magic:
import os
os.environ["OPENAI_API_KEY"] = "your_openai_api_key_here"
Model
The current default is the gpt-3-turbo model, but can be changed using OPENAI_MODEL
environmental variable.
Using GPT-4 example
import os
os.environ["OPENAI_MODEL"] = "gpt-4"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gpt-magic-0.1.0.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for gpt_magic-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5201a0459bc0fa9563333256d27a62a785912ce2e49cb3e1738aea1b99ad52a |
|
MD5 | fe3aee43a36015bc03e3f4a171d8b6c0 |
|
BLAKE2b-256 | b90f9070ab355c4132a3550fac4ed31b66718363504cc0c11f54d11a0ad715c2 |