File tree 2 files changed +28
-0
lines changed
2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 3
3
from __future__ import annotations
4
4
5
5
import os as _os
6
+ import typing as _t
6
7
from typing_extensions import override
7
8
8
9
from . import types
78
79
"DefaultAsyncHttpxClient" ,
79
80
]
80
81
82
+ if not _t .TYPE_CHECKING :
83
+ from ._utils ._resources_proxy import resources as resources
84
+
81
85
from .lib import azure as _azure , pydantic_function_tool as pydantic_function_tool
82
86
from .version import VERSION as VERSION
83
87
from .lib .azure import AzureOpenAI as AzureOpenAI , AsyncAzureOpenAI as AsyncAzureOpenAI
Original file line number Diff line number Diff line change
1
+ from __future__ import annotations
2
+
3
+ from typing import Any
4
+ from typing_extensions import override
5
+
6
+ from ._proxy import LazyProxy
7
+
8
+
9
+ class ResourcesProxy (LazyProxy [Any ]):
10
+ """A proxy for the `openai.resources` module.
11
+
12
+ This is used so that we can lazily import `openai.resources` only when
13
+ needed *and* so that users can just import `openai` and reference `openai.resources`
14
+ """
15
+
16
+ @override
17
+ def __load__ (self ) -> Any :
18
+ import importlib
19
+
20
+ mod = importlib .import_module ("openai.resources" )
21
+ return mod
22
+
23
+
24
+ resources = ResourcesProxy ().__as_proxied__ ()
You can’t perform that action at this time.
0 commit comments