ChatBot and Python

I wonder if anyone could train a chatbot to write python. Tell it what you want, it writes the code.

1 Like

Obviously you haven’t played around with ChatGPT yet.

1 Like
import openai
import json

# Set up the OpenAI API key
openai.api_key = "<YOUR_OPENAI_API_KEY>"

# Define the prompt
prompt = "What are some cool things you can do with ChatGPT and Python?"

# Set up the OpenAI API parameters
parameters = {
    "model": "text-davinci-002",
    "prompt": prompt,
    "temperature": 0.5,
    "max_tokens": 100,
    "top_p": 1,
    "frequency_penalty": 0,
    "presence_penalty": 0
}

# Call the OpenAI API to generate a response
response = openai.Completion.create(**parameters)

# Parse the response and print it
output = response.choices[0].text.strip()
print("Here are some cool things you can do with ChatGPT and Python:")
print(output)

ChatGPT and I have never spoken.

1 Like

Well then. Allow me to introduce you.

https://chat.openai.com/auth/login

1 Like

Also coming soon…learn Python for Flame at Logik Academy Pro.

4 Likes

I tried it. I’m not a coder, so I can´t judge it completely. It gives good code for bash script, or generic python code for simple tasks of scripting. I think in a first approach it will be very useful for us to generate small scripting utilities for day-to-day use.

Despite asking if it knew the Autodesk Flame API and receiving an affirmative response, it doesn’t generate usable code for us. It’s important to keep in mind that ChatGPT3 doesn’t have knowledge of recent years.

I haven’t tried GPT4 (“ChatGPT Plus”). It seems quite promising.

However, ChatGPT3 has been very useful for me in solving very specific doubts and problems. For example, telling me if certain code is compatible with Python 3.9. It helped me finding why a hook that used a methodology (pipe) to export QuickTime files, provided by Autodesk, wasn’t working for me, saving me many hours of headaches. It has become my first resource to solve my frequent doubts.

Tom Scott tried it:

-Ted

1 Like