Skip to content

Commit

Permalink
Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarraann committed Jul 18, 2023
1 parent 2144164 commit bc69d3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 1 addition & 3 deletions superagi/controllers/knowledges.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 6 additions & 3 deletions superagi/controllers/vector_dbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit bc69d3e

Please sign in to comment.