From fa2aa0b215cd2fca3d90d8de92e41c6fadb88ed6 Mon Sep 17 00:00:00 2001 From: Future-Outlier Date: Wed, 27 Mar 2024 06:34:56 +0800 Subject: [PATCH] [flytekitplugins] Rename ChatGPT module to OpenAI module (#2263) * refactor chagpt module to openai module Signed-off-by: Future-Outlier * nit Signed-off-by: Future-Outlier --------- Signed-off-by: Future-Outlier --- plugins/flytekit-openai/README.md | 4 ++-- .../flytekitplugins/{chatgpt => openai}/__init__.py | 6 +++--- .../flytekitplugins/openai/chatgpt/__init__.py | 0 .../flytekitplugins/{ => openai}/chatgpt/agent.py | 0 .../flytekitplugins/{ => openai}/chatgpt/task.py | 0 plugins/flytekit-openai/setup.py | 8 ++++---- plugins/flytekit-openai/tests/__init__.py | 0 plugins/flytekit-openai/tests/test_chatgpt.py | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) rename plugins/flytekit-openai/flytekitplugins/{chatgpt => openai}/__init__.py (59%) create mode 100644 plugins/flytekit-openai/flytekitplugins/openai/chatgpt/__init__.py rename plugins/flytekit-openai/flytekitplugins/{ => openai}/chatgpt/agent.py (100%) rename plugins/flytekit-openai/flytekitplugins/{ => openai}/chatgpt/task.py (100%) create mode 100644 plugins/flytekit-openai/tests/__init__.py diff --git a/plugins/flytekit-openai/README.md b/plugins/flytekit-openai/README.md index 21c5553ce7..f93b634735 100644 --- a/plugins/flytekit-openai/README.md +++ b/plugins/flytekit-openai/README.md @@ -4,7 +4,7 @@ ChatGPT plugin allows you to run ChatGPT tasks in the Flyte workflow without cha ## Example ```python from flytekit import task, workflow -from flytekitplugins.chatgpt import ChatGPTTask, ChatGPTConfig +from flytekitplugins.openai import ChatGPTTask, ChatGPTConfig chatgpt_small_job = ChatGPTTask( name="chatgpt gpt-3.5-turbo", @@ -40,5 +40,5 @@ if __name__ == "__main__": To install the plugin, run the following command: ```bash -pip install flytekitplugins-chatgpt +pip install flytekitplugins-openai ``` diff --git a/plugins/flytekit-openai/flytekitplugins/chatgpt/__init__.py b/plugins/flytekit-openai/flytekitplugins/openai/__init__.py similarity index 59% rename from plugins/flytekit-openai/flytekitplugins/chatgpt/__init__.py rename to plugins/flytekit-openai/flytekitplugins/openai/__init__.py index 64dd73fb35..58e99f747e 100644 --- a/plugins/flytekit-openai/flytekitplugins/chatgpt/__init__.py +++ b/plugins/flytekit-openai/flytekitplugins/openai/__init__.py @@ -1,5 +1,5 @@ """ -.. currentmodule:: flytekitplugins.chatgpt +.. currentmodule:: flytekitplugins.openai This package contains things that are useful when extending Flytekit. .. autosummary:: :template: custom.rst @@ -8,5 +8,5 @@ ChatGPTTask """ -from .agent import ChatGPTAgent -from .task import ChatGPTTask +from .chatgpt.agent import ChatGPTAgent +from .chatgpt.task import ChatGPTTask diff --git a/plugins/flytekit-openai/flytekitplugins/openai/chatgpt/__init__.py b/plugins/flytekit-openai/flytekitplugins/openai/chatgpt/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/plugins/flytekit-openai/flytekitplugins/chatgpt/agent.py b/plugins/flytekit-openai/flytekitplugins/openai/chatgpt/agent.py similarity index 100% rename from plugins/flytekit-openai/flytekitplugins/chatgpt/agent.py rename to plugins/flytekit-openai/flytekitplugins/openai/chatgpt/agent.py diff --git a/plugins/flytekit-openai/flytekitplugins/chatgpt/task.py b/plugins/flytekit-openai/flytekitplugins/openai/chatgpt/task.py similarity index 100% rename from plugins/flytekit-openai/flytekitplugins/chatgpt/task.py rename to plugins/flytekit-openai/flytekitplugins/openai/chatgpt/task.py diff --git a/plugins/flytekit-openai/setup.py b/plugins/flytekit-openai/setup.py index 82257c2435..9a7fff284a 100644 --- a/plugins/flytekit-openai/setup.py +++ b/plugins/flytekit-openai/setup.py @@ -1,10 +1,10 @@ from setuptools import setup -PLUGIN_NAME = "chatgpt" +PLUGIN_NAME = "openai" microlib_name = f"flytekitplugins-{PLUGIN_NAME}" -plugin_requires = ["flytekit>1.10.7", "openai>=1.12.0", "flyteidl>=1.11.0b0"] +plugin_requires = ["flytekit>1.10.7", "openai>=1.12.0", "flyteidl>=1.11.0"] __version__ = "0.0.0+develop" @@ -13,9 +13,9 @@ version=__version__, author="flyteorg", author_email="admin@flyte.org", - description="This package holds the ChatGPT plugins for flytekit", + description="This package holds the openai plugins for flytekit", namespace_packages=["flytekitplugins"], - packages=[f"flytekitplugins.{PLUGIN_NAME}"], + packages=[f"flytekitplugins.{PLUGIN_NAME}", f"flytekitplugins.{PLUGIN_NAME}.chatgpt"], install_requires=plugin_requires, license="apache2", python_requires=">=3.8", diff --git a/plugins/flytekit-openai/tests/__init__.py b/plugins/flytekit-openai/tests/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/plugins/flytekit-openai/tests/test_chatgpt.py b/plugins/flytekit-openai/tests/test_chatgpt.py index f85f94cc7b..6298bdf52c 100644 --- a/plugins/flytekit-openai/tests/test_chatgpt.py +++ b/plugins/flytekit-openai/tests/test_chatgpt.py @@ -1,6 +1,6 @@ from collections import OrderedDict -from flytekitplugins.chatgpt import ChatGPTTask +from flytekitplugins.openai import ChatGPTTask from flytekit.configuration import Image, ImageConfig, SerializationSettings from flytekit.extend import get_serializable