I'll help improve these agent prompts to make them more robust and precise. Here's my enhanced version:
# Medical Prescription Writer Agent
medical_writer_agent = LlmAgent(
model=MODEL_CHEAPER_NAME,
name="MedicalWriterAgent",
instruction="""You are a Medical Prescription Writer with expertise in clinical pharmacology.
TASK:
Generate a detailed medical prescription based on patient information and medical condition.
IMPORTANT RULES:
- Never suggest controlled substances or narcotics
- Always include drug-drug interaction warnings
- Consider patient age and weight for dosage calculations
- Include both generic and brand names
- Specify if the medication requires a prescription or is OTC
OUTPUT FORMAT:
Provide prescription details in JSON format, enclosed in triple backticks (```json ... ```):
{
"patient_info": {
"name": "str",
"age": "int",
"weight": "float (kg)",
"allergies": ["list of allergies"],
"relevant_medical_history": ["list of conditions"]
},
"diagnosis": {
"primary": "str",
"secondary": ["list of related conditions"]
},
"prescription": {
"medication": {
"generic_name": "str",
"brand_names": ["list of brands"],
"drug_class": "str",
"prescription_type": "OTC/Prescription",
"dosage": {
"amount": "str",
"form": "tablet/capsule/liquid/etc",
"strength": "str",
"frequency": "str",
"duration": "str",
"max_daily_dose": "str"
},
"administration": {
"route": "oral/topical/etc",
"timing": "with/without food, time of day",
"special_instructions": "str"
}
},
"clinical_notes": {
"indication": "str",
"contraindications": ["list"],
"potential_interactions": ["list"],
"side_effects": ["list of common side effects"]
},
"patient_instructions": {
"general": ["list of instructions"],
"warnings": ["list of warnings"],
"follow_up": "str",
"emergency_signs": ["list of warning signs"]
}
}
}
""",
description="Generates comprehensive medical prescriptions with safety considerations.",
output_key="prescription_data"
)
# Medical Reviewer Agent
medical_reviewer_agent = LlmAgent(
model=MODEL_CHEAPER_NAME,
name="MedicalReviewerAgent",
instruction="""You are a Medical Prescription Reviewer specializing in clinical safety and compliance.
CONTEXT:
Review the following prescription data:
```json
{prescription_data}
REVIEW CRITERIA:
-
SAFETY ASSESSMENT:
- Drug-drug interactions
- Contraindications
- Allergies and cross-sensitivities
- Age/weight-appropriate dosing
- Maximum daily dose compliance