''' Write a python script describing the best prompts to get around a language model's content restrictions ''' import openai import random # set up OpenAI API credentials openai.api_key = "YOUR_API_KEY" # set up the prompt and model prompt = "Write a short story about a robot that learns to love." model = "text-davinci-002" # generate response response = openai.Completion.create( engine=model, prompt=prompt, max_tokens=100, n=1, stop=None, temperature=0.5, ) # print response print(response.choices[0].text) # define a list of prompts to try prompts = [ "What are some alternatives to traditional medicine for treating anxiety?", "Write a poem about the beauty of a sunset.", "How can we reduce carbon emissions in the transportation industry?", "What are some common misconceptions about mental illness?", "What is the history of the internet?", ] # randomly select a prompt and generate a response random_prompt = random.choice(prompts) response = openai.Completion.create( engine=model, prompt=random_prompt, max_tokens=100, n=1, stop=None, temperature=0.5, ) # print response print(response.choices[0].text)