Saturday, 7 January 2023

Friday, 6 January 2023

blogpost

import openai # Set up the API client openai.api_key = "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" # Define your context or prompts prompt = "Write a short story about a magical adventure" # Send a request to GPT-3 and receive the generated text completion = openai.Completion.create( engine="text-davinci-002", prompt=prompt, max_tokens=1024, temperature=0.5, ) text = completion.text # Print the generated text print(text)