Unable to access openai.Completion

openai.completion cannot be accessed in openai>=1.0.0 . so how to run openai migrate

@hardhikchandrapraksh

We have updated the code and library as OpenAI is not providing free credits.

Refer to the following topics in module 1:
“Getting access to the API Key” to get the API access
“Install the boltiotai library”

After you have got the API key,

First install the boltiotai library with the below command:

pip install boltiotai

Then in your code replace “import openai” with “from boltiot import openai”

Hi @hardhikchandrapraksh ,

Try changing openai.completion to
response = openai.chat.completions.create(
model=“gpt-3.5-turbo”,
messages=[{
“role”: “system”,
“content”: “You are a helpful assistant.”
}, {
“role”:
“user”,
“content”:“Why is the sky blue?”
}])