Toolbox Talk Generator
Overview
Automatically generate relevant safety toolbox talks based on daily work activities, weather conditions, recent incidents, and seasonal hazards. Support multiple languages for diverse crews.
"Daily toolbox talks reduce incidents by 30% when relevant to actual work" — DDC Community
How It Works
┌─────────────────────────────────────────────────────────────────┐
│ TOOLBOX TALK GENERATOR │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Inputs Generator Output │
│ ────── ───────── ────── │
│ 📅 Today's work → → 📋 Talk script │
│ 🌤️ Weather → 🤖 AI Engine → 📸 Visual aids │
│ ⚠️ Recent incidents → → ✅ Sign-in sheet │
│ 📆 Season/holiday → → 🌐 Translations │
│ │
└─────────────────────────────────────────────────────────────────┘
Technical Implementation
from dataclasses import dataclass, field
from typing import List, Dict, Optional
from enum import Enum
from datetime import datetime, date
import random
class HazardCategory(Enum):
FALL_PROTECTION = "fall_protection"
ELECTRICAL = "electrical"
EXCAVATION = "excavation"
SCAFFOLDING = "scaffolding"
CRANE_RIGGING = "crane_rigging"
CONFINED_SPACE = "confined_space"
HOT_WORK = "hot_work"
HAZMAT = "hazmat"
HEAT_STRESS = "heat_stress"
COLD_STRESS = "cold_stress"
HOUSEKEEPING = "housekeeping"
PPE = "ppe"
HAND_TOOLS = "hand_tools"
POWER_TOOLS = "power_tools"
MATERIAL_HANDLING = "material_handling"
TRAFFIC = "traffic"
SILICA = "silica"
NOISE = "noise"
@dataclass
class ToolboxTalk:
id: str
title: str
category: HazardCategory
duration_minutes: int
content: Dict[str, str] # sections: intro, hazards, controls, discussion, summary
key_points: List[str]
discussion_questions: List[str]
date_generated: datetime = field(default_factory=datetime.now)
language: str = "en"
@dataclass
class TalkRecord:
talk_id: str
date: datetime
project: str
location: str
presenter: str
attendees: List[str]
topics_covered: List[str]
questions_raised: List[str]
follow_up_actions: List[str]
class ToolboxTalkGenerator:
"""Generate contextual safety toolbox talks."""
# Talk templates by category
TALK_TEMPLATES = {
HazardCategory.FALL_PROTECTION: {
"title": "Fall Protection - Stay Safe at Heights",
"intro": "Falls are the leading cause of death in construction. Today we'll review how to protect ourselves when working at heights.",
"hazards": [
"Unprotected edges and openings",
"Improper ladder use",
"Damaged or missing guardrails",
"Incorrect harness use",
"Unsecured tools and materials"
],
"controls": [
"Always use guardrails at 6 feet or above",
"Inspect harness and lanyards before each use",
"Maintain 3 points of contact on ladders",
"Cover all floor openings",
"Tether tools when working at height"
],
"key_points": [
"100% tie-off required above 6 feet",
"Inspect fall protection daily",
"Know your anchor points",
"Report damaged equipment immediately"
],
"discussion": [
"Where are the fall hazards on our site today?",
"What fall protection will you use?",
"Have you inspected your equipment?"
]
},
HazardCategory.HEAT_STRESS: {
"title": "Heat Stress Prevention",
"intro": "Working in hot conditions can lead to serious illness. Today we'll discuss how to recognize and prevent heat-related illness.",
"hazards": [
"High temperatures and humidity",
"Direct sun exposure",
"Physical exertion",
"Inadequate hydration",
"Lack of acclimatization"
],
"controls": [
"Drink water every 15-20 minutes",
"Take breaks in shade or cool areas",
"Wear light, breathable clothing",
"Know the signs of heat illness",
"Use buddy system to watch each other"
],
"key_points": [
"Water, rest, shade - the three keys",
"Don't wait until you're thirsty to drink",
"Stop work if you feel dizzy or nauseous",
"Acclimatize over 7-14 days"
],
"discussion": [
"Where are the water stations today?",
"Where can you take a cool break?",
"What are the symptoms of heat exhaustion?"
]
},
HazardCategory.ELECTRICAL: {
"title": "Electrical Safety",
"intro": "Electricity can kill instantly. Today we'll review how to work safely around electrical hazards.",
"hazards": [
"Overhead power lines",
"Damaged cords and equipment",
"Wet conditions",
"Missing GFCIs",
"Overloaded circuits"
],
"controls": [
"Maintain 10+ feet from power lines",
"Inspect cords before use",
"Use GFCIs for all power tools",
"Never use damaged equipment",
"Keep electrical away from water"
],
"key_points": [
"Assume all wires are energized",
"Lock out/tag out before work",
"Only qualified personnel do electrical work",
"Report damaged equipment immediately"
],
"discussion": [
"Where are electrical hazards on site today?",
"Are all your tools inspected?",
"Where are the GFCIs located?"
]
},
HazardCategory.HOUSEKEEPING: {
"title": "Good Housekeeping = Safe Workplace",
"intro": "A clean site is a safe site. Poor housekeeping leads to trips, falls, and fires. Let's discuss keeping our work area organized.",
"hazards": [
"Debris and clutter in walkways",
"Improper material storage",
"Tangled cords and hoses",
"Accumulated combustibles",
"Blocked exits and access"
],
"controls": [
"Clean as you go throughout the day",
"Store materials properly",
"Route cords away from walkways",
"Dispose of waste in proper containers",
"Keep exits and aisles clear"
],
"key_points": [
"Clean up immediately after each task",
"Everyone is responsible for housekeeping",
"If you see it, fix it",
"End each day with a clean work area"
],
"discussion": [
"What areas need attention today?",
"Where should materials be stored?",
"Who is responsible for end-of-day cleanup?"
]
},
HazardCategory.SCAFFOLDING: {
"title": "Scaffold Safety",
"intro": "Scaffolds provide safe access for work at height - but only when properly erected and used. Let's review scaffold safety.",
"hazards": [
"Incomplete or damaged s