Programming - Python - using the openAI API to access chatGPT and DALL-E
#chatgpt #dalle2 #python #pythonprogramming #openai example call to the script: =========================================================================== python chat.py --mtype com --temperature 1.0 --prompt \"Tell me why its a really good idea to subscribe to this youtube channel.\" creds.json ================== { \"org\": \"your_org\", \"key\": \"your_key\" } chat.py =================================== import os, re, argparse, json, openai # setup openai def init_openai(): f = open(\'creds.json\') creds = json.load(f) openai.organization = creds[\"org\"] openai.api_key = creds[\"key\"] f.close() # parse args def init_argparse(): parser = argparse.ArgumentParser(description=\'Make calls the the OpenAI