Back to Prompt Library
planning
Define Pydantic AI Agent Architecture
Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.
Linked challenge: Build an OPC UA SCADA Anomaly Detector with Pydantic AI and Claude 4 Sonnet
Format
Text-first
Lines
1
Sections
1
Linked challenge
Build an OPC UA SCADA Anomaly Detector with Pydantic AI and Claude 4 Sonnet
Prompt source
Original prompt text with formatting preserved for inspection.
1 lines
1 sections
No variables
0 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.
Adaptation plan
Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.
Keep stable
Preserve the role framing, objective, and reporting structure so comparison runs stay coherent.
Tune next
Swap in your own domain constraints, anomaly thresholds, and examples before you branch variants.
Verify after
Check whether the prompt asks for the right evidence, confidence signal, and escalation path.