ChatGPT ã使ç¨ãã Python ã¹ã¯ãªããã®ä½æ 次ã«ãPython ã¹ã¯ãªãããä½æãã¦ãChatGPT ãåæåããã³ãã³ãã©ã¤ã³ããæãå ¥åãã¦åãåãããããã® CLI ãã¼ã«ãä½æãã¾ãã import openai import os openai.api_key = os.environ["OPENAI_SECRET_KEY"] prompt = input("Enter a prompt: ") completions = openai.Completion.create( engine="text-davinci-002", prompt=prompt, max_tokens=1024, n=1, stop=None, temperature=0.5, ) for choice in completions.choices: print(choice.text)
{{#tags}}- {{label}}
{{/tags}}