agents package¶
Submodules¶
agents.exam_agents module¶
Defines the AI agent and logic for medical exam generation.
This module contains the core components for the AI-driven lab exam creation process. It leverages agno’s structured output capabilities to generate and validate lab results directly against Pydantic models.
Version: 2.1
- agents.exam_agents.create_exam_prompt(request: LabExamRequest) str[source]¶
- Creates the simplified prompt for the lab exam generation agent. - Parameters:
- request – The user’s request containing the clinical scenario. 
- Returns:
- A formatted prompt string containing the essential clinical information. 
 
- agents.exam_agents.generate_lab_exams(request: LabExamRequest) LabExamResponse[source]¶
- Generates and validates laboratory exams for a medical scenario. - This function uses an agno agent with a specified response_model to directly generate a validated Pydantic object. - Parameters:
- request – The lab exam request. 
- Returns:
- The generated and validated laboratory exams as a LabExamResponse object. 
- Raises:
- HTTPException – If the generation or validation by the agent fails. 
 
agents.mat_agents module¶
Defines the AI agent and logic for medical materials generation.
This module contains the core components for generating lists of necessary materials for medical simulations. It leverages agno’s structured output to ensure the generated list of materials is correctly formatted and validated.
Version: 3.2
- agents.mat_agents.create_materials_prompt(request: MATModelRequest, existing_materials: List[Dict[str, Any]]) str[source]¶
- Creates the simplified prompt for the materials generation agent. 
- agents.mat_agents.generate_materials(request: MATModelRequest) List[MATModelResponse][source]¶
- Generates a list of materials for a medical simulation scenario. 
agents.medical_report module¶
Defines the AI agent and logic for medical report generation.
This module contains the core components for the AI-driven medical report creation process. It leverages agno’s structured output to ensure the generated report is correctly formatted and validated against a Pydantic model.
Version: 2.0 (Refactored to use agno’s response_model)
- agents.medical_report.create_medical_report_prompt(request: MedicalReportRequest) str[source]¶
- Creates the simplified prompt for the medical report generation agent. - Parameters:
- request – The user’s request containing the clinical context. 
- Returns:
- A fully formatted prompt string for the medical_report_agent. 
 
- agents.medical_report.generate_medical_report(request: MedicalReportRequest) MedicalReportResponse[source]¶
- Generates and validates a medical report for a diagnostic examination. - This function uses an agno agent with a specified response_model to directly generate a validated Pydantic object. - Parameters:
- request – The medical report request. 
- Returns:
- The generated and validated medical report. 
- Raises:
- HTTPException – If the generation or validation by the agent fails. 
 
agents.scenario_agents module¶
Defines AI agents and orchestration for medical scenario generation.
This module contains the core components for the AI-driven scenario creation process. It defines specialist agents for different parts of a scenario (initial info, timeline, script), functions to generate detailed prompts, and a MedicalScenarioTeam class to orchestrate the generation pipeline using agno’s structured output capabilities.
Version: 5.0.1
- class agents.scenario_agents.MedicalScenarioTeam(members: List[Agent])[source]¶
- Bases: - object- Manages a team of agents to generate a complete medical scenario. - run(request: ScenarioRequest) FullScenario[source]¶
- Executes the full scenario generation pipeline using validated Pydantic objects. 
 
- agents.scenario_agents.create_info_prompt(request: ScenarioRequest) str[source]¶
- Creates prompt for the Scenario Info Generator agent. 
- agents.scenario_agents.create_script_prompt(full_context: FullScenario) str[source]¶
- Creates the simplified prompt for the Patient Script Writer agent. 
- agents.scenario_agents.create_timeline_prompt(base_scenario: BaseScenario, difficulty: str) str[source]¶
- Creates the simplified prompt for the Clinical Timeline Generator agent. 
- agents.scenario_agents.generate_medical_scenario(_request: ScenarioRequest) FullScenario[source]¶
- Generates a medical scenario by orchestrating a team of agents. 
Module contents¶
Agents package for the Medical Simulation Suite AI.
This package aggregates the core AI agents and their primary service functions from the various sub-modules (e.g., scenario, exam, report). It provides a centralized access point for the main application to use these components.
The __all__ variable explicitly defines the public API of this package.
- agents.generate_lab_exams(request: LabExamRequest) LabExamResponse[source]¶
- Generates and validates laboratory exams for a medical scenario. - This function uses an agno agent with a specified response_model to directly generate a validated Pydantic object. - Parameters:
- request – The lab exam request. 
- Returns:
- The generated and validated laboratory exams as a LabExamResponse object. 
- Raises:
- HTTPException – If the generation or validation by the agent fails. 
 
- agents.generate_materials(request: MATModelRequest) List[MATModelResponse][source]¶
- Generates a list of materials for a medical simulation scenario. 
- agents.generate_medical_report(request: MedicalReportRequest) MedicalReportResponse[source]¶
- Generates and validates a medical report for a diagnostic examination. - This function uses an agno agent with a specified response_model to directly generate a validated Pydantic object. - Parameters:
- request – The medical report request. 
- Returns:
- The generated and validated medical report. 
- Raises:
- HTTPException – If the generation or validation by the agent fails. 
 
- agents.generate_medical_scenario(_request: ScenarioRequest) FullScenario[source]¶
- Generates a medical scenario by orchestrating a team of agents.