Created
July 7, 2023 07:25
-
-
Save greencamp20552/bc2fe89cc0d2823a948ead80a002ffb0 to your computer and use it in GitHub Desktop.
gpt4-for-dev-tut
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import openai | |
| def init_api(): | |
| with open(".env") as env: | |
| for line in env: | |
| key, value = line.strip().split("=") | |
| os.environ[key] = value | |
| openai.api_key = os.environ.get("API_KEY") | |
| openai.organization = os.environ.get("ORG_ID") | |
| init_api() | |
| models = openai.Model.list() | |
| print(models) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment