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 @@ -776,20 +776,23 @@ def validate_environment(self) -> Self:
776
776
self .openai_api_base = self .openai_api_base or os .getenv ("OPENAI_API_BASE" )
777
777
778
778
# Enable stream_usage by default if using default base URL and client
779
- if all (
780
- getattr (self , key , None ) is None
781
- for key in (
782
- "stream_usage" ,
783
- "openai_proxy" ,
784
- "openai_api_base" ,
785
- "base_url" ,
786
- "client" ,
787
- "root_client" ,
788
- "async_client" ,
789
- "root_async_client" ,
790
- "http_client" ,
791
- "http_async_client" ,
779
+ if (
780
+ all (
781
+ getattr (self , key , None ) is None
782
+ for key in (
783
+ "stream_usage" ,
784
+ "openai_proxy" ,
785
+ "openai_api_base" ,
786
+ "base_url" ,
787
+ "client" ,
788
+ "root_client" ,
789
+ "async_client" ,
790
+ "root_async_client" ,
791
+ "http_client" ,
792
+ "http_async_client" ,
793
+ )
792
794
)
795
+ and "OPENAI_BASE_URL" not in os .environ
793
796
):
794
797
self .stream_usage = True
795
798
You can’t perform that action at this time.
0 commit comments