Skip to content

As of openai API v.1.0 and higher some code became deprecated #6

@fgiraldi

Description

@fgiraldi

Starting with V1.0, things like

import openai
import config
api_key = config.api_key
openai.api_key = api_key
openai.Completion.create(engine=...)

are no longer supported, hence needed to be replaced with something like

import config
from openai import OpenAI

client = OpenAI(api_key=config.api_key)
client.completions.create(model=...

I have just noticed this while taking this Udemy Course

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions