File tree Expand file tree Collapse file tree 1 file changed +16
-13
lines changed
libs/partners/openai/langchain_openai/chat_models Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -762,20 +762,23 @@ def validate_environment(self) -> Self:
762762 self .openai_api_base = self .openai_api_base or os .getenv ("OPENAI_API_BASE" )
763763
764764 # Enable stream_usage by default if using default base URL and client
765- if all (
766- getattr (self , key , None ) is None
767- for key in (
768- "stream_usage" ,
769- "openai_proxy" ,
770- "openai_api_base" ,
771- "base_url" ,
772- "client" ,
773- "root_client" ,
774- "async_client" ,
775- "root_async_client" ,
776- "http_client" ,
777- "http_async_client" ,
765+ if (
766+ all (
767+ getattr (self , key , None ) is None
768+ for key in (
769+ "stream_usage" ,
770+ "openai_proxy" ,
771+ "openai_api_base" ,
772+ "base_url" ,
773+ "client" ,
774+ "root_client" ,
775+ "async_client" ,
776+ "root_async_client" ,
777+ "http_client" ,
778+ "http_async_client" ,
779+ )
778780 )
781+ and "OPENAI_BASE_URL" not in os .environ
779782 ):
780783 self .stream_usage = True
781784
You can’t perform that action at this time.
0 commit comments