PydanticAI – Building LLM Agents in Python
PydanticAI is the fastest-growing Python agent framework, combining the ergonomic design philosophy of FastAPI with the power of Pydantic validation for LLM interactions. In this intensive 1-day course, you will learn how to build, test, and deploy intelligent agents that use tools, maintain structured state, and produce type-safe outputs. You will work with multiple LLM providers (OpenAI, Anthropic, Gemini, Ollama), implement dependency injection for clean architecture, and leverage Pydantic Logfire for real-time observability. By the end of the day, you will have built a fully functional multi-tool agent ready for production.
Skills You'll Learn
Course Modules & Lessons
PydanticAI Fundamentals
Agent architecture, the Agent class, system prompts, structured results with Pydantic models, model-agnostic design (OpenAI, Anthropic, Gemini, Ollama).
Agent-Architektur
Verstehe den Aufbau von LLM-Agenten, um sie effektiv zu konstruieren.
System-Prompts
Erkunde, wie System-Prompts das Verhalten deiner KI-Agenten steuern.
Strukturierte Ergebnisse
Erfahre, wie du strukturierte Ergebnisse von deinen LLM-Agenten erhältst.
Modell-agnostisches Design
Entdecke die Vorteile eines modell-agnostischen Designs für deine Agenten.
Tools & Dependencies
Defining agent tools, tool parameters and return types, dependency injection with RunContext, accessing databases and APIs from agents.
Tools definieren
Lerne, wie du nützliche Tools für deine LLM-Agenten definierst.
Parameter & Rückgabetypen
Verstehe, wie Parameter und Rückgabetypen deine Tools robust machen.
Dependency Injection
Setze Dependency Injection ein, um Tools flexible in deinen Agenten zu verwalten.
DB- & API-Zugriff
Erforsche den Zugriff auf Datenbanken und APIs mittels PydanticAI-Tools.
Advanced Agent Patterns
Multi-step agent workflows, agent delegation, structured conversation history, streaming responses, retry and error handling strategies.
Mehrstufige Workflows
Erfahre, wie Du komplexe Aufgaben in mehrere Agentenschritte aufteilen kannst.
Agent-Delegation
Lerne, wie Agenten Aufgaben an andere Agenten delegieren können, um effizienter zu sein.
Streaming Responses
Entdecke, wie Du Echtzeit-Antworten von Deinen Agenten erhältst, um die User Experience zu verbessern.
Retry & Error Handling
Optimiere Deine Agenten mit Strategien für Fehlerbehandlung und automatische Wiederholungen.
Testing, Observability & Deployment
Unit testing agents with TestModel and FunctionModel, Pydantic Logfire integration, monitoring costs and latency, deploying agents as FastAPI endpoints.
TestModel & FunctionModel
Teste und validiere Deine Modelle und Funktionen, um robuste Agenten zu entwickeln.
Logfire-Integration
Integriere Logfire, um Deine Agentenaktivitäten transparent zu überwachen.
Kosten- & Latenz-Monitoring
Überwache Kosten und Latenzzeiten Deiner Agenten, um Performance und Budget im Blick zu behalten.
FastAPI-Deployment
Sieh, wie Du Deine Agenten mit FastAPI deployen kannst, um sie produktiv zu nutzen.
Prerequisites
Your Trainer

David Pinezich
Experienced IT architect and trainer specializing in Python, Cloud Architecture, and Enterprise Solutions. Certified TOGAF, CISSP, and AWS professional with years of hands-on training experience.