diff --git a/superagi/controllers/knowledges.py b/superagi/controllers/knowledges.py index 04fa84e92..d55469734 100644 --- a/superagi/controllers/knowledges.py +++ b/superagi/controllers/knowledges.py @@ -70,11 +70,9 @@ def get_knowledge_details(knowledge_name: str): knowledge_data = Knowledges.fetch_knowledge_details_marketplace(knowledge_name) knowledge_config_data = KnowledgeConfigs.fetch_knowledge_config_details_marketplace(knowledge_data["id"]) knowledge_config_data["introduction"] = eval(knowledge_config_data["introduction"]) - # knowledge_config_data["use_cases"] = eval(knowledge_config_data["use_cases"]) + knowledge_config_data["use_cases"] = eval(knowledge_config_data["use_cases"]) knowledge_data_with_config = knowledge_data | knowledge_config_data knowledge_data_with_config["install_number"] = MarketPlaceStats.get_knowledge_installation_number(knowledge_data_with_config["id"]) - # knowledge_data_with_config["updated_at"] = '2023-07-18 08:06:52.803273' - # knowledge_data_with_config["updated_at"] = datetime.strptime(knowledge_data_with_config["updated_at"], "%Y-%m-%d %H:%M:%S.%f") knowledge_data_with_config["updated_at"] = datetime.strftime(knowledge_data_with_config["updated_at"], '%d %B %Y') return knowledge_data_with_config diff --git a/superagi/controllers/vector_dbs.py b/superagi/controllers/vector_dbs.py index 011f648ef..c9f1601aa 100644 --- a/superagi/controllers/vector_dbs.py +++ b/superagi/controllers/vector_dbs.py @@ -26,8 +26,11 @@ def get_marketplace_vectordb_list(): @router.get("/user/list") def get_user_connected_vector_db_list(organisation = Depends(get_user_organisation)): vector_db_list = Vectordbs.get_vector_db_from_organisation(db.session, organisation) - update_time = get_time_difference(vector_db_list["updated_at"], datetime.now()) - vector_db_list["updated_at"] = update_time["years"] + if vector_db_list: + for vector in vector_db_list: + update_time = str(vector.updated_at) + update_time = get_time_difference(update_time, datetime.now()) + vector_db_list["updated_at"] = update_time["years"] return vector_db_list @router.get("/get/db/details/{vector_db_id}") @@ -74,7 +77,7 @@ def connect_pinecone_vector_db(data: dict, organisation = Depends(get_user_organ VectordbConfigs.add_vector_db_config(db.session, pinecone_db.id, db_creds) for collection in data["collections"]: VectordbIndices.add_vector_index(db.session, collection, pinecone_db.id, db_connect_for_index["dimensions"], index_state) - + print("//////////////////////////////////////") return {"success": True, "id": pinecone_db.id, "name": pinecone_db.name} @router.post("/connect/qdrant")