Update openai.py

增加环境变量,支持OPENAI_API_BASE 支持中转站
This commit is contained in:
Qodi 2025-04-10 12:10:35 +08:00 committed by GitHub
parent 28d462e46f
commit 8f3068f1c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -81,6 +81,8 @@ def create_openai_async_client(
if base_url is not None:
merged_configs["base_url"] = base_url
else:
merged_configs["base_url"] = os.environ["OPENAI_API_BASE"]
return AsyncOpenAI(**merged_configs)