This commit is contained in:
Ali
2024-12-12 13:27:19 +01:00
5 changed files with 59 additions and 3 deletions
+15 -2
View File
@@ -9,6 +9,10 @@ import json
import psycopg2
import pymongo
import mongo_conn
import pgvec_conn
import redis_conn
count = 0
def retrieve_file_contents(path):
@@ -113,7 +117,13 @@ def insert_data_mongo(id, filepath,pChunk):
def reload_files():
# path = input("Please provider path to folder: ")
contents = retrieve_file_contents("C:\\SoftwareEng")
pgvec_conn.flush_pg()
redis_conn.flush_redis()
mongo_conn.flush_mongo()
provided_path = input("Please Provide Full Qualified Path: ")
contents = retrieve_file_contents(provided_path)
create_embeddings(contents)
@@ -125,7 +135,10 @@ def add_files():
def prompt_cycle():
while True:
prompt = input("Please enter prompt: ")
lib.prompt_embedding(prompt)
response = redis_conn.load_response_from_redis(prompt.lower().strip())
lib.prompt_embedding(prompt) if response is None else print("Cached Response:", response)
def get_user_action():