diff --git a/main_cascade.py b/main_cascade.py index f27923b..457b385 100644 --- a/main_cascade.py +++ b/main_cascade.py @@ -13,6 +13,9 @@ from worker import AgentPhD +import tiktoken +MAX_TOKENS = 127900 +encoding = tiktoken.encoding_for_model("gpt-4o") ## baseline system = "You are an efficient and insightful assistant to a molecular biologist." @@ -120,6 +123,10 @@ def GeneAgent(ID, genes): pattern = re.compile(r'^[a-zA-Z0-9,.;?!*()_-]+$') ## send genes to GPT-4 and generate the original template of process name and analysis try: + # Ensure output directories exist + os.makedirs("Outputs/GPT-4", exist_ok=True) + os.makedirs("Outputs/GeneAgent/Cascade", exist_ok=True) + os.makedirs("Verification Reports/Cascade", exist_ok=True) prompt_baseline = baseline(genes) first_step = prompt_baseline + system token_baseline = encoding.encode(first_step)