import os | |
import openai | |
openai.api_key = os.getenv("OPENAI_API_KEY") | |
response = openai.Completion.create( | |
model="text-davinci-003", | |
prompt="#JavaScript to Python:\nJavaScript: \ndogs = [\"bill\", \"joe\", \"carl\"]\ncar = []\ndogs.forEach((dog) {\n car.push(dog);\n});\n\nPython:", | |
temperature=0, | |
max_tokens=64, | |
top_p=1.0, | |
frequency_penalty=0.0, | |
presence_penalty=0.0 | |
) |