Back to prompt library
Define Pydantic AI Agent Architecture
Linked challenge: Build an OPC UA SCADA Anomaly Detector with Pydantic AI and Claude 4 Sonnet
Prompt source
planning1 lines1 sectionsNo variables0 checklist items
Import `pydantic_ai` and set up an Agent with model `anthropic:claude-4-sonnet`. Define a Pydantic model `TelemetryDiagnostic` containing `node_id`, `anomaly_detected`, `severity` (enum: LOW, MEDIUM, HIGH, CRITICAL), `root_cause`, and `recommended_action`. Write the system prompt directing the agent to act as a senior SCADA systems engineer.