mshumer / gpt-prompt-engineer

MIT License
9.38k stars 642 forks source link

Update chat completion function. #31

Open stu00608 opened 8 months ago

stu00608 commented 8 months ago

In the newer version of OpenAI Python package, openai.ChatCompletion has been deprecated. The problem also has mentioned in Issue #24 and #30.

Changes

  1. openai.ChatCompletion.create() -> openai.chat.completions.create()
  2. The parameter headers -> extra_headers. Notice that I haven't tested with Portkey but when HEADERS is an empty dictionary it works.

    Let me know if anything incorrect or missing. Btw this is a very useful tool, thanks!