chatgpt-telegram-bot icon indicating copy to clipboard operation
chatgpt-telegram-bot copied to clipboard

Migrate to official openai~=1.2

Open iBug opened this issue 1 year ago • 2 comments

iBug avatar Nov 19 '23 10:11 iBug

@iBug

  1. The new version of the OpenAI library includes an automatic retry feature. We should set max_retries=0 to avoid the issue of double-layered retries.
  2. We need to fix the bug at [link]. Otherwise, the HTTP connection pool will be exhausted after 100 requests, causing it to become unusable thereafter.
  3. Although it won't make a substantial difference, I still prefer to use is not None for a more rigorous evaluation of the results returned in the stream, rather than the current approach of directly converting to a boolean type.
  4. OpenAI's library does not strictly adhere to Semantic Versioning. PATCH versions are not just backward compatible bug fixes, so I'd like to lock down an exact version.
  5. The examples in the official Python Docker documentation use the pip command rather than the pip3 command. Please explain why this change is necessary.

zzh1996 avatar Nov 23 '23 12:11 zzh1996

Points 1-4 have been fixed. For point 5, python and pip have historically been associated with Python 2 on Unix platforms. Although this should not be the case for a pinned-down Docker container, I have never used python or pip to refer to Python 3.x. This is more a personal preference so I can revert this change at your request.

iBug avatar Nov 28 '23 20:11 iBug

The issue addressed by this pull request has already been resolved long ago, so it will be closed.

zzh1996 avatar Sep 13 '24 11:09 zzh1996