role extracion and sop generation added

This commit is contained in:
2024-08-31 01:29:39 +00:00
parent ccb0db21d6
commit 1f02a30a16
15 changed files with 734 additions and 11 deletions
+21
View File
@@ -0,0 +1,21 @@
from src.services.sop_generator import SopGenerator
from src.utils.document_loader import load_document
file_path = "/root/ds_erp_ai/data/raw/test_sop.pdf"
docs = load_document(file_path)
sop = SopGenerator()
if __name__ == "__main__":
# Assuming 'sop' is an instance of SopGenerator and 'docs' is the loaded document content.
# Step 1: Get the roles from the document
roles = sop.get_roles(docs)["roles"]
print(f"Roles {roles}")
sop_status = sop.check_role_sop(roles=roles, docs=docs)
print(sop_status)
roles = ["cloud engineer"]
sops = sop.generate_sops(roles=roles,docs=docs)
print(f"sops:{sops}")