<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Pydantic on AI VOID</title><link>https://ai-blog.noorshomelab.dev/tags/pydantic/</link><description>Recent content in Pydantic on AI VOID</description><generator>Hugo</generator><language>en</language><lastBuildDate>Tue, 26 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://ai-blog.noorshomelab.dev/tags/pydantic/index.xml" rel="self" type="application/rss+xml"/><item><title>Chapter 3: Defining Your Extraction Task and Schema</title><link>https://ai-blog.noorshomelab.dev/langextract-guide-2026/03-defining-extraction-schema/</link><pubDate>Mon, 05 Jan 2026 00:00:00 +0000</pubDate><guid>https://ai-blog.noorshomelab.dev/langextract-guide-2026/03-defining-extraction-schema/</guid><description>&lt;h2 id="chapter-3-defining-your-extraction-task-and-schema"&gt;Chapter 3: Defining Your Extraction Task and Schema&lt;/h2&gt;
&lt;p&gt;Welcome back, future data alchemists! In the previous chapter, we got LangExtract up and running and connected to our chosen Large Language Model (LLM) provider. That&amp;rsquo;s a huge step! Now, it&amp;rsquo;s time to get down to the real magic: telling LangExtract &lt;em&gt;exactly&lt;/em&gt; what kind of information we want to pull out of unstructured text.&lt;/p&gt;
&lt;p&gt;This chapter is all about defining your &amp;ldquo;extraction task&amp;rdquo; and creating a &amp;ldquo;schema&amp;rdquo; – essentially, a blueprint for the structured data you expect to receive. This is arguably the most crucial part of using LangExtract effectively. Without a clear schema, an LLM might give you inconsistent, incomplete, or even hallucinated results. With a well-defined schema, you guide the LLM to focus its powerful understanding on precisely what you need, making your extractions reliable and robust.&lt;/p&gt;</description></item><item><title>Handle Data Input: Pydantic Models &amp;amp; Request Bodies</title><link>https://ai-blog.noorshomelab.dev/fastapi_beginner_course_20251025_173235/handle-data-input-pydantic-models--request-bodies/</link><pubDate>Sat, 25 Oct 2025 00:00:00 +0000</pubDate><guid>https://ai-blog.noorshomelab.dev/fastapi_beginner_course_20251025_173235/handle-data-input-pydantic-models--request-bodies/</guid><description>&lt;h2 id="chapter-title-handle-data-input-pydantic-models--request-bodies"&gt;Chapter Title: Handle Data Input: Pydantic Models &amp;amp; Request Bodies&lt;/h2&gt;
&lt;h3 id="what-youll-learn"&gt;What You&amp;rsquo;ll Learn&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;How to receive data sent by clients using HTTP POST requests.&lt;/li&gt;
&lt;li&gt;Understanding the concept of a &amp;ldquo;request body&amp;rdquo; in API communication.&lt;/li&gt;
&lt;li&gt;How to define structured data schemas for incoming data using Pydantic&amp;rsquo;s &lt;code&gt;BaseModel&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Leveraging FastAPI&amp;rsquo;s integration with Pydantic for automatic data validation.&lt;/li&gt;
&lt;li&gt;How Pydantic automatically serializes incoming JSON data into Python objects for easy use.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="core-concepts"&gt;Core Concepts&lt;/h3&gt;
&lt;h4 id="receiving-data-with-post-requests-and-request-bodies"&gt;Receiving Data with POST Requests and Request Bodies&lt;/h4&gt;
&lt;p&gt;When clients (like a web browser, mobile app, or another server) want to send data to your API to create a new resource (e.g., a new user, a new product) or submit information, they typically use an HTTP POST request. Unlike GET requests, where data is appended to the URL as query parameters, POST requests send data in the &lt;strong&gt;request body&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>Building the Agentic Core: STT to LLM to Intent Mapping</title><link>https://ai-blog.noorshomelab.dev/on-device-ai-agents-tiny-llms-guide-2026/agentic-core-intent-mapping/</link><pubDate>Wed, 06 May 2026 00:00:00 +0000</pubDate><guid>https://ai-blog.noorshomelab.dev/on-device-ai-agents-tiny-llms-guide-2026/agentic-core-intent-mapping/</guid><description>&lt;p&gt;In this chapter, we&amp;rsquo;re building the brain of our on-device AI agent: the core pipeline that translates user speech into actionable intents. This involves taking transcribed text, feeding it into a tiny, local Large Language Model (LLM), and then extracting a structured understanding of what the user wants to do. This is a critical step towards enabling truly intelligent, privacy-preserving interactions on edge devices.&lt;/p&gt;
&lt;p&gt;By the end of this milestone, you will have a functional Python script that can:&lt;/p&gt;</description></item><item><title>Your First Full CRUD API: Items Manager Project</title><link>https://ai-blog.noorshomelab.dev/fastapi_beginner_course_20251025_173235/your-first-full-crud-api-items-manager-project/</link><pubDate>Sat, 25 Oct 2025 00:00:00 +0000</pubDate><guid>https://ai-blog.noorshomelab.dev/fastapi_beginner_course_20251025_173235/your-first-full-crud-api-items-manager-project/</guid><description>&lt;h2 id="your-first-full-crud-api-items-manager-project-covering-project-setup-structuring-your-fastapi-application-implement-create-post-operations-for-items-implement-read-get-operations-all-and-by-id"&gt;Your First Full CRUD API: Items Manager Project (covering: Project Setup: Structuring Your FastAPI Application, Implement CREATE (POST) Operations for Items, Implement READ (GET) Operations: All and By ID)&lt;/h2&gt;
&lt;h3 id="what-youll-learn"&gt;What You&amp;rsquo;ll Learn&lt;/h3&gt;
&lt;p&gt;In this chapter, you&amp;rsquo;ll embark on building your very first complete set of API operations for managing &amp;ldquo;items.&amp;rdquo; By the end, you will be able to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Structure a basic FastAPI project&lt;/strong&gt;: Organize your code into logical files for better maintainability.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Define data models with Pydantic&lt;/strong&gt;: Learn how to use Pydantic &lt;code&gt;BaseModel&lt;/code&gt; to validate incoming request data and define outgoing response data.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Implement &lt;code&gt;CREATE&lt;/code&gt; (POST) operations&lt;/strong&gt;: Create an endpoint that allows clients to add new items to your application.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Implement &lt;code&gt;READ&lt;/code&gt; (GET) operations&lt;/strong&gt;: Build endpoints to retrieve all items and to fetch a specific item by its unique identifier.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Handle in-memory data storage&lt;/strong&gt;: Understand how to simulate a database using simple Python data structures for learning purposes.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="core-concepts"&gt;Core Concepts&lt;/h3&gt;
&lt;h4 id="project-setup-structuring-your-fastapi-application"&gt;Project Setup: Structuring Your FastAPI Application&lt;/h4&gt;
&lt;p&gt;As your FastAPI application grows, putting everything into a single &lt;code&gt;main.py&lt;/code&gt; file can become unwieldy. A good practice is to separate concerns. For our &lt;code&gt;Items Manager&lt;/code&gt; project, we&amp;rsquo;ll start with a simple structure:&lt;/p&gt;</description></item><item><title>Designing &amp;amp; Building Comprehensive Guardrail Systems</title><link>https://ai-blog.noorshomelab.dev/ai-reliability-guide-2026/designing-comprehensive-guardrail-systems/</link><pubDate>Fri, 20 Mar 2026 00:00:00 +0000</pubDate><guid>https://ai-blog.noorshomelab.dev/ai-reliability-guide-2026/designing-comprehensive-guardrail-systems/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Welcome to Chapter 11! In our previous chapters, we delved into the crucial aspects of evaluating and testing AI systems &lt;em&gt;before&lt;/em&gt; and &lt;em&gt;during&lt;/em&gt; deployment. We explored prompt engineering, regression testing, and methods to detect issues like hallucination. But what happens when an AI system is live, interacting with users in the real world? How do we ensure it consistently behaves as intended, adheres to safety guidelines, and remains compliant with regulations?&lt;/p&gt;</description></item><item><title>Chapter 14: Project: Extracting Key Information from Legal Contracts</title><link>https://ai-blog.noorshomelab.dev/langextract-guide-2026/14-project-legal-contracts/</link><pubDate>Mon, 05 Jan 2026 00:00:00 +0000</pubDate><guid>https://ai-blog.noorshomelab.dev/langextract-guide-2026/14-project-legal-contracts/</guid><description>&lt;h2 id="chapter-14-project-extracting-key-information-from-legal-contracts"&gt;Chapter 14: Project: Extracting Key Information from Legal Contracts&lt;/h2&gt;
&lt;p&gt;Welcome back, future data architects! In our previous chapters, we laid the groundwork for understanding LangExtract, setting up our environment, and performing basic extractions. You&amp;rsquo;ve seen how powerful Large Language Models (LLMs) can be when guided by a structured schema.&lt;/p&gt;
&lt;p&gt;In this chapter, we&amp;rsquo;re going to put all that knowledge to the test with a practical, high-value project: extracting key information from legal contracts. Legal documents are notoriously complex, filled with jargon, and often lengthy, making them a perfect challenge for LangExtract&amp;rsquo;s capabilities. By the end of this chapter, you&amp;rsquo;ll have built a system to automatically pull out crucial details like parties involved, effective dates, and contract values from sample legal text. This isn&amp;rsquo;t just about coding; it&amp;rsquo;s about building confidence in tackling real-world, complex data extraction problems.&lt;/p&gt;</description></item><item><title>Chapter 15: Project: Summarizing and Structuring Financial Reports</title><link>https://ai-blog.noorshomelab.dev/langextract-guide-2026/15-project-financial-reports/</link><pubDate>Mon, 05 Jan 2026 00:00:00 +0000</pubDate><guid>https://ai-blog.noorshomelab.dev/langextract-guide-2026/15-project-financial-reports/</guid><description>&lt;h2 id="chapter-15-project-summarizing-and-structuring-financial-reports"&gt;Chapter 15: Project: Summarizing and Structuring Financial Reports&lt;/h2&gt;
&lt;p&gt;Welcome back, intrepid data explorer! In our previous chapters, you&amp;rsquo;ve mastered the fundamentals of LangExtract, from setting up your environment to crafting precise extraction schemas and understanding the nuances of prompt engineering. Now, it&amp;rsquo;s time to put those skills to the test with a real-world, highly valuable application: extracting structured information from financial reports.&lt;/p&gt;
&lt;p&gt;Financial reports, such as earnings call transcripts, annual reports, or quarterly statements, are treasure troves of critical business data. However, sifting through pages of unstructured text, tables, and disclosures to find specific metrics or key highlights can be incredibly time-consuming. This chapter will guide you through building a LangExtract solution to automate this process, allowing you to quickly pull out crucial financial data points and summarize key sections.&lt;/p&gt;</description></item><item><title>Build a REST API with FastAPI</title><link>https://ai-blog.noorshomelab.dev/tutorials/build-rest-api-fastapi/</link><pubDate>Tue, 26 May 2026 00:00:00 +0000</pubDate><guid>https://ai-blog.noorshomelab.dev/tutorials/build-rest-api-fastapi/</guid><description>&lt;p&gt;&lt;strong&gt;What you&amp;rsquo;ll build:&lt;/strong&gt; A functional REST API using FastAPI, demonstrating setup, route definition, data validation, dependency injection, and testing.
&lt;strong&gt;Time needed:&lt;/strong&gt; ~75 minutes
&lt;strong&gt;Prerequisites:&lt;/strong&gt; Python 3.8 or newer, Basic understanding of Python, Familiarity with REST API concepts
&lt;strong&gt;Version used:&lt;/strong&gt; 0.115.6&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;FastAPI is a modern, fast (high-performance) web framework for building APIs with Python 3.8+ based on standard Python type hints. It&amp;rsquo;s designed to be easy to use, highly performant, and automatically generate interactive API documentation. In this tutorial, we&amp;rsquo;ll walk through building a complete, yet simple, REST API from scratch, covering the core features that make FastAPI a joy to work with.&lt;/p&gt;</description></item><item><title>Chapter 8: User Registration and Login Flow</title><link>https://ai-blog.noorshomelab.dev/chat-guide/chapter-8-user-auth-flow/</link><pubDate>Wed, 20 Aug 2025 00:00:00 +0000</pubDate><guid>https://ai-blog.noorshomelab.dev/chat-guide/chapter-8-user-auth-flow/</guid><description>&lt;p&gt;While we introduced basic user registration and login in Chapter 4, this chapter focuses on refining these critical endpoints. We&amp;rsquo;ll ensure robust data validation, provide clear error messages, and integrate the user management more tightly with our database. This is about building a solid, production-ready authentication foundation.&lt;/p&gt;
&lt;h3 id="purpose-of-this-chapter"&gt;Purpose of this Chapter&lt;/h3&gt;
&lt;p&gt;By the end of this chapter, you will:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Have dedicated endpoints for user registration and login.&lt;/li&gt;
&lt;li&gt;Understand data validation for incoming user data.&lt;/li&gt;
&lt;li&gt;Implement proper password hashing and verification.&lt;/li&gt;
&lt;li&gt;Ensure that authenticated users are correctly identified and used throughout the application.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="concepts-explained-data-validation--error-handling"&gt;Concepts Explained: Data Validation &amp;amp; Error Handling&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Data Validation:&lt;/strong&gt; Ensuring that incoming data (like username and password during registration) meets expected criteria. FastAPI leverages Pydantic for this, which allows you to define strict schemas for your request bodies.&lt;/p&gt;</description></item></channel></rss>