From 6ed8f696ef4b05daaf48ef5ffae69d0e07033e0f Mon Sep 17 00:00:00 2001 From: Wannabeasmartguy <107250451+Wannabeasmartguy@users.noreply.github.com> Date: Sat, 30 Mar 2024 09:24:10 +0800 Subject: [PATCH] =?UTF-8?q?fix=20the=20problem=20config=5Flist=5Ffrom=5Fdo?= =?UTF-8?q?tenv()=20can't=20correctly=20get=20other=20p=E2=80=A6=20(#2172)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix the problem config_list_from_dotenv() can't correctly get other params * Update openai_utils.py --------- Co-authored-by: Aaron Co-authored-by: Chi Wang --- autogen/oai/openai_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autogen/oai/openai_utils.py b/autogen/oai/openai_utils.py index 411ac03f0..b6f888906 100644 --- a/autogen/oai/openai_utils.py +++ b/autogen/oai/openai_utils.py @@ -541,11 +541,11 @@ def get_config( """ config = {"api_key": api_key} if base_url: - config["base_url"] = base_url + config["base_url"] = os.getenv(base_url, default=base_url) if api_type: - config["api_type"] = api_type + config["api_type"] = os.getenv(api_type, default=api_type) if api_version: - config["api_version"] = api_version + config["api_version"] = os.getenv(api_version, default=api_version) return config