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".
This commit is contained in:
Soulter
2024-08-17 06:19:08 -04:00
parent a9c6a68c5f
commit d3b0f25cfe

View File

@@ -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()