chatgpt-telegram-bot
chatgpt-telegram-bot copied to clipboard
Migrate to official openai~=1.2
@iBug
- The new version of the OpenAI library includes an automatic retry feature. We should set
max_retries=0to avoid the issue of double-layered retries. - 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.
- Although it won't make a substantial difference, I still prefer to use
is not Nonefor a more rigorous evaluation of the results returned in the stream, rather than the current approach of directly converting to a boolean type. - 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.
- The examples in the official Python Docker documentation use the
pipcommand rather than thepip3command. Please explain why this change is necessary.
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.
The issue addressed by this pull request has already been resolved long ago, so it will be closed.