Skip to content

Commit c5f0cc4

Browse files
authored
Add openai/datalib/__init__.py (#404)
Signed-off-by: harupy <[email protected]>
1 parent d6fa3bf commit c5f0cc4

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

openai/datalib/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""
2+
This module helps make data libraries like `numpy` and `pandas` optional dependencies.
3+
4+
The libraries add up to 130MB+, which makes it challenging to deploy applications
5+
using this library in environments with code size constraints, like AWS Lambda.
6+
7+
This module serves as an import proxy and provides a few utilities for dealing with the optionality.
8+
9+
Since the primary use case of this library (talking to the OpenAI API) doesn't generally require data libraries,
10+
it's safe to make them optional. The rare case when data libraries are needed in the client is handled through
11+
assertions with instructive error messages.
12+
13+
See also `setup.py`.
14+
"""

openai/datalib/common.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,8 @@
1-
"""
2-
This module helps make data libraries like `numpy` and `pandas` optional dependencies.
3-
4-
The libraries add up to 130MB+, which makes it challenging to deploy applications
5-
using this library in environments with code size constraints, like AWS Lambda.
6-
7-
This module serves as an import proxy and provides a few utilities for dealing with the optionality.
8-
9-
Since the primary use case of this library (talking to the OpenAI API) doesn’t generally require data libraries,
10-
it’s safe to make them optional. The rare case when data libraries are needed in the client is handled through
11-
assertions with instructive error messages.
12-
13-
See also `setup.py`.
14-
15-
"""
161
INSTRUCTIONS = """
172
18-
OpenAI error:
3+
OpenAI error:
194
20-
missing `{library}`
5+
missing `{library}`
216
227
This feature requires additional dependencies:
238

0 commit comments

Comments
 (0)