Files
erp_ai/test.py
T

22 lines
648 B
Python
Raw Normal View History

2024-08-31 01:29:39 +00:00
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}")