We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c84016e commit cec607dCopy full SHA for cec607d
src/openai/_resources_proxy.py
@@ -7,6 +7,20 @@
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
+ e.g.
16
17
+ ```py
18
+ import openai
19
20
+ completions: openai.resources.chat.Completions
21
+ ```
22
+ """
23
24
_loaded = None
25
26
@override
@@ -15,8 +29,8 @@ def __load__(self) -> Any:
29
return self._loaded
30
31
import importlib
- mod = importlib.import_module('openai.resources')
- self._loaded = mod
32
33
+ self._loaded = mod = importlib.import_module("openai.resources")
34
return mod
35
36
0 commit comments