Created
September 6, 2022 13:16
-
-
Save mpangrazzi/1bd69f11d4c4f3c20ce652634ed6020e to your computer and use it in GitHub Desktop.
Call OpenAI API asking GPT-3 for a Completion
This file contains 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 openai | |
res = openai.Completion.create( | |
model="text-davinci-002", | |
prompt="How are you?\n", | |
temperature=0, | |
max_tokens=64, | |
top_p=1 | |
) | |
print(res["choices"][0]["text"].strip()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment