Skip to main content
Loading navigation
Back to prompt library

Define Pydantic Telemetry Schemas

Linked challenge: Type-Safe Sodium-Ion BESS Monitoring Agent with Pydantic AI and Groq

Prompt source

implementation1 lines1 sectionsNo variables0 checklist items
Create a Pydantic V2 model `SodiumTelemetry` with fields for `voltage_v`, `current_a`, `temp_c`, and `soc_pct`. Use Field validators to ensure values are within physical bounds (e.g., temp < 100). Then, initialize a `PydanticAI` agent that uses this model as its input context.