diff --git a/devchat/openai/openai_chat.py b/devchat/openai/openai_chat.py index 46cf2456..70e76ece 100755 --- a/devchat/openai/openai_chat.py +++ b/devchat/openai/openai_chat.py @@ -99,7 +99,10 @@ def stream_response(self, prompt: OpenAIPrompt) -> Iterator: api_key = os.environ.get("OPENAI_API_KEY", None) base_url = os.environ.get("OPENAI_API_BASE", "https://api.openai.com/v1/") - if not os.environ.get("USE_TIKTOKEN", False) and base_url != "https://api.openai.com/v1/": + if ( + not os.environ.get("USE_TIKTOKEN", False) + and base_url.find("https://api.openai.com/v1") == -1 + ): config_params = self.config.dict(exclude_unset=True) if prompt.get_functions(): config_params["functions"] = prompt.get_functions()