From 73c86ff0830861fb551cc06cef9d12337ec59498 Mon Sep 17 00:00:00 2001 From: Fangyin Cheng Date: Mon, 22 Jan 2024 15:33:43 +0800 Subject: [PATCH] chore: Fix package name conflict error (#1099) --- dbgpt/app/scene/base_chat.py | 2 +- dbgpt/app/scene/{operator => operators}/__init__.py | 0 dbgpt/app/scene/{operator => operators}/app_operator.py | 4 ++-- dbgpt/core/awel/__init__.py | 8 ++++---- dbgpt/core/awel/dag/base.py | 2 +- dbgpt/core/awel/{operator => operators}/__init__.py | 0 dbgpt/core/awel/{operator => operators}/base.py | 0 .../core/awel/{operator => operators}/common_operator.py | 0 .../core/awel/{operator => operators}/stream_operator.py | 0 dbgpt/core/awel/runner/job_manager.py | 2 +- dbgpt/core/awel/runner/local_runner.py | 6 +++--- dbgpt/core/awel/trigger/base.py | 2 +- dbgpt/core/awel/trigger/http_trigger.py | 2 +- dbgpt/core/interface/{operator => operators}/__init__.py | 0 .../{operator => operators}/composer_operator.py | 2 +- .../interface/{operator => operators}/llm_operator.py | 0 .../interface/{operator => operators}/message_operator.py | 4 ++-- .../interface/{operator => operators}/prompt_operator.py | 6 +++--- dbgpt/core/interface/{operator => operators}/retriever.py | 0 dbgpt/core/{operator => operators}/__init__.py | 8 ++++---- dbgpt/datasource/{operator => operators}/__init__.py | 0 .../{operator => operators}/datasource_operator.py | 0 dbgpt/model/{operator => operators}/__init__.py | 2 +- dbgpt/model/{operator => operators}/llm_operator.py | 2 +- dbgpt/model/utils/chatgpt_utils.py | 2 +- dbgpt/rag/{operator => operators}/__init__.py | 0 dbgpt/rag/{operator => operators}/datasource.py | 2 +- dbgpt/rag/{operator => operators}/db_schema.py | 2 +- dbgpt/rag/{operator => operators}/embedding.py | 2 +- dbgpt/rag/{operator => operators}/knowledge.py | 0 dbgpt/rag/{operator => operators}/rerank.py | 0 dbgpt/rag/{operator => operators}/rewrite.py | 0 dbgpt/rag/{operator => operators}/schema_linking.py | 0 dbgpt/rag/{operator => operators}/summary.py | 0 dbgpt/serve/conversation/operator.py | 2 +- examples/awel/data_analyst_assistant.py | 4 ++-- examples/awel/simple_chat_dag_example.py | 2 +- examples/awel/simple_chat_history_example.py | 4 ++-- examples/awel/simple_dbschema_retriever_example.py | 2 +- examples/awel/simple_llm_client_example.py | 4 ++-- examples/awel/simple_nl_schema_sql_chart_example.py | 4 ++-- examples/awel/simple_rag_embedding_example.py | 2 +- examples/awel/simple_rag_retriever_example.py | 6 +++--- examples/awel/simple_rag_rewrite_example.py | 2 +- examples/awel/simple_rag_summary_example.py | 4 ++-- examples/sdk/simple_sdk_llm_example.py | 2 +- examples/sdk/simple_sdk_llm_sql_example.py | 6 +++--- setup.py | 4 ++-- 48 files changed, 54 insertions(+), 54 deletions(-) rename dbgpt/app/scene/{operator => operators}/__init__.py (100%) rename dbgpt/app/scene/{operator => operators}/app_operator.py (98%) rename dbgpt/core/awel/{operator => operators}/__init__.py (100%) rename dbgpt/core/awel/{operator => operators}/base.py (100%) rename dbgpt/core/awel/{operator => operators}/common_operator.py (100%) rename dbgpt/core/awel/{operator => operators}/stream_operator.py (100%) rename dbgpt/core/interface/{operator => operators}/__init__.py (100%) rename dbgpt/core/interface/{operator => operators}/composer_operator.py (97%) rename dbgpt/core/interface/{operator => operators}/llm_operator.py (100%) rename dbgpt/core/interface/{operator => operators}/message_operator.py (99%) rename dbgpt/core/interface/{operator => operators}/prompt_operator.py (98%) rename dbgpt/core/interface/{operator => operators}/retriever.py (100%) rename dbgpt/core/{operator => operators}/__init__.py (79%) rename dbgpt/datasource/{operator => operators}/__init__.py (100%) rename dbgpt/datasource/{operator => operators}/datasource_operator.py (100%) rename dbgpt/model/{operator => operators}/__init__.py (81%) rename dbgpt/model/{operator => operators}/llm_operator.py (97%) rename dbgpt/rag/{operator => operators}/__init__.py (100%) rename dbgpt/rag/{operator => operators}/datasource.py (86%) rename dbgpt/rag/{operator => operators}/db_schema.py (94%) rename dbgpt/rag/{operator => operators}/embedding.py (95%) rename dbgpt/rag/{operator => operators}/knowledge.py (100%) rename dbgpt/rag/{operator => operators}/rerank.py (100%) rename dbgpt/rag/{operator => operators}/rewrite.py (100%) rename dbgpt/rag/{operator => operators}/schema_linking.py (100%) rename dbgpt/rag/{operator => operators}/summary.py (100%) diff --git a/dbgpt/app/scene/base_chat.py b/dbgpt/app/scene/base_chat.py index 10f738d3b..9ed49f623 100644 --- a/dbgpt/app/scene/base_chat.py +++ b/dbgpt/app/scene/base_chat.py @@ -8,7 +8,7 @@ from dbgpt._private.config import Config from dbgpt._private.pydantic import Extra from dbgpt.app.scene.base import AppScenePromptTemplateAdapter, ChatScene -from dbgpt.app.scene.operator.app_operator import ( +from dbgpt.app.scene.operators.app_operator import ( AppChatComposerOperator, ChatComposerInput, build_cached_chat_operator, diff --git a/dbgpt/app/scene/operator/__init__.py b/dbgpt/app/scene/operators/__init__.py similarity index 100% rename from dbgpt/app/scene/operator/__init__.py rename to dbgpt/app/scene/operators/__init__.py diff --git a/dbgpt/app/scene/operator/app_operator.py b/dbgpt/app/scene/operators/app_operator.py similarity index 98% rename from dbgpt/app/scene/operator/app_operator.py rename to dbgpt/app/scene/operators/app_operator.py index 91f65e357..c4fc223f7 100644 --- a/dbgpt/app/scene/operator/app_operator.py +++ b/dbgpt/app/scene/operators/app_operator.py @@ -18,12 +18,12 @@ MapOperator, SimpleCallDataInputSource, ) -from dbgpt.core.operator import ( +from dbgpt.core.operators import ( BufferedConversationMapperOperator, HistoryPromptBuilderOperator, LLMBranchOperator, ) -from dbgpt.model.operator import LLMOperator, StreamingLLMOperator +from dbgpt.model.operators import LLMOperator, StreamingLLMOperator from dbgpt.storage.cache.operator import ( CachedModelOperator, CachedModelStreamOperator, diff --git a/dbgpt/core/awel/__init__.py b/dbgpt/core/awel/__init__.py index c97ef1186..0ca96c278 100644 --- a/dbgpt/core/awel/__init__.py +++ b/dbgpt/core/awel/__init__.py @@ -14,8 +14,8 @@ from dbgpt.component import SystemApp from .dag.base import DAG, DAGContext -from .operator.base import BaseOperator, WorkflowRunner -from .operator.common_operator import ( +from .operators.base import BaseOperator, WorkflowRunner +from .operators.common_operator import ( BranchFunc, BranchOperator, InputOperator, @@ -24,7 +24,7 @@ ReduceStreamOperator, TriggerOperator, ) -from .operator.stream_operator import ( +from .operators.stream_operator import ( StreamifyAbsOperator, TransformStreamAbsOperator, UnstreamifyAbsOperator, @@ -82,7 +82,7 @@ def initialize_awel(system_app: SystemApp, dag_dirs: List[str]): """Initialize AWEL.""" from .dag.base import DAGVar from .dag.dag_manager import DAGManager - from .operator.base import initialize_runner + from .operators.base import initialize_runner from .trigger.trigger_manager import DefaultTriggerManager DAGVar.set_current_system_app(system_app) diff --git a/dbgpt/core/awel/dag/base.py b/dbgpt/core/awel/dag/base.py index 5db95f244..56e4dcbf1 100644 --- a/dbgpt/core/awel/dag/base.py +++ b/dbgpt/core/awel/dag/base.py @@ -629,7 +629,7 @@ def dag_id(self) -> str: return self._dag_id def _build(self) -> None: - from ..operator.common_operator import TriggerOperator + from ..operators.common_operator import TriggerOperator nodes: Set[DAGNode] = set() for _, node in self.node_map.items(): diff --git a/dbgpt/core/awel/operator/__init__.py b/dbgpt/core/awel/operators/__init__.py similarity index 100% rename from dbgpt/core/awel/operator/__init__.py rename to dbgpt/core/awel/operators/__init__.py diff --git a/dbgpt/core/awel/operator/base.py b/dbgpt/core/awel/operators/base.py similarity index 100% rename from dbgpt/core/awel/operator/base.py rename to dbgpt/core/awel/operators/base.py diff --git a/dbgpt/core/awel/operator/common_operator.py b/dbgpt/core/awel/operators/common_operator.py similarity index 100% rename from dbgpt/core/awel/operator/common_operator.py rename to dbgpt/core/awel/operators/common_operator.py diff --git a/dbgpt/core/awel/operator/stream_operator.py b/dbgpt/core/awel/operators/stream_operator.py similarity index 100% rename from dbgpt/core/awel/operator/stream_operator.py rename to dbgpt/core/awel/operators/stream_operator.py diff --git a/dbgpt/core/awel/runner/job_manager.py b/dbgpt/core/awel/runner/job_manager.py index f67705ffd..087f55991 100644 --- a/dbgpt/core/awel/runner/job_manager.py +++ b/dbgpt/core/awel/runner/job_manager.py @@ -5,7 +5,7 @@ from typing import Dict, List, Optional, cast from ..dag.base import DAGLifecycle -from ..operator.base import CALL_DATA, BaseOperator +from ..operators.base import CALL_DATA, BaseOperator logger = logging.getLogger(__name__) diff --git a/dbgpt/core/awel/runner/local_runner.py b/dbgpt/core/awel/runner/local_runner.py index b0882059b..bfd4a8da5 100644 --- a/dbgpt/core/awel/runner/local_runner.py +++ b/dbgpt/core/awel/runner/local_runner.py @@ -8,8 +8,8 @@ from dbgpt.component import SystemApp from ..dag.base import DAGContext, DAGVar -from ..operator.base import CALL_DATA, BaseOperator, WorkflowRunner -from ..operator.common_operator import BranchOperator, JoinOperator +from ..operators.base import CALL_DATA, BaseOperator, WorkflowRunner +from ..operators.common_operator import BranchOperator, JoinOperator from ..task.base import SKIP_DATA, TaskContext, TaskState from ..task.task_impl import DefaultInputContext, DefaultTaskContext, SimpleTaskOutput from .job_manager import JobManager @@ -80,7 +80,7 @@ async def _execute_node( if node.node_id in node_outputs: return - # Run all upstream node + # Run all upstream nodes for upstream_node in node.upstream: if isinstance(upstream_node, BaseOperator): await self._execute_node( diff --git a/dbgpt/core/awel/trigger/base.py b/dbgpt/core/awel/trigger/base.py index c2410199f..309153eed 100644 --- a/dbgpt/core/awel/trigger/base.py +++ b/dbgpt/core/awel/trigger/base.py @@ -3,7 +3,7 @@ from abc import ABC, abstractmethod -from ..operator.common_operator import TriggerOperator +from ..operators.common_operator import TriggerOperator class Trigger(TriggerOperator, ABC): diff --git a/dbgpt/core/awel/trigger/http_trigger.py b/dbgpt/core/awel/trigger/http_trigger.py index c77bd8b7e..f803bb945 100644 --- a/dbgpt/core/awel/trigger/http_trigger.py +++ b/dbgpt/core/awel/trigger/http_trigger.py @@ -6,7 +6,7 @@ from dbgpt._private.pydantic import BaseModel from ..dag.base import DAG -from ..operator.base import BaseOperator +from ..operators.base import BaseOperator from .base import Trigger if TYPE_CHECKING: diff --git a/dbgpt/core/interface/operator/__init__.py b/dbgpt/core/interface/operators/__init__.py similarity index 100% rename from dbgpt/core/interface/operator/__init__.py rename to dbgpt/core/interface/operators/__init__.py diff --git a/dbgpt/core/interface/operator/composer_operator.py b/dbgpt/core/interface/operators/composer_operator.py similarity index 97% rename from dbgpt/core/interface/operator/composer_operator.py rename to dbgpt/core/interface/operators/composer_operator.py index bf7a41204..0ba83e1aa 100644 --- a/dbgpt/core/interface/operator/composer_operator.py +++ b/dbgpt/core/interface/operators/composer_operator.py @@ -21,7 +21,7 @@ MapOperator, SimpleCallDataInputSource, ) -from dbgpt.core.interface.operator.prompt_operator import HistoryPromptBuilderOperator +from dbgpt.core.interface.operators.prompt_operator import HistoryPromptBuilderOperator from .message_operator import ( BufferedConversationMapperOperator, diff --git a/dbgpt/core/interface/operator/llm_operator.py b/dbgpt/core/interface/operators/llm_operator.py similarity index 100% rename from dbgpt/core/interface/operator/llm_operator.py rename to dbgpt/core/interface/operators/llm_operator.py diff --git a/dbgpt/core/interface/operator/message_operator.py b/dbgpt/core/interface/operators/message_operator.py similarity index 99% rename from dbgpt/core/interface/operator/message_operator.py rename to dbgpt/core/interface/operators/message_operator.py index a692d8d22..3a3ae2dea 100644 --- a/dbgpt/core/interface/operator/message_operator.py +++ b/dbgpt/core/interface/operators/message_operator.py @@ -270,7 +270,7 @@ class BufferedConversationMapperOperator(ConversationMapperOperator): # Keeping the first 2 and the last 1 rounds of a conversation import asyncio from dbgpt.core.interface.message import AIMessage, HumanMessage - from dbgpt.core.operator import BufferedConversationMapperOperator + from dbgpt.core.operators import BufferedConversationMapperOperator operator = BufferedConversationMapperOperator( keep_start_rounds=2, keep_end_rounds=1 @@ -338,7 +338,7 @@ def _filter_round_messages( Examples: >>> from dbgpt.core import AIMessage, HumanMessage - >>> from dbgpt.core.operator import BufferedConversationMapperOperator + >>> from dbgpt.core.operators import BufferedConversationMapperOperator >>> messages = [ ... [ ... HumanMessage(content="Hi", round_index=1), diff --git a/dbgpt/core/interface/operator/prompt_operator.py b/dbgpt/core/interface/operators/prompt_operator.py similarity index 98% rename from dbgpt/core/interface/operator/prompt_operator.py rename to dbgpt/core/interface/operators/prompt_operator.py index f31172533..ee35f7b99 100644 --- a/dbgpt/core/interface/operator/prompt_operator.py +++ b/dbgpt/core/interface/operators/prompt_operator.py @@ -11,8 +11,8 @@ ) from dbgpt.core.awel import JoinOperator, MapOperator from dbgpt.core.interface.message import BaseMessage -from dbgpt.core.interface.operator.llm_operator import BaseLLM -from dbgpt.core.interface.operator.message_operator import BaseConversationOperator +from dbgpt.core.interface.operators.llm_operator import BaseLLM +from dbgpt.core.interface.operators.message_operator import BaseConversationOperator from dbgpt.core.interface.prompt import ( BaseChatPromptTemplate, HumanPromptTemplate, @@ -115,7 +115,7 @@ class PromptBuilderOperator( SystemPromptTemplate, ChatPromptTemplate, ) - from dbgpt.core.operator import PromptBuilderOperator + from dbgpt.core.operators import PromptBuilderOperator with DAG("prompt_test") as dag: str_prompt = PromptBuilderOperator( diff --git a/dbgpt/core/interface/operator/retriever.py b/dbgpt/core/interface/operators/retriever.py similarity index 100% rename from dbgpt/core/interface/operator/retriever.py rename to dbgpt/core/interface/operators/retriever.py diff --git a/dbgpt/core/operator/__init__.py b/dbgpt/core/operators/__init__.py similarity index 79% rename from dbgpt/core/operator/__init__.py rename to dbgpt/core/operators/__init__.py index 0136adf8d..044dd3892 100644 --- a/dbgpt/core/operator/__init__.py +++ b/dbgpt/core/operators/__init__.py @@ -1,24 +1,24 @@ """All core operators.""" -from dbgpt.core.interface.operator.composer_operator import ( # noqa: F401 +from dbgpt.core.interface.operators.composer_operator import ( # noqa: F401 ChatComposerInput, ChatHistoryPromptComposerOperator, ) -from dbgpt.core.interface.operator.llm_operator import ( # noqa: F401 +from dbgpt.core.interface.operators.llm_operator import ( # noqa: F401 BaseLLM, BaseLLMOperator, BaseStreamingLLMOperator, LLMBranchOperator, RequestBuilderOperator, ) -from dbgpt.core.interface.operator.message_operator import ( # noqa: F401 +from dbgpt.core.interface.operators.message_operator import ( # noqa: F401 BaseConversationOperator, BufferedConversationMapperOperator, ConversationMapperOperator, PreChatHistoryLoadOperator, TokenBufferedConversationMapperOperator, ) -from dbgpt.core.interface.operator.prompt_operator import ( # noqa: F401 +from dbgpt.core.interface.operators.prompt_operator import ( # noqa: F401 DynamicPromptBuilderOperator, HistoryDynamicPromptBuilderOperator, HistoryPromptBuilderOperator, diff --git a/dbgpt/datasource/operator/__init__.py b/dbgpt/datasource/operators/__init__.py similarity index 100% rename from dbgpt/datasource/operator/__init__.py rename to dbgpt/datasource/operators/__init__.py diff --git a/dbgpt/datasource/operator/datasource_operator.py b/dbgpt/datasource/operators/datasource_operator.py similarity index 100% rename from dbgpt/datasource/operator/datasource_operator.py rename to dbgpt/datasource/operators/datasource_operator.py diff --git a/dbgpt/model/operator/__init__.py b/dbgpt/model/operators/__init__.py similarity index 81% rename from dbgpt/model/operator/__init__.py rename to dbgpt/model/operators/__init__.py index ec628d6b3..5e01effd2 100644 --- a/dbgpt/model/operator/__init__.py +++ b/dbgpt/model/operators/__init__.py @@ -1,4 +1,4 @@ -from dbgpt.model.operator.llm_operator import ( # noqa: F401 +from dbgpt.model.operators.llm_operator import ( # noqa: F401 LLMOperator, MixinLLMOperator, StreamingLLMOperator, diff --git a/dbgpt/model/operator/llm_operator.py b/dbgpt/model/operators/llm_operator.py similarity index 97% rename from dbgpt/model/operator/llm_operator.py rename to dbgpt/model/operators/llm_operator.py index 00c7251c3..0df796b72 100644 --- a/dbgpt/model/operator/llm_operator.py +++ b/dbgpt/model/operators/llm_operator.py @@ -5,7 +5,7 @@ from dbgpt.component import ComponentType from dbgpt.core import LLMClient from dbgpt.core.awel import BaseOperator -from dbgpt.core.operator import BaseLLM, BaseLLMOperator, BaseStreamingLLMOperator +from dbgpt.core.operators import BaseLLM, BaseLLMOperator, BaseStreamingLLMOperator logger = logging.getLogger(__name__) diff --git a/dbgpt/model/utils/chatgpt_utils.py b/dbgpt/model/utils/chatgpt_utils.py index fce5a3259..b6f0e1643 100644 --- a/dbgpt/model/utils/chatgpt_utils.py +++ b/dbgpt/model/utils/chatgpt_utils.py @@ -17,7 +17,7 @@ from dbgpt._private.pydantic import model_to_json from dbgpt.core.awel import TransformStreamAbsOperator from dbgpt.core.interface.llm import ModelOutput -from dbgpt.core.operator import BaseLLM +from dbgpt.core.operators import BaseLLM if TYPE_CHECKING: import httpx diff --git a/dbgpt/rag/operator/__init__.py b/dbgpt/rag/operators/__init__.py similarity index 100% rename from dbgpt/rag/operator/__init__.py rename to dbgpt/rag/operators/__init__.py diff --git a/dbgpt/rag/operator/datasource.py b/dbgpt/rag/operators/datasource.py similarity index 86% rename from dbgpt/rag/operator/datasource.py rename to dbgpt/rag/operators/datasource.py index 09cedeb26..e86723f12 100644 --- a/dbgpt/rag/operator/datasource.py +++ b/dbgpt/rag/operators/datasource.py @@ -1,6 +1,6 @@ from typing import Any -from dbgpt.core.interface.operator.retriever import RetrieverOperator +from dbgpt.core.interface.operators.retriever import RetrieverOperator from dbgpt.datasource.rdbms.base import RDBMSDatabase from dbgpt.rag.summary.rdbms_db_summary import _parse_db_summary diff --git a/dbgpt/rag/operator/db_schema.py b/dbgpt/rag/operators/db_schema.py similarity index 94% rename from dbgpt/rag/operator/db_schema.py rename to dbgpt/rag/operators/db_schema.py index 79c6b4012..192fd489a 100644 --- a/dbgpt/rag/operator/db_schema.py +++ b/dbgpt/rag/operators/db_schema.py @@ -1,7 +1,7 @@ from typing import Any, Optional from dbgpt.core.awel.task.base import IN -from dbgpt.core.interface.operator.retriever import RetrieverOperator +from dbgpt.core.interface.operators.retriever import RetrieverOperator from dbgpt.datasource.rdbms.base import RDBMSDatabase from dbgpt.rag.retriever.db_schema import DBSchemaRetriever from dbgpt.storage.vector_store.connector import VectorStoreConnector diff --git a/dbgpt/rag/operator/embedding.py b/dbgpt/rag/operators/embedding.py similarity index 95% rename from dbgpt/rag/operator/embedding.py rename to dbgpt/rag/operators/embedding.py index 1d749ec1b..f4810b6ce 100644 --- a/dbgpt/rag/operator/embedding.py +++ b/dbgpt/rag/operators/embedding.py @@ -2,7 +2,7 @@ from typing import Any, Optional from dbgpt.core.awel.task.base import IN -from dbgpt.core.interface.operator.retriever import RetrieverOperator +from dbgpt.core.interface.operators.retriever import RetrieverOperator from dbgpt.rag.retriever.embedding import EmbeddingRetriever from dbgpt.rag.retriever.rerank import Ranker from dbgpt.rag.retriever.rewrite import QueryRewrite diff --git a/dbgpt/rag/operator/knowledge.py b/dbgpt/rag/operators/knowledge.py similarity index 100% rename from dbgpt/rag/operator/knowledge.py rename to dbgpt/rag/operators/knowledge.py diff --git a/dbgpt/rag/operator/rerank.py b/dbgpt/rag/operators/rerank.py similarity index 100% rename from dbgpt/rag/operator/rerank.py rename to dbgpt/rag/operators/rerank.py diff --git a/dbgpt/rag/operator/rewrite.py b/dbgpt/rag/operators/rewrite.py similarity index 100% rename from dbgpt/rag/operator/rewrite.py rename to dbgpt/rag/operators/rewrite.py diff --git a/dbgpt/rag/operator/schema_linking.py b/dbgpt/rag/operators/schema_linking.py similarity index 100% rename from dbgpt/rag/operator/schema_linking.py rename to dbgpt/rag/operators/schema_linking.py diff --git a/dbgpt/rag/operator/summary.py b/dbgpt/rag/operators/summary.py similarity index 100% rename from dbgpt/rag/operator/summary.py rename to dbgpt/rag/operators/summary.py diff --git a/dbgpt/serve/conversation/operator.py b/dbgpt/serve/conversation/operator.py index ad289815c..fdf6c43be 100644 --- a/dbgpt/serve/conversation/operator.py +++ b/dbgpt/serve/conversation/operator.py @@ -7,7 +7,7 @@ StorageConversation, StorageInterface, ) -from dbgpt.core.operator import PreChatHistoryLoadOperator +from dbgpt.core.operators import PreChatHistoryLoadOperator from .serve import Serve diff --git a/examples/awel/data_analyst_assistant.py b/examples/awel/data_analyst_assistant.py index c80d06b8b..cdd7967fb 100644 --- a/examples/awel/data_analyst_assistant.py +++ b/examples/awel/data_analyst_assistant.py @@ -54,13 +54,13 @@ SystemPromptTemplate, ) from dbgpt.core.awel import DAG, HttpTrigger, JoinOperator, MapOperator -from dbgpt.core.operator import ( +from dbgpt.core.operators import ( BufferedConversationMapperOperator, HistoryDynamicPromptBuilderOperator, LLMBranchOperator, RequestBuilderOperator, ) -from dbgpt.model.operator import ( +from dbgpt.model.operators import ( LLMOperator, OpenAIStreamingOutputOperator, StreamingLLMOperator, diff --git a/examples/awel/simple_chat_dag_example.py b/examples/awel/simple_chat_dag_example.py index 439a3b574..bb0fc7242 100644 --- a/examples/awel/simple_chat_dag_example.py +++ b/examples/awel/simple_chat_dag_example.py @@ -17,7 +17,7 @@ from dbgpt._private.pydantic import BaseModel, Field from dbgpt.core import ModelMessage, ModelRequest from dbgpt.core.awel import DAG, HttpTrigger, MapOperator -from dbgpt.model.operator import LLMOperator +from dbgpt.model.operators import LLMOperator class TriggerReqBody(BaseModel): diff --git a/examples/awel/simple_chat_history_example.py b/examples/awel/simple_chat_history_example.py index 6b974ac1a..7e84985f4 100644 --- a/examples/awel/simple_chat_history_example.py +++ b/examples/awel/simple_chat_history_example.py @@ -70,12 +70,12 @@ SystemPromptTemplate, ) from dbgpt.core.awel import DAG, HttpTrigger, JoinOperator, MapOperator -from dbgpt.core.operator import ( +from dbgpt.core.operators import ( ChatComposerInput, ChatHistoryPromptComposerOperator, LLMBranchOperator, ) -from dbgpt.model.operator import ( +from dbgpt.model.operators import ( LLMOperator, OpenAIStreamingOutputOperator, StreamingLLMOperator, diff --git a/examples/awel/simple_dbschema_retriever_example.py b/examples/awel/simple_dbschema_retriever_example.py index 1edbd2100..e9119fdb4 100644 --- a/examples/awel/simple_dbschema_retriever_example.py +++ b/examples/awel/simple_dbschema_retriever_example.py @@ -8,7 +8,7 @@ from dbgpt.datasource.rdbms.conn_sqlite import SQLiteTempConnect from dbgpt.rag.chunk import Chunk from dbgpt.rag.embedding.embedding_factory import DefaultEmbeddingFactory -from dbgpt.rag.operator.db_schema import DBSchemaRetrieverOperator +from dbgpt.rag.operators.db_schema import DBSchemaRetrieverOperator from dbgpt.serve.rag.operators.db_schema import DBSchemaAssemblerOperator from dbgpt.storage.vector_store.chroma_store import ChromaVectorConfig from dbgpt.storage.vector_store.connector import VectorStoreConnector diff --git a/examples/awel/simple_llm_client_example.py b/examples/awel/simple_llm_client_example.py index 71277cd0b..d243fb71f 100644 --- a/examples/awel/simple_llm_client_example.py +++ b/examples/awel/simple_llm_client_example.py @@ -41,8 +41,8 @@ from dbgpt._private.pydantic import BaseModel, Field from dbgpt.core import LLMClient from dbgpt.core.awel import DAG, HttpTrigger, JoinOperator, MapOperator -from dbgpt.core.operator import LLMBranchOperator, RequestBuilderOperator -from dbgpt.model.operator import ( +from dbgpt.core.operators import LLMBranchOperator, RequestBuilderOperator +from dbgpt.model.operators import ( LLMOperator, MixinLLMOperator, OpenAIStreamingOutputOperator, diff --git a/examples/awel/simple_nl_schema_sql_chart_example.py b/examples/awel/simple_nl_schema_sql_chart_example.py index 47bb3fc3c..93332ec51 100644 --- a/examples/awel/simple_nl_schema_sql_chart_example.py +++ b/examples/awel/simple_nl_schema_sql_chart_example.py @@ -9,9 +9,9 @@ from dbgpt.core.awel import DAG, HttpTrigger, JoinOperator, MapOperator from dbgpt.datasource.rdbms.base import RDBMSDatabase from dbgpt.datasource.rdbms.conn_sqlite import SQLiteTempConnect -from dbgpt.model import OpenAILLMClient +from dbgpt.model.proxy import OpenAILLMClient from dbgpt.rag.embedding.embedding_factory import DefaultEmbeddingFactory -from dbgpt.rag.operator.schema_linking import SchemaLinkingOperator +from dbgpt.rag.operators.schema_linking import SchemaLinkingOperator from dbgpt.storage.vector_store.chroma_store import ChromaVectorConfig from dbgpt.storage.vector_store.connector import VectorStoreConnector from dbgpt.util.chat_util import run_async_tasks diff --git a/examples/awel/simple_rag_embedding_example.py b/examples/awel/simple_rag_embedding_example.py index 1f1763af1..a49475acc 100644 --- a/examples/awel/simple_rag_embedding_example.py +++ b/examples/awel/simple_rag_embedding_example.py @@ -7,7 +7,7 @@ from dbgpt.core.awel import DAG, HttpTrigger, MapOperator from dbgpt.rag.embedding.embedding_factory import DefaultEmbeddingFactory from dbgpt.rag.knowledge.base import KnowledgeType -from dbgpt.rag.operator.knowledge import KnowledgeOperator +from dbgpt.rag.operators.knowledge import KnowledgeOperator from dbgpt.serve.rag.operators.embedding import EmbeddingAssemblerOperator from dbgpt.storage.vector_store.chroma_store import ChromaVectorConfig from dbgpt.storage.vector_store.connector import VectorStoreConnector diff --git a/examples/awel/simple_rag_retriever_example.py b/examples/awel/simple_rag_retriever_example.py index fd6a47efa..5470fca36 100644 --- a/examples/awel/simple_rag_retriever_example.py +++ b/examples/awel/simple_rag_retriever_example.py @@ -9,9 +9,9 @@ from dbgpt.model.proxy import OpenAILLMClient from dbgpt.rag.chunk import Chunk from dbgpt.rag.embedding.embedding_factory import DefaultEmbeddingFactory -from dbgpt.rag.operator.embedding import EmbeddingRetrieverOperator -from dbgpt.rag.operator.rerank import RerankOperator -from dbgpt.rag.operator.rewrite import QueryRewriteOperator +from dbgpt.rag.operators.embedding import EmbeddingRetrieverOperator +from dbgpt.rag.operators.rerank import RerankOperator +from dbgpt.rag.operators.rewrite import QueryRewriteOperator from dbgpt.storage.vector_store.chroma_store import ChromaVectorConfig from dbgpt.storage.vector_store.connector import VectorStoreConnector diff --git a/examples/awel/simple_rag_rewrite_example.py b/examples/awel/simple_rag_rewrite_example.py index 81c84a8d0..9a13bcbd7 100644 --- a/examples/awel/simple_rag_rewrite_example.py +++ b/examples/awel/simple_rag_rewrite_example.py @@ -33,7 +33,7 @@ from dbgpt._private.pydantic import BaseModel, Field from dbgpt.core.awel import DAG, HttpTrigger, MapOperator from dbgpt.model.proxy import OpenAILLMClient -from dbgpt.rag.operator.rewrite import QueryRewriteOperator +from dbgpt.rag.operators.rewrite import QueryRewriteOperator class TriggerReqBody(BaseModel): diff --git a/examples/awel/simple_rag_summary_example.py b/examples/awel/simple_rag_summary_example.py index 3b05996a7..adc3b54ad 100644 --- a/examples/awel/simple_rag_summary_example.py +++ b/examples/awel/simple_rag_summary_example.py @@ -32,8 +32,8 @@ from dbgpt.core.awel import DAG, HttpTrigger, MapOperator from dbgpt.model.proxy import OpenAILLMClient from dbgpt.rag.knowledge.base import KnowledgeType -from dbgpt.rag.operator.knowledge import KnowledgeOperator -from dbgpt.rag.operator.summary import SummaryAssemblerOperator +from dbgpt.rag.operators.knowledge import KnowledgeOperator +from dbgpt.rag.operators.summary import SummaryAssemblerOperator class TriggerReqBody(BaseModel): diff --git a/examples/sdk/simple_sdk_llm_example.py b/examples/sdk/simple_sdk_llm_example.py index f141c768b..94dcf2296 100644 --- a/examples/sdk/simple_sdk_llm_example.py +++ b/examples/sdk/simple_sdk_llm_example.py @@ -2,7 +2,7 @@ from dbgpt.core import BaseOutputParser from dbgpt.core.awel import DAG -from dbgpt.core.operator import ( +from dbgpt.core.operators import ( BaseLLMOperator, PromptBuilderOperator, RequestBuilderOperator, diff --git a/examples/sdk/simple_sdk_llm_sql_example.py b/examples/sdk/simple_sdk_llm_sql_example.py index 2eceefb8b..d518395ca 100644 --- a/examples/sdk/simple_sdk_llm_sql_example.py +++ b/examples/sdk/simple_sdk_llm_sql_example.py @@ -10,15 +10,15 @@ MapOperator, SimpleCallDataInputSource, ) -from dbgpt.core.operator import ( +from dbgpt.core.operators import ( BaseLLMOperator, PromptBuilderOperator, RequestBuilderOperator, ) -from dbgpt.datasource.operator.datasource_operator import DatasourceOperator +from dbgpt.datasource.operators.datasource_operator import DatasourceOperator from dbgpt.datasource.rdbms.conn_sqlite import SQLiteTempConnect from dbgpt.model.proxy import OpenAILLMClient -from dbgpt.rag.operator.datasource import DatasourceRetrieverOperator +from dbgpt.rag.operators.datasource import DatasourceRetrieverOperator def _create_temporary_connection(): diff --git a/setup.py b/setup.py index f2fa86f33..fed1ab3fb 100644 --- a/setup.py +++ b/setup.py @@ -675,8 +675,8 @@ def init_install_requires(): "dbgpt.model", "dbgpt.model.proxy", "dbgpt.model.proxy.*", - "dbgpt.model.operator", - "dbgpt.model.operator.*", + "dbgpt.model.operators", + "dbgpt.model.operators.*", "dbgpt.model.utils", "dbgpt.model.utils.*", ],