dmChatbotBackend / src /utils /export_prompts.py
github-actions
Auto deploy from GitHub
b1198f0
Raw
History Blame Contribute Delete
1.44 kB
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()