- Go to OpenAI.
- Log in
- Create an Api Key
- Create a directory
- Put a file called
.env
in that directory- Open that file an set your parameter = your api key.
- See my
env
file for as an example.
- Run
python -m venv .venv
- Activate the environment you just setup (You'll have to look it up)
pip install openai python-dotenv
python main.py
- model: You can change these. See here for more models you can use.
- temperature: 0 will return the same result every time while 1 will return a different result every time. Anywhere in between has the expected result.
- max_tokens: Determines how long the response can be.
For more options, see the Docs