diff --git a/application/api/answer/routes.py b/application/api/answer/routes.py index 40c4d8cb..ad434157 100644 --- a/application/api/answer/routes.py +++ b/application/api/answer/routes.py @@ -11,8 +11,8 @@ from bson.objectid import ObjectId from flask import Blueprint, current_app, make_response, request, Response from flask_restx import fields, Namespace, Resource -from core.mongo_db import MongoDB +from application.core.mongo_db import MongoDB from application.core.settings import settings from application.error import bad_request from application.extensions import api diff --git a/application/api/internal/routes.py b/application/api/internal/routes.py index f004cf97..c8e32d11 100755 --- a/application/api/internal/routes.py +++ b/application/api/internal/routes.py @@ -1,10 +1,10 @@ import os import datetime from flask import Blueprint, request, send_from_directory -from core.mongo_db import MongoDB from werkzeug.utils import secure_filename from bson.objectid import ObjectId +from application.core.mongo_db import MongoDB from application.core.settings import settings mongo = MongoDB.get_client() diff --git a/application/api/user/routes.py b/application/api/user/routes.py index 3469c800..ca4a051b 100644 --- a/application/api/user/routes.py +++ b/application/api/user/routes.py @@ -8,11 +8,11 @@ from bson.dbref import DBRef from bson.objectid import ObjectId from flask import Blueprint, jsonify, make_response, request from flask_restx import inputs, fields, Namespace, Resource -from core.mongo_db import MongoDB from werkzeug.utils import secure_filename from application.api.user.tasks import ingest, ingest_remote +from application.core.mongo_db import MongoDB from application.core.settings import settings from application.extensions import api from application.utils import check_required_fields diff --git a/application/core/mongo_db.py b/application/core/mongo_db.py index fdb728a2..a29ca5d6 100644 --- a/application/core/mongo_db.py +++ b/application/core/mongo_db.py @@ -1,4 +1,4 @@ -from application.core import settings +from application.core.settings import Settings from pymongo import MongoClient @@ -11,7 +11,7 @@ class MongoDB: Get the MongoDB client instance, creating it if necessary. """ if cls._client is None: - cls._client = MongoClient(settings.MONGO_URI) + cls._client = MongoClient(Settings.MONGO_URI) return cls._client @classmethod diff --git a/application/usage.py b/application/usage.py index 31feb5f1..e87ebe38 100644 --- a/application/usage.py +++ b/application/usage.py @@ -1,6 +1,6 @@ import sys -from core.mongo_db import MongoDB from datetime import datetime +from application.core.mongo_db import MongoDB from application.utils import num_tokens_from_string mongo = MongoDB.get_client() diff --git a/application/worker.py b/application/worker.py index fc780d61..33cd90e5 100755 --- a/application/worker.py +++ b/application/worker.py @@ -8,8 +8,8 @@ from urllib.parse import urljoin import requests from bson.objectid import ObjectId -from core.mongo_db import MongoDB +from application.core.mongo_db import MongoDB from application.core.settings import settings from application.parser.file.bulk import SimpleDirectoryReader from application.parser.open_ai_func import call_openai_api