Skip to content

Commit cec607d

Browse files
committed
doc
1 parent c84016e commit cec607d

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/openai/_resources_proxy.py

+16-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@
77

88

99
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+
1024
_loaded = None
1125

1226
@override
@@ -15,8 +29,8 @@ def __load__(self) -> Any:
1529
return self._loaded
1630

1731
import importlib
18-
mod = importlib.import_module('openai.resources')
19-
self._loaded = mod
32+
33+
self._loaded = mod = importlib.import_module("openai.resources")
2034
return mod
2135

2236

0 commit comments

Comments
 (0)