Skip to content

Add openai/datalib/__init__.py #404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions openai/datalib/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""
This module helps make data libraries like `numpy` and `pandas` optional dependencies.

The libraries add up to 130MB+, which makes it challenging to deploy applications
using this library in environments with code size constraints, like AWS Lambda.

This module serves as an import proxy and provides a few utilities for dealing with the optionality.

Since the primary use case of this library (talking to the OpenAI API) doesn't generally require data libraries,
it's safe to make them optional. The rare case when data libraries are needed in the client is handled through
assertions with instructive error messages.

See also `setup.py`.
"""
19 changes: 2 additions & 17 deletions openai/datalib/common.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
"""
This module helps make data libraries like `numpy` and `pandas` optional dependencies.

The libraries add up to 130MB+, which makes it challenging to deploy applications
using this library in environments with code size constraints, like AWS Lambda.

This module serves as an import proxy and provides a few utilities for dealing with the optionality.

Since the primary use case of this library (talking to the OpenAI API) doesn’t generally require data libraries,
it’s safe to make them optional. The rare case when data libraries are needed in the client is handled through
assertions with instructive error messages.

See also `setup.py`.

"""
INSTRUCTIONS = """

OpenAI error:
OpenAI error:

missing `{library}`
missing `{library}`

This feature requires additional dependencies:

Expand Down