From d3b0f25cfe26c6e4afb9c2c234a01c2dcaee5f11 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Sat, 17 Aug 2024 06:19:08 -0400 Subject: [PATCH] refactor: Update ProviderOpenAIOfficial to skip test message when TEST_MODE=on This commit updates the `ProviderOpenAIOfficial` class to skip returning the test message when the environment variable `TEST_MODE` is set to "on". This change ensures that the test message is only returned when both `TEST_LLM` and `TEST_MODE` are set to "on". --- model/provider/openai_official.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/provider/openai_official.py b/model/provider/openai_official.py index c428af81f..981f33a6b 100644 --- a/model/provider/openai_official.py +++ b/model/provider/openai_official.py @@ -296,7 +296,7 @@ class ProviderOpenAIOfficial(Provider): extra_conf: Dict = None, **kwargs ) -> str: - if os.environ.get("TEST_LLM", "off") != "on": + if os.environ.get("TEST_LLM", "off") != "on" and os.environ.get("TEST_MODE", "off") == "on": return "这是一个测试消息。" super().accu_model_stat()