Closed AlexMeow closed 7 months ago
The new version of openAI library (>=1.0.0) no longer supports the following syntax:
openai.ChatCompletion.create( # ... )
I rewrote it as:
client = openai.Client(api_key=random_api_key()) return client.chat.completions.create( # ... )
Reference: https://github.com/openai/openai-python/blob/main/api.md#completions-1
Some bug exist
completion["choices"][0] TypeError: 'ChatCompletion' object is not subscriptable
The new version of openAI library (>=1.0.0) no longer supports the following syntax:
I rewrote it as:
Reference: https://github.com/openai/openai-python/blob/main/api.md#completions-1