File size: 1,437 Bytes
76962bf
 
 
 
 
 
 
 
 
b1198f0
 
76962bf
 
 
 
 
 
 
 
 
 
 
 
b1198f0
76962bf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import os
import sys

# Absolute import management
project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../"))
if project_root not in sys.path:
    sys.path.append(project_root)

from src.agents.agents import (
    RoleClassifier, PatientLLM, CaregiverLLM, ResponseValidator, SafetyCheck,
    IntentClassifier, ClinicalSpecialist, OutputMerger,
    ResearchAgent, DietarySpecialist
)

def export_prompts():
    output_dir = os.path.join(project_root, "src/prompts")
    if not os.path.exists(output_dir):
        os.makedirs(output_dir)

    # Dictionary of agents and their display names
    agents = {
        "RoleClassifier": RoleClassifier(),
        "PatientLLM": PatientLLM(),
        "CaregiverLLM": CaregiverLLM(),
        "ResponseValidator": ResponseValidator(),
        "SafetyCheck": SafetyCheck(),
        "IntentClassifier": IntentClassifier(),
        "ClinicalSpecialist_General": ClinicalSpecialist("General Medicine"),
        "OutputMerger": OutputMerger(),
        "ResearchAgent": ResearchAgent(),
        "DietarySpecialist": DietarySpecialist()
    }

    for name, agent in agents.items():
        filename = f"{name}.txt"
        filepath = os.path.join(output_dir, filename)
        with open(filepath, "w", encoding="utf-8") as f:
            f.write(agent.system_prompt)
        print(f"Exported system prompt for {name} to {filepath}")

if __name__ == "__main__":
    export_prompts()