From bfd2eee0ea31746e52be9155e70859da039b233b Mon Sep 17 00:00:00 2001 From: Deshraj Yadav Date: Fri, 24 Nov 2023 09:13:46 -0800 Subject: [PATCH] minor adjustments --- embedchain/__init__.py | 1 + embedchain/embedchain.py | 3 +-- embedchain/pipeline.py | 4 ++++ embedchain/store/assistants.py | 5 ++++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/embedchain/__init__.py b/embedchain/__init__.py index e71983aebb..5575a541a5 100644 --- a/embedchain/__init__.py +++ b/embedchain/__init__.py @@ -7,4 +7,5 @@ from embedchain.pipeline import Pipeline # noqa: F401 from embedchain.vectordb.chroma import ChromaDB # noqa: F401 +# Setup the user directory if doesn't exist already Client.setup_dir() diff --git a/embedchain/embedchain.py b/embedchain/embedchain.py index dfd1627e2a..863bf1e7a3 100644 --- a/embedchain/embedchain.py +++ b/embedchain/embedchain.py @@ -16,8 +16,7 @@ from embedchain.helpers.json_serializable import JSONSerializable from embedchain.llm.base import BaseLlm from embedchain.loaders.base_loader import BaseLoader -from embedchain.models.data_type import (DataType, DirectDataType, - IndirectDataType, SpecialDataType) +from embedchain.models.data_type import DataType, DirectDataType, IndirectDataType, SpecialDataType from embedchain.telemetry.posthog import AnonymousTelemetry from embedchain.utils import detect_datatype, is_valid_json_string from embedchain.vectordb.base import BaseVectorDB diff --git a/embedchain/pipeline.py b/embedchain/pipeline.py index 0cd9038cd8..e370faa48a 100644 --- a/embedchain/pipeline.py +++ b/embedchain/pipeline.py @@ -24,6 +24,10 @@ from embedchain.vectordb.chroma import ChromaDB +# Setup the user directory if doesn't exist already +Client.setup_dir() + + @register_deserializable class Pipeline(EmbedChain): """ diff --git a/embedchain/store/assistants.py b/embedchain/store/assistants.py index e3bde8de68..9803c0835c 100644 --- a/embedchain/store/assistants.py +++ b/embedchain/store/assistants.py @@ -10,7 +10,7 @@ from openai import OpenAI from openai.types.beta.threads import MessageContentText, ThreadMessage -from embedchain import Pipeline +from embedchain import Client, Pipeline from embedchain.config import AddConfig from embedchain.data_formatter import DataFormatter from embedchain.models.data_type import DataType @@ -19,6 +19,9 @@ logging.basicConfig(level=logging.WARN) +# Setup the user directory if doesn't exist already +Client.setup_dir() + class OpenAIAssistant: def __init__(