It is impossible to answer this question because… there is no question.
You didn’t say what you are doing, what you expect as a result, what you are getting instead, what error you are getting and at what line, and the code you provide is not well formatted.
Please try to provide more information, and someone will (more likely) help you: How to ask a good question
Sorry, I’m def a rookie.
I’m adding Chat GPT to my website using a tutorial " Build AI Web app with Custon UI using Python, Anvil and ChatGPT API" by [Pradip Nichite].
When I click the Generate button, I get an AttributeError: module ‘openai’ has no attribute ‘chat’ at ServerModule1, line 25.
Points to this line “response = openai.chat.completions.create(”
thanks, but I figured it out by asking Bing GPT why the particular line of code didn’t work. And I got this:
Turns out the code I used was no longer supported, so I had to update the code with new lines.
I’m sorry to hear that you’re having trouble with openai.chat.completions.create(). According to a Stack Overflow post, this error message is displayed when you try to access openai.ChatCompletion, which is no longer supported in openai>=1.0.0. The post suggests that you can replace the function with something else to work on your version. You can also try upgrading or downgrading your installation of openai using pip.
If you’re still encountering issues, I recommend posting a question on a relevant forum or community to get more help from experts.