nalgeon / pokitoki

Humble GPT Telegram Bot
MIT License
317 stars 56 forks source link

update openai>=1.3.0 to support OPENAI_BASE_URL environment variable #34

Closed tandav closed 1 year ago

tandav commented 1 year ago

Hi, thank you for great project. It would be nice to update openai to >=1.3.0. It support base_url setting via argument to client or via OPENAI_BASE_URL environment variable.

This setting allows to use openai api proxy and access openai api if it's blocked. For example, someone can set:

os.environ['OPENAI_BASE_URL'] = 'https://openai-proxy.company.com/v1'

And use it if default api url https://api.openai.com/v1 is blocked, or giving some cloudflare errors.

nalgeon commented 1 year ago

Updated openai to 1.3.3.