Array ( [_thumbnail_id] => Array ( [0] => 240 ) [video_id] => Array ( [0] => S712jSrLWkA ) [_video_id] => Array ( [0] => field_67eef30cd6314 ) [channel_name] => Array ( [0] => Rabbitmetrics ) [_channel_name] => Array ( [0] => field_67eef322d6315 ) [channel_id] => Array ( [0] => UCNszHNG0PlhWJdtNqFvwMWw ) [_channel_id] => Array ( [0] => field_67eef32fd6316 ) [description] => Array ( [0] => Learn how to build robust, type-safe AI agents in minutes with Pydantic AI in this step-by-step tutorial! I will create a fully functional Shopify customer support agent from scratch, showing you how to integrate external APIs, inject dependencies for personalization, and extend your agent with context-aware tools. Developed by the team behind Pydantic (used by OpenAI, Anthropic, and LangChain), this framework dramatically simplifies agent development while ensuring production-grade reliability. Link to the code:https://www.rabbitmetrics.com/pydantic-ai-in-10-minutes/Become a Rabbitmetrics Pro Member:https://www.rabbitmetrics.com/pro/▬▬▬▬▬▬ V I D E O C H A P T E R S & T I M E S T A M P S ▬▬▬▬▬▬0:00 Introduction0:35 Agents the Pydantic AI Way1:05 A Basic Agent2:50 Shopify Data4:08 Dependencies7:22 Plain Tools8:32 Tools with Dependencies ) [_description] => Array ( [0] => field_67eef33bd6317 ) [publish_date] => Array ( [0] => 2025-03-14T18:22:56Z ) [_publish_date] => Array ( [0] => field_67eef350d6318 ) [view_count] => Array ( [0] => 9088 ) [_view_count] => Array ( [0] => field_67eef3a5d6319 ) [like_count] => Array ( [0] => 259 ) [_like_count] => Array ( [0] => field_67eef3b1d631a ) [comment_count] => Array ( [0] => 11 ) [_comment_count] => Array ( [0] => field_67eef3d2d631b ) [category_id] => Array ( [0] => 28 ) [_category_id] => Array ( [0] => field_67eef55ed631d ) [thumbnails] => Array ( [0] => ) [_thumbnails] => Array ( [0] => field_67ef973439c60 ) [video_transcript] => Array ( [0] => with pantic AI building agents has become faster and more efficient than ever before in this video I'm going to show you how it works discuss the main benefits and unpack the core elements of the framework by building a real world example of a customer support agent let's get started pantic AI is developed by the team behind pedantic the number one data validation library for python the mission behind pedantic AI is to do for generative AI What fast API did for web development that means creating a framework that's intuitive Exel Ates the development process and reduces bucks with type- checking and data validation when we talk about agents we usually mean function calling with llms that is connecting an llm that can produ structured output such as Json with one or more Tools in pedantic AI the concept of an agent is further refined here an agent consists of a model one or more system prompts a structured results dependencies and function tools I'm going to walk you through each of these components now with a practical example of a customer support agent connecting to the Shopify API I have a requirements txt file here where we only need pedantic pedantic AI we need the Shopify API python Library anthropic and python. EnV to load environment variables and the environment variables are in a EnV file here I have an example. file we have the anthropic API key the Shopify token and the Shopify merant name we're going to start off building the most basic agent we can build with pensc AI so I'm going to import agent from pensc AI async iio andv in order to be able to load my environment variables and there's really nothing agenic about the most basic agent is basically an llm call here I'm calling CLA 3.7 Sunnet with a system prompt the important thing to note here is how we run the agent in the first example here I'm going to run the agent in a synchronous way I'm using run sync and this is how you usually run agents in other Frameworks but pantic AI is designed with asynchronous programming in mind so when you call run on an agent instead of run sync you're going to do asynchronous execution by default in other words agent run is a co- routine and we can wrap up the co- routine in an async function and use async IO to run the agent and of course you can also call your agent directly with async iio by passing the co- routine agent. run to async iio . run now let me run this basic agent just to see that everything works as intended if I run this I get the response from the three different ways of executing the agent now let's turn this into an actual agent by giving it access to the Shopify API we're going to add a small Shopify data Library this class utilizes the Shopify admin API python library and allows us us to extract data from three different Shopify objects we can extract customer data from the customer object using a customer ID as an input we can also extract product data from a given store we don't need an ID for that we just need the merchant name which we have in the environment variables and then we can extract orders from a given customer and we're going to need a customer ID to be able to extract the orders from a given customer now we want to focus on pedantic AIS I'm not going to spend any more time on how this Library works if you want to learn how to extract data from Shopify there are tutorials on my channel and also on the main web page before we move on to giving the agent access to Shopify let's just check that this class works here I have a test shy. py file where I'm instantiating the API and then I'm printing out products and printing out customer information for a given customer ID and the orders for that particular customer now if I run python test Shopify pyth you can see that we f the product data the customer data and the order data and now we have what we need to explore the capabilities of pedantic AI to see how pedantic AI differs from other AI agent Frameworks you need to understand the concept of dependencies dependencies allows us to dynamically control the context of the agent's work we can use dependencies to define dynamic system prompts and also provide context for the tools to give the tools access to those dependencies to see how this works let's start by giving the agent access to some cust information to begin with just the customer name now here I've updated the agent. py file with some additional code in order to work with dependencies we're going to import run context from pedantic AI I'm importing base model and field from pedantic and data class from data classes because I want to define a data class that gives us support dependencies and then I want to define a pedantic model that gives us the structured output which I call support results and this will force the agent to give us a structured output defined by this pedantic model then in my agent in addition to the model that we had before and the system prompt we're going to pass in the support dependencies as steps type and the support results as result type and note that I have the same static system prompt as before that I'm passing to the agent now I'm going to define a second one a dynamic system prompt that I'm also going to add to the agent and the main difference between static system prompts and dynamic system prompts is that dynamic system prompts depend on some context that is not known until runtime a dynamic system prompt is defined with a system prompt decorator and a system prompt function that takes run context as the first parameter and the way that we access the context is to use the attribute depths so we call depths on the context also note that run context is parameterized with our dependency type in our case defined by the data class support dependencies under the hood pedantic is going to check the type of the dependency that we injecting and raise an error if the type is wrong now in our case what we want to inject into the dynamic system prompt is a customer name that we're going to fetch from the customer object in Shopify using a customer ID and this is going to give our agent a very basic context for the interaction with the customer now in the main function we'll instantiate the Shopify API and we'll create the support dependencies with the customer ID and the Shopify API and then we'll call the agent with the dependency and this allows us to fetch the customer name using the email and then inject that into the system prompt and give the agent access to the name for the interaction now if we run this you'll see that the agent now has access to the customer name hello John I'm sorry to hear that you haven't received your order after 5 days you can also see that the agent is not making product recommendations and priority level is seven this is filled out by the llm so the agent is well aware that this is a support call all right so now let's move on to Tools in pedantic AI there are two types of tools there are are plain tools those are the tools that you are familiar with from other Frameworks and then there are tools that need access to the agent context in dependencies now in our case the dependencies include a customer ID so if a tool needs that customer ID to make an API call well it needs access to the dependencies I'm going to start off by showing you what a plane tool call looks like so we're going to let the agent fetch some products where we don't need the customer ID and then make some recomend recomendations to the customer now a plane tool is created with the toolor plane decorator and this function will just make an API call to the Shopify API and fetch some product data and we don't need the customer ID for that the main query I'm going to run with this is what are some popular products you have in your store now if I run the agent you can see that it gets access to the product information unlike before it sets recommend products true and priority level is now lower it's at level three now finally we'll do a tool call with access to dependencies for that I'm defining a tool with the tool decorator and not toolor plane and you can see I'm passing in run context to the tool so that we get access to the dependency and again the context is accessed with the depths attribute so in this case I'm accessing the customer ID and the sharify API from the context that allows the agent to fetch orders for that specific Customer because the agent needs access to the customer ID in order to do that now here in the tool I'm extracting the relevant information from the order returned by Shopify I could also have done that in the Shopify data class and we do that by looping through orders and line items and just appending everything as text with this tool our agent has access to order data as well and again in the main function we do the same thing as before we instantiate the Shopify data class then we add the dependencies and then we run the agent with the dependencies I'm going to run the agent with the query can you check my recent orders and if I run the agent with python agent. piy you can see that the agent now has access to John's order history now this wraps up our pedantic AI quick start I hope you can see that this is a prom ing framework especially when it comes to building data analysis agents we're going to be spending more time building with this framework in future tutorials but that's it for now thanks for watching ) [_video_transcript] => Array ( [0] => field_67eef6f56d537 ) [extracted_processes_0_process_name] => Array ( [0] => Building a Basic AI Agent with Pydantic AI ) [_extracted_processes_0_process_name] => Array ( [0] => field_67ef07bdec135 ) [extracted_processes_0_description] => Array ( [0] => Creating a simple AI agent using Pydantic AI that interacts with a Large Language Model (LLM). ) [_extracted_processes_0_description] => Array ( [0] => field_67ef082dec137 ) [extracted_processes_0_steps_0_step_number] => Array ( [0] => 1 ) [_extracted_processes_0_steps_0_step_number] => Array ( [0] => field_67ef08c9ec13a ) [extracted_processes_0_steps_0_title] => Array ( [0] => Install required libraries ) [_extracted_processes_0_steps_0_title] => Array ( [0] => field_67ef08e3ec13b ) [extracted_processes_0_steps_0_description] => Array ( [0] => Install pydantic, pydantic-ai, anthropic, python-dotenv. ) [_extracted_processes_0_steps_0_description] => Array ( [0] => field_67ef08f1ec13c ) [extracted_processes_0_steps_1_step_number] => Array ( [0] => 2 ) [_extracted_processes_0_steps_1_step_number] => Array ( [0] => field_67ef08c9ec13a ) [extracted_processes_0_steps_1_title] => Array ( [0] => Import necessary modules ) [_extracted_processes_0_steps_1_title] => Array ( [0] => field_67ef08e3ec13b ) [extracted_processes_0_steps_1_description] => Array ( [0] => Import agent from pydantic_ai, asyncio, and dotenv. ) [_extracted_processes_0_steps_1_description] => Array ( [0] => field_67ef08f1ec13c ) [extracted_processes_0_steps_2_step_number] => Array ( [0] => 3 ) [_extracted_processes_0_steps_2_step_number] => Array ( [0] => field_67ef08c9ec13a ) [extracted_processes_0_steps_2_title] => Array ( [0] => Instantiate the agent ) [_extracted_processes_0_steps_2_title] => Array ( [0] => field_67ef08e3ec13b ) [extracted_processes_0_steps_2_description] => Array ( [0] => Create an agent instance with a specified LLM (e.g., CLAUDE-2.7-subnet) and a system prompt. ) [_extracted_processes_0_steps_2_description] => Array ( [0] => field_67ef08f1ec13c ) [extracted_processes_0_steps_3_step_number] => Array ( [0] => 4 ) [_extracted_processes_0_steps_3_step_number] => Array ( [0] => field_67ef08c9ec13a ) [extracted_processes_0_steps_3_title] => Array ( [0] => Run the agent ) [_extracted_processes_0_steps_3_title] => Array ( [0] => field_67ef08e3ec13b ) [extracted_processes_0_steps_3_description] => Array ( [0] => Execute the agent using run_sync or asynchronously with agent.run and asyncio. ) [_extracted_processes_0_steps_3_description] => Array ( [0] => field_67ef08f1ec13c ) [extracted_processes_0_steps] => Array ( [0] => 4 ) [_extracted_processes_0_steps] => Array ( [0] => field_67ef08b3ec139 ) [extracted_processes_0_tools_required] => Array ( [0] => pydantic, pydantic-ai, anthropic, python-dotenv ) [_extracted_processes_0_tools_required] => Array ( [0] => field_67ef87c04d397 ) [extracted_processes_0_difficulty] => Array ( [0] => Beginner ) [_extracted_processes_0_difficulty] => Array ( [0] => field_67ef87d94d398 ) [extracted_processes_0_time_required] => Array ( [0] => 15 minutes ) [_extracted_processes_0_time_required] => Array ( [0] => field_67ef87ee4d399 ) [extracted_processes_1_process_name] => Array ( [0] => Adding Dependencies to an AI Agent ) [_extracted_processes_1_process_name] => Array ( [0] => field_67ef07bdec135 ) [extracted_processes_1_description] => Array ( [0] => Injecting context-specific information into the agent's system prompt and tools. ) [_extracted_processes_1_description] => Array ( [0] => field_67ef082dec137 ) [extracted_processes_1_steps_0_step_number] => Array ( [0] => 1 ) [_extracted_processes_1_steps_0_step_number] => Array ( [0] => field_67ef08c9ec13a ) [extracted_processes_1_steps_0_title] => Array ( [0] => Define Dependencies ) [_extracted_processes_1_steps_0_title] => Array ( [0] => field_67ef08e3ec13b ) [extracted_processes_1_steps_0_description] => Array ( [0] => Create a data class representing the dependencies (e.g., customer name, ID). ) [_extracted_processes_1_steps_0_description] => Array ( [0] => field_67ef08f1ec13c ) [extracted_processes_1_steps_1_step_number] => Array ( [0] => 2 ) [_extracted_processes_1_steps_1_step_number] => Array ( [0] => field_67ef08c9ec13a ) [extracted_processes_1_steps_1_title] => Array ( [0] => Create Dynamic System Prompt ) [_extracted_processes_1_steps_1_title] => Array ( [0] => field_67ef08e3ec13b ) [extracted_processes_1_steps_1_description] => Array ( [0] => Define a function decorated with @system_prompt that takes RunContext and uses dependencies to create a context-aware prompt. ) [_extracted_processes_1_steps_1_description] => Array ( [0] => field_67ef08f1ec13c ) [extracted_processes_1_steps_2_step_number] => Array ( [0] => 3 ) [_extracted_processes_1_steps_2_step_number] => Array ( [0] => field_67ef08c9ec13a ) [extracted_processes_1_steps_2_title] => Array ( [0] => Inject Dependencies ) [_extracted_processes_1_steps_2_title] => Array ( [0] => field_67ef08e3ec13b ) [extracted_processes_1_steps_2_description] => Array ( [0] => Pass the dependency instance to the agent's run method using the 'dependency' parameter. ) [_extracted_processes_1_steps_2_description] => Array ( [0] => field_67ef08f1ec13c ) [extracted_processes_1_steps] => Array ( [0] => 3 ) [_extracted_processes_1_steps] => Array ( [0] => field_67ef08b3ec139 ) [extracted_processes_1_tools_required] => Array ( [0] => pydantic, pydantic-ai, dataclasses ) [_extracted_processes_1_tools_required] => Array ( [0] => field_67ef87c04d397 ) [extracted_processes_1_difficulty] => Array ( [0] => Intermediate ) [_extracted_processes_1_difficulty] => Array ( [0] => field_67ef87d94d398 ) [extracted_processes_1_time_required] => Array ( [0] => 30 minutes ) [_extracted_processes_1_time_required] => Array ( [0] => field_67ef87ee4d399 ) [extracted_processes_2_process_name] => Array ( [0] => Integrating Tools with Dependencies ) [_extracted_processes_2_process_name] => Array ( [0] => field_67ef07bdec135 ) [extracted_processes_2_description] => Array ( [0] => Connecting tools that require access to the agent's context and dependencies. ) [_extracted_processes_2_description] => Array ( [0] => field_67ef082dec137 ) [extracted_processes_2_steps_0_step_number] => Array ( [0] => 1 ) [_extracted_processes_2_steps_0_step_number] => Array ( [0] => field_67ef08c9ec13a ) [extracted_processes_2_steps_0_title] => Array ( [0] => Define a Tool with Dependencies ) [_extracted_processes_2_steps_0_title] => Array ( [0] => field_67ef08e3ec13b ) [extracted_processes_2_steps_0_description] => Array ( [0] => Create a function decorated with @tool that takes RunContext as a parameter. ) [_extracted_processes_2_steps_0_description] => Array ( [0] => field_67ef08f1ec13c ) [extracted_processes_2_steps_1_step_number] => Array ( [0] => 2 ) [_extracted_processes_2_steps_1_step_number] => Array ( [0] => field_67ef08c9ec13a ) [extracted_processes_2_steps_1_title] => Array ( [0] => Access Dependencies ) [_extracted_processes_2_steps_1_title] => Array ( [0] => field_67ef08e3ec13b ) [extracted_processes_2_steps_1_description] => Array ( [0] => Within the tool function, access the required dependencies from the RunContext using context.depths. ) [_extracted_processes_2_steps_1_description] => Array ( [0] => field_67ef08f1ec13c ) [extracted_processes_2_steps_2_step_number] => Array ( [0] => 3 ) [_extracted_processes_2_steps_2_step_number] => Array ( [0] => field_67ef08c9ec13a ) [extracted_processes_2_steps_2_title] => Array ( [0] => Use Dependencies in Tool Logic ) [_extracted_processes_2_steps_2_title] => Array ( [0] => field_67ef08e3ec13b ) [extracted_processes_2_steps_2_description] => Array ( [0] => Utilize the dependencies within the tool's logic (e.g., making API calls with customer ID). ) [_extracted_processes_2_steps_2_description] => Array ( [0] => field_67ef08f1ec13c ) [extracted_processes_2_steps] => Array ( [0] => 3 ) [_extracted_processes_2_steps] => Array ( [0] => field_67ef08b3ec139 ) [extracted_processes_2_tools_required] => Array ( [0] => pydantic, pydantic-ai ) [_extracted_processes_2_tools_required] => Array ( [0] => field_67ef87c04d397 ) [extracted_processes_2_difficulty] => Array ( [0] => Intermediate ) [_extracted_processes_2_difficulty] => Array ( [0] => field_67ef87d94d398 ) [extracted_processes_2_time_required] => Array ( [0] => 30 minutes ) [_extracted_processes_2_time_required] => Array ( [0] => field_67ef87ee4d399 ) [extracted_processes_3_process_name] => Array ( [0] => Using Plain Tools ) [_extracted_processes_3_process_name] => Array ( [0] => field_67ef07bdec135 ) [extracted_processes_3_description] => Array ( [0] => Using tools that do not require access to the agent's context. ) [_extracted_processes_3_description] => Array ( [0] => field_67ef082dec137 ) [extracted_processes_3_steps_0_step_number] => Array ( [0] => 1 ) [_extracted_processes_3_steps_0_step_number] => Array ( [0] => field_67ef08c9ec13a ) [extracted_processes_3_steps_0_title] => Array ( [0] => Define a Plain Tool ) [_extracted_processes_3_steps_0_title] => Array ( [0] => field_67ef08e3ec13b ) [extracted_processes_3_steps_0_description] => Array ( [0] => Create a function decorated with @tool_or_plane. ) [_extracted_processes_3_steps_0_description] => Array ( [0] => field_67ef08f1ec13c ) [extracted_processes_3_steps_1_step_number] => Array ( [0] => 2 ) [_extracted_processes_3_steps_1_step_number] => Array ( [0] => field_67ef08c9ec13a ) [extracted_processes_3_steps_1_title] => Array ( [0] => Implement Tool Logic ) [_extracted_processes_3_steps_1_title] => Array ( [0] => field_67ef08e3ec13b ) [extracted_processes_3_steps_1_description] => Array ( [0] => Implement the tool's functionality without using dependencies. ) [_extracted_processes_3_steps_1_description] => Array ( [0] => field_67ef08f1ec13c ) [extracted_processes_3_steps] => Array ( [0] => 2 ) [_extracted_processes_3_steps] => Array ( [0] => field_67ef08b3ec139 ) [extracted_processes_3_tools_required] => Array ( [0] => pydantic, pydantic-ai ) [_extracted_processes_3_tools_required] => Array ( [0] => field_67ef87c04d397 ) [extracted_processes_3_difficulty] => Array ( [0] => Beginner ) [_extracted_processes_3_difficulty] => Array ( [0] => field_67ef87d94d398 ) [extracted_processes_3_time_required] => Array ( [0] => 15 minutes ) [_extracted_processes_3_time_required] => Array ( [0] => field_67ef87ee4d399 ) [extracted_processes] => Array ( [0] => 4 ) [_extracted_processes] => Array ( [0] => field_67eef768bc578 ) [prompts_0_title] => Array ( [0] => Generate a basic Pydantic AI agent ) [_prompts_0_title] => Array ( [0] => field_67ef0781e6e82 ) [prompts_0_prompt_text] => Array ( [0] => Create a Python script using Pydantic AI that defines a simple agent. The agent should use the `CLAUDE-2.7-subnet` LLM and have a system prompt instructing it to act as a helpful assistant. Include the necessary imports, agent instantiation, and a synchronous run method. The agent should respond to the user input 'Hello'. ) [_prompts_0_prompt_text] => Array ( [0] => field_67ef0790e6e83 ) [prompts_0_variations] => Array ( [0] => Vary the LLM used (e.g., `gpt-3.5-turbo`), change the system prompt, and modify the user input to test different scenarios. Experiment with asynchronous execution using `agent.run` and `asyncio`. ) [_prompts_0_variations] => Array ( [0] => field_67ef81fb57199 ) [prompts_0_suggested_model] => Array ( [0] => gpt-3.5-turbo ) [_prompts_0_suggested_model] => Array ( [0] => field_67ef8888d19b6 ) [prompts_1_title] => Array ( [0] => Add dependencies to a Pydantic AI agent ) [_prompts_1_title] => Array ( [0] => field_67ef0781e6e82 ) [prompts_1_prompt_text] => Array ( [0] => Modify the provided Pydantic AI agent code to include dependencies. Define a data class named `CustomerData` with `name` and `id` fields. Create a dynamic system prompt using `@system_prompt` that incorporates the customer's name and ID into the prompt. Inject an instance of `CustomerData` with sample values into the agent's run method. The agent's response should reflect the provided customer information. ) [_prompts_1_prompt_text] => Array ( [0] => field_67ef0790e6e83 ) [prompts_1_variations] => Array ( [0] => Experiment with different data types and complexities within the dependency class. Modify how the dynamic system prompt utilizes the dependencies. Explore different ways to access and use the dependencies within the agent's logic. ) [_prompts_1_variations] => Array ( [0] => field_67ef81fb57199 ) [prompts_1_suggested_model] => Array ( [0] => gpt-3.5-turbo ) [_prompts_1_suggested_model] => Array ( [0] => field_67ef8888d19b6 ) [prompts_2_title] => Array ( [0] => Create a Pydantic AI agent with a tool using dependencies ) [_prompts_2_title] => Array ( [0] => field_67ef0781e6e82 ) [prompts_2_prompt_text] => Array ( [0] => Extend the provided Pydantic AI agent code to include a tool that utilizes dependencies. The tool should take `RunContext` as a parameter and access the `CustomerData` dependency. The tool should return a string greeting the customer by name using the `name` field from the dependency. The agent should use this tool when responding to the user input 'Greet the customer'. ) [_prompts_2_prompt_text] => Array ( [0] => field_67ef0790e6e83 ) [prompts_2_variations] => Array ( [0] => Create more complex tools that perform different actions based on the dependencies. Experiment with multiple dependencies and how they interact within the tool's logic. ) [_prompts_2_variations] => Array ( [0] => field_67ef81fb57199 ) [prompts_2_suggested_model] => Array ( [0] => gpt-3.5-turbo ) [_prompts_2_suggested_model] => Array ( [0] => field_67ef8888d19b6 ) [prompts_3_title] => Array ( [0] => Create a plain tool for a Pydantic AI agent ) [_prompts_3_title] => Array ( [0] => field_67ef0781e6e82 ) [prompts_3_prompt_text] => Array ( [0] => Write a Python function that acts as a plain tool for a Pydantic AI agent using the `@tool_or_plane` decorator. This tool should take a single string argument and return its reversed version. Demonstrate how to integrate this tool into a basic Pydantic AI agent. The agent should use this tool when responding to the user input 'Reverse this string: hello'. ) [_prompts_3_prompt_text] => Array ( [0] => field_67ef0790e6e83 ) [prompts_3_variations] => Array ( [0] => Create different plain tools with varying functionalities. Experiment with different input and output types for the tool. ) [_prompts_3_variations] => Array ( [0] => field_67ef81fb57199 ) [prompts_3_suggested_model] => Array ( [0] => gpt-3.5-turbo ) [_prompts_3_suggested_model] => Array ( [0] => field_67ef8888d19b6 ) [prompts] => Array ( [0] => 4 ) [_prompts] => Array ( [0] => field_67eef842e17da ) [video_article] => Array ( [0] => ## Building Super-Smart AI Agents? Easier Than You Think! Ever dreamt of building your own AI agent? Like, a *real* one that can handle complex tasks and interact with the world? I know, it sounds daunting. But guess what? It's way easier than you think, thanks to Pydantic AI and this awesome YouTube tutorial by Rabbitmetrics! Seriously, this video is a game-changer. Rabbitmetrics breaks down complex concepts into bite-sized, easy-to-digest chunks. It's like having a friendly AI expert whispering secrets in your ear! ### From Zero to Shopify Support Agent in 10 Minutes! (No, Really!) In just ten minutes, Rabbitmetrics walks you through building a fully functional Shopify customer support agent from scratch. Yes, you read that right! From *zero* to *hero* in the time it takes to brew a decent cup of coffee. They demonstrate how Pydantic AI, developed by the same brilliant minds behind the Pydantic library (used by giants like OpenAI, Anthropic, and LangChain!), simplifies agent development. Forget wrestling with complex code; this framework makes building robust, type-safe AI agents a breeze! You'll see how to craft a simple agent that chats with a Large Language Model (LLM), which is basically the brains of the operation. It's like giving your agent a super-powered thinking cap! ### Injecting Superpowers: Dependencies and Tools But wait, there's more! Rabbitmetrics doesn't stop at a basic agent. They dive into the really cool stuff: dependencies and tools. Imagine giving your AI agent access to specific information and the ability to use external services. That's exactly what dependencies and tools allow you to do. Need your agent to personalize responses based on customer data? No problem! Want to integrate with external APIs, like pulling product information directly from Shopify? Easy peasy! The video shows you how to inject context-specific info directly into your agent's "system prompt," giving it the knowledge it needs to be truly helpful. Plus, you'll learn how to connect tools that need access to the agent's context and dependencies, making your agent incredibly powerful and adaptable. It's like giving your AI agent a toolbox filled with amazing gadgets! ### Ready to Unleash Your Inner AI Mastermind? This tutorial is your golden ticket to the world of AI agent development. Rabbitmetrics provides clear explanations and practical demonstrations, making even the most intimidating concepts accessible to beginners. It's the perfect jumpstart for anyone curious about building their own intelligent agents. So, what are you waiting for? Ready to dive deeper into the nitty-gritty? Check out the detailed breakdown of each process below! You'll be amazed at what you can create with Pydantic AI. ) [_video_article] => Array ( [0] => field_67eef71c1d9aa ) [video_tags] => Array ( [0] => a:17:{i:0;s:2:"86";i:1;s:2:"88";i:2;s:2:"89";i:3;s:2:"90";i:4;s:2:"91";i:5;s:2:"92";i:6;s:2:"93";i:7;s:2:"94";i:8;s:2:"95";i:9;s:2:"96";i:10;s:2:"97";i:11;s:2:"98";i:12;s:2:"99";i:13;s:3:"100";i:14;s:3:"101";i:15;s:3:"102";i:16;s:3:"103";} ) [_video_tags] => Array ( [0] => field_67eef650e3bda ) [_edit_lock] => Array ( [0] => 1743999334:1 ) [_edit_last] => Array ( [0] => 1 ) [thumbnails_default] => Array ( [0] => ) [_thumbnails_default] => Array ( [0] => field_67f0ec7835de3 ) [thumbnails_medium] => Array ( [0] => ) [_thumbnails_medium] => Array ( [0] => field_67f0ec9835de4 ) [thumbnails_high] => Array ( [0] => ) [_thumbnails_high] => Array ( [0] => field_67f0eca235de5 ) [thumbnails_standard] => Array ( [0] => ) [_thumbnails_standard] => Array ( [0] => field_67f0eca935de6 ) [thumbnails_maxres] => Array ( [0] => ) [_thumbnails_maxres] => Array ( [0] => field_67ef978539c65 ) [thumbnails_max_res] => Array ( [0] => ) [_thumbnails_max_res] => Array ( [0] => field_67f0ecb335de7 ) [extracted_processes_0_steps_0_code_snippet] => Array ( [0] => ) [_extracted_processes_0_steps_0_code_snippet] => Array ( [0] => field_67ef0901ec13d ) [extracted_processes_0_steps_1_code_snippet] => Array ( [0] => ) [_extracted_processes_0_steps_1_code_snippet] => Array ( [0] => field_67ef0901ec13d ) [extracted_processes_0_steps_2_code_snippet] => Array ( [0] => ) [_extracted_processes_0_steps_2_code_snippet] => Array ( [0] => field_67ef0901ec13d ) [extracted_processes_0_steps_3_code_snippet] => Array ( [0] => ) [_extracted_processes_0_steps_3_code_snippet] => Array ( [0] => field_67ef0901ec13d ) [extracted_processes_1_steps_0_code_snippet] => Array ( [0] => ) [_extracted_processes_1_steps_0_code_snippet] => Array ( [0] => field_67ef0901ec13d ) [extracted_processes_1_steps_1_code_snippet] => Array ( [0] => ) [_extracted_processes_1_steps_1_code_snippet] => Array ( [0] => field_67ef0901ec13d ) [extracted_processes_1_steps_2_code_snippet] => Array ( [0] => ) [_extracted_processes_1_steps_2_code_snippet] => Array ( [0] => field_67ef0901ec13d ) [extracted_processes_2_steps_0_code_snippet] => Array ( [0] => ) [_extracted_processes_2_steps_0_code_snippet] => Array ( [0] => field_67ef0901ec13d ) [extracted_processes_2_steps_1_code_snippet] => Array ( [0] => ) [_extracted_processes_2_steps_1_code_snippet] => Array ( [0] => field_67ef0901ec13d ) [extracted_processes_2_steps_2_code_snippet] => Array ( [0] => ) [_extracted_processes_2_steps_2_code_snippet] => Array ( [0] => field_67ef0901ec13d ) [extracted_processes_3_steps_0_code_snippet] => Array ( [0] => ) [_extracted_processes_3_steps_0_code_snippet] => Array ( [0] => field_67ef0901ec13d ) [extracted_processes_3_steps_1_code_snippet] => Array ( [0] => ) [_extracted_processes_3_steps_1_code_snippet] => Array ( [0] => field_67ef0901ec13d ) [prompts_0_] => Array ( [0] => ) [_prompts_0_] => Array ( [0] => field_67ef81e8d3a3d ) [prompts_1_] => Array ( [0] => ) [_prompts_1_] => Array ( [0] => field_67ef81e8d3a3d ) [prompts_2_] => Array ( [0] => ) [_prompts_2_] => Array ( [0] => field_67ef81e8d3a3d ) [prompts_3_] => Array ( [0] => ) [_prompts_3_] => Array ( [0] => field_67ef81e8d3a3d ) )
Array ( [video_id] => S712jSrLWkA [channel_name] => Rabbitmetrics [channel_id] => UCNszHNG0PlhWJdtNqFvwMWw [description] => Learn how to build robust, type-safe AI agents in minutes with Pydantic AI in this step-by-step tutorial! I will create a fully functional Shopify customer support agent from scratch, showing you how to integrate external APIs, inject dependencies for personalization, and extend your agent with context-aware tools. Developed by the team behind Pydantic (used by OpenAI, Anthropic, and LangChain), this framework dramatically simplifies agent development while ensuring production-grade reliability. Link to the code:https://www.rabbitmetrics.com/pydantic-ai-in-10-minutes/Become a Rabbitmetrics Pro Member:https://www.rabbitmetrics.com/pro/▬▬▬▬▬▬ V I D E O C H A P T E R S & T I M E S T A M P S ▬▬▬▬▬▬0:00 Introduction0:35 Agents the Pydantic AI Way1:05 A Basic Agent2:50 Shopify Data4:08 Dependencies7:22 Plain Tools8:32 Tools with Dependencies [publish_date] => 2025-03-14T18:22:56Z [view_count] => 9088 [like_count] => 259 [comment_count] => 11 [category_id] => 28 [thumbnails] => Array ( [default] => [medium] => [high] => [standard] => [maxres] => [max_res] => ) [video_transcript] => with pantic AI building agents has become faster and more efficient than ever before in this video I'm going to show you how it works discuss the main benefits and unpack the core elements of the framework by building a real world example of a customer support agent let's get started pantic AI is developed by the team behind pedantic the number one data validation library for python the mission behind pedantic AI is to do for generative AI What fast API did for web development that means creating a framework that's intuitive Exel Ates the development process and reduces bucks with type- checking and data validation when we talk about agents we usually mean function calling with llms that is connecting an llm that can produ structured output such as Json with one or more Tools in pedantic AI the concept of an agent is further refined here an agent consists of a model one or more system prompts a structured results dependencies and function tools I'm going to walk you through each of these components now with a practical example of a customer support agent connecting to the Shopify API I have a requirements txt file here where we only need pedantic pedantic AI we need the Shopify API python Library anthropic and python. EnV to load environment variables and the environment variables are in a EnV file here I have an example. file we have the anthropic API key the Shopify token and the Shopify merant name we're going to start off building the most basic agent we can build with pensc AI so I'm going to import agent from pensc AI async iio andv in order to be able to load my environment variables and there's really nothing agenic about the most basic agent is basically an llm call here I'm calling CLA 3.7 Sunnet with a system prompt the important thing to note here is how we run the agent in the first example here I'm going to run the agent in a synchronous way I'm using run sync and this is how you usually run agents in other Frameworks but pantic AI is designed with asynchronous programming in mind so when you call run on an agent instead of run sync you're going to do asynchronous execution by default in other words agent run is a co- routine and we can wrap up the co- routine in an async function and use async IO to run the agent and of course you can also call your agent directly with async iio by passing the co- routine agent. run to async iio . run now let me run this basic agent just to see that everything works as intended if I run this I get the response from the three different ways of executing the agent now let's turn this into an actual agent by giving it access to the Shopify API we're going to add a small Shopify data Library this class utilizes the Shopify admin API python library and allows us us to extract data from three different Shopify objects we can extract customer data from the customer object using a customer ID as an input we can also extract product data from a given store we don't need an ID for that we just need the merchant name which we have in the environment variables and then we can extract orders from a given customer and we're going to need a customer ID to be able to extract the orders from a given customer now we want to focus on pedantic AIS I'm not going to spend any more time on how this Library works if you want to learn how to extract data from Shopify there are tutorials on my channel and also on the main web page before we move on to giving the agent access to Shopify let's just check that this class works here I have a test shy. py file where I'm instantiating the API and then I'm printing out products and printing out customer information for a given customer ID and the orders for that particular customer now if I run python test Shopify pyth you can see that we f the product data the customer data and the order data and now we have what we need to explore the capabilities of pedantic AI to see how pedantic AI differs from other AI agent Frameworks you need to understand the concept of dependencies dependencies allows us to dynamically control the context of the agent's work we can use dependencies to define dynamic system prompts and also provide context for the tools to give the tools access to those dependencies to see how this works let's start by giving the agent access to some cust information to begin with just the customer name now here I've updated the agent. py file with some additional code in order to work with dependencies we're going to import run context from pedantic AI I'm importing base model and field from pedantic and data class from data classes because I want to define a data class that gives us support dependencies and then I want to define a pedantic model that gives us the structured output which I call support results and this will force the agent to give us a structured output defined by this pedantic model then in my agent in addition to the model that we had before and the system prompt we're going to pass in the support dependencies as steps type and the support results as result type and note that I have the same static system prompt as before that I'm passing to the agent now I'm going to define a second one a dynamic system prompt that I'm also going to add to the agent and the main difference between static system prompts and dynamic system prompts is that dynamic system prompts depend on some context that is not known until runtime a dynamic system prompt is defined with a system prompt decorator and a system prompt function that takes run context as the first parameter and the way that we access the context is to use the attribute depths so we call depths on the context also note that run context is parameterized with our dependency type in our case defined by the data class support dependencies under the hood pedantic is going to check the type of the dependency that we injecting and raise an error if the type is wrong now in our case what we want to inject into the dynamic system prompt is a customer name that we're going to fetch from the customer object in Shopify using a customer ID and this is going to give our agent a very basic context for the interaction with the customer now in the main function we'll instantiate the Shopify API and we'll create the support dependencies with the customer ID and the Shopify API and then we'll call the agent with the dependency and this allows us to fetch the customer name using the email and then inject that into the system prompt and give the agent access to the name for the interaction now if we run this you'll see that the agent now has access to the customer name hello John I'm sorry to hear that you haven't received your order after 5 days you can also see that the agent is not making product recommendations and priority level is seven this is filled out by the llm so the agent is well aware that this is a support call all right so now let's move on to Tools in pedantic AI there are two types of tools there are are plain tools those are the tools that you are familiar with from other Frameworks and then there are tools that need access to the agent context in dependencies now in our case the dependencies include a customer ID so if a tool needs that customer ID to make an API call well it needs access to the dependencies I'm going to start off by showing you what a plane tool call looks like so we're going to let the agent fetch some products where we don't need the customer ID and then make some recomend recomendations to the customer now a plane tool is created with the toolor plane decorator and this function will just make an API call to the Shopify API and fetch some product data and we don't need the customer ID for that the main query I'm going to run with this is what are some popular products you have in your store now if I run the agent you can see that it gets access to the product information unlike before it sets recommend products true and priority level is now lower it's at level three now finally we'll do a tool call with access to dependencies for that I'm defining a tool with the tool decorator and not toolor plane and you can see I'm passing in run context to the tool so that we get access to the dependency and again the context is accessed with the depths attribute so in this case I'm accessing the customer ID and the sharify API from the context that allows the agent to fetch orders for that specific Customer because the agent needs access to the customer ID in order to do that now here in the tool I'm extracting the relevant information from the order returned by Shopify I could also have done that in the Shopify data class and we do that by looping through orders and line items and just appending everything as text with this tool our agent has access to order data as well and again in the main function we do the same thing as before we instantiate the Shopify data class then we add the dependencies and then we run the agent with the dependencies I'm going to run the agent with the query can you check my recent orders and if I run the agent with python agent. piy you can see that the agent now has access to John's order history now this wraps up our pedantic AI quick start I hope you can see that this is a prom ing framework especially when it comes to building data analysis agents we're going to be spending more time building with this framework in future tutorials but that's it for now thanks for watching [extracted_processes] => Array ( [0] => Array ( [process_name] => Building a Basic AI Agent with Pydantic AI [description] => Creating a simple AI agent using Pydantic AI that interacts with a Large Language Model (LLM). [steps] => Array ( [0] => Array ( [step_number] => 1 [title] => Install required libraries [description] => Install pydantic, pydantic-ai, anthropic, python-dotenv. [code_snippet] => ) [1] => Array ( [step_number] => 2 [title] => Import necessary modules [description] => Import agent from pydantic_ai, asyncio, and dotenv. [code_snippet] => ) [2] => Array ( [step_number] => 3 [title] => Instantiate the agent [description] => Create an agent instance with a specified LLM (e.g., CLAUDE-2.7-subnet) and a system prompt. [code_snippet] => ) [3] => Array ( [step_number] => 4 [title] => Run the agent [description] => Execute the agent using run_sync or asynchronously with agent.run and asyncio. [code_snippet] => ) ) [tools_required] => pydantic, pydantic-ai, anthropic, python-dotenv [difficulty] => Beginner [time_required] => 15 minutes ) [1] => Array ( [process_name] => Adding Dependencies to an AI Agent [description] => Injecting context-specific information into the agent's system prompt and tools. [steps] => Array ( [0] => Array ( [step_number] => 1 [title] => Define Dependencies [description] => Create a data class representing the dependencies (e.g., customer name, ID). [code_snippet] => ) [1] => Array ( [step_number] => 2 [title] => Create Dynamic System Prompt [description] => Define a function decorated with @system_prompt that takes RunContext and uses dependencies to create a context-aware prompt. [code_snippet] => ) [2] => Array ( [step_number] => 3 [title] => Inject Dependencies [description] => Pass the dependency instance to the agent's run method using the 'dependency' parameter. [code_snippet] => ) ) [tools_required] => pydantic, pydantic-ai, dataclasses [difficulty] => Intermediate [time_required] => 30 minutes ) [2] => Array ( [process_name] => Integrating Tools with Dependencies [description] => Connecting tools that require access to the agent's context and dependencies. [steps] => Array ( [0] => Array ( [step_number] => 1 [title] => Define a Tool with Dependencies [description] => Create a function decorated with @tool that takes RunContext as a parameter. [code_snippet] => ) [1] => Array ( [step_number] => 2 [title] => Access Dependencies [description] => Within the tool function, access the required dependencies from the RunContext using context.depths. [code_snippet] => ) [2] => Array ( [step_number] => 3 [title] => Use Dependencies in Tool Logic [description] => Utilize the dependencies within the tool's logic (e.g., making API calls with customer ID). [code_snippet] => ) ) [tools_required] => pydantic, pydantic-ai [difficulty] => Intermediate [time_required] => 30 minutes ) [3] => Array ( [process_name] => Using Plain Tools [description] => Using tools that do not require access to the agent's context. [steps] => Array ( [0] => Array ( [step_number] => 1 [title] => Define a Plain Tool [description] => Create a function decorated with @tool_or_plane. [code_snippet] => ) [1] => Array ( [step_number] => 2 [title] => Implement Tool Logic [description] => Implement the tool's functionality without using dependencies. [code_snippet] => ) ) [tools_required] => pydantic, pydantic-ai [difficulty] => Beginner [time_required] => 15 minutes ) ) [prompts] => Array ( [0] => Array ( [title] => Generate a basic Pydantic AI agent [prompt_text] => Create a Python script using Pydantic AI that defines a simple agent. The agent should use the `CLAUDE-2.7-subnet` LLM and have a system prompt instructing it to act as a helpful assistant. Include the necessary imports, agent instantiation, and a synchronous run method. The agent should respond to the user input 'Hello'. [variations] => Vary the LLM used (e.g., `gpt-3.5-turbo`), change the system prompt, and modify the user input to test different scenarios. Experiment with asynchronous execution using `agent.run` and `asyncio`. [suggested_model] => gpt-3.5-turbo ) [1] => Array ( [title] => Add dependencies to a Pydantic AI agent [prompt_text] => Modify the provided Pydantic AI agent code to include dependencies. Define a data class named `CustomerData` with `name` and `id` fields. Create a dynamic system prompt using `@system_prompt` that incorporates the customer's name and ID into the prompt. Inject an instance of `CustomerData` with sample values into the agent's run method. The agent's response should reflect the provided customer information. [variations] => Experiment with different data types and complexities within the dependency class. Modify how the dynamic system prompt utilizes the dependencies. Explore different ways to access and use the dependencies within the agent's logic. [suggested_model] => gpt-3.5-turbo ) [2] => Array ( [title] => Create a Pydantic AI agent with a tool using dependencies [prompt_text] => Extend the provided Pydantic AI agent code to include a tool that utilizes dependencies. The tool should take `RunContext` as a parameter and access the `CustomerData` dependency. The tool should return a string greeting the customer by name using the `name` field from the dependency. The agent should use this tool when responding to the user input 'Greet the customer'. [variations] => Create more complex tools that perform different actions based on the dependencies. Experiment with multiple dependencies and how they interact within the tool's logic. [suggested_model] => gpt-3.5-turbo ) [3] => Array ( [title] => Create a plain tool for a Pydantic AI agent [prompt_text] => Write a Python function that acts as a plain tool for a Pydantic AI agent using the `@tool_or_plane` decorator. This tool should take a single string argument and return its reversed version. Demonstrate how to integrate this tool into a basic Pydantic AI agent. The agent should use this tool when responding to the user input 'Reverse this string: hello'. [variations] => Create different plain tools with varying functionalities. Experiment with different input and output types for the tool. [suggested_model] => gpt-3.5-turbo ) ) [video_article] =>## Building Super-Smart AI Agents? Easier Than You Think!
Ever dreamt of building your own AI agent? Like, a *real* one that can handle complex tasks and interact with the world? I know, it sounds daunting. But guess what? It’s way easier than you think, thanks to Pydantic AI and this awesome YouTube tutorial by Rabbitmetrics! Seriously, this video is a game-changer. Rabbitmetrics breaks down complex concepts into bite-sized, easy-to-digest chunks. It’s like having a friendly AI expert whispering secrets in your ear!
### From Zero to Shopify Support Agent in 10 Minutes! (No, Really!)
In just ten minutes, Rabbitmetrics walks you through building a fully functional Shopify customer support agent from scratch. Yes, you read that right! From *zero* to *hero* in the time it takes to brew a decent cup of coffee. They demonstrate how Pydantic AI, developed by the same brilliant minds behind the Pydantic library (used by giants like OpenAI, Anthropic, and LangChain!), simplifies agent development. Forget wrestling with complex code; this framework makes building robust, type-safe AI agents a breeze! You’ll see how to craft a simple agent that chats with a Large Language Model (LLM), which is basically the brains of the operation. It’s like giving your agent a super-powered thinking cap!
### Injecting Superpowers: Dependencies and Tools
But wait, there’s more! Rabbitmetrics doesn’t stop at a basic agent. They dive into the really cool stuff: dependencies and tools. Imagine giving your AI agent access to specific information and the ability to use external services. That’s exactly what dependencies and tools allow you to do. Need your agent to personalize responses based on customer data? No problem! Want to integrate with external APIs, like pulling product information directly from Shopify? Easy peasy! The video shows you how to inject context-specific info directly into your agent’s “system prompt,” giving it the knowledge it needs to be truly helpful. Plus, you’ll learn how to connect tools that need access to the agent’s context and dependencies, making your agent incredibly powerful and adaptable. It’s like giving your AI agent a toolbox filled with amazing gadgets!
### Ready to Unleash Your Inner AI Mastermind?
This tutorial is your golden ticket to the world of AI agent development. Rabbitmetrics provides clear explanations and practical demonstrations, making even the most intimidating concepts accessible to beginners. It’s the perfect jumpstart for anyone curious about building their own intelligent agents. So, what are you waiting for?
Ready to dive deeper into the nitty-gritty? Check out the detailed breakdown of each process below! You’ll be amazed at what you can create with Pydantic AI.
[video_tags] => Array ( [0] => 86 [1] => 88 [2] => 89 [3] => 90 [4] => 91 [5] => 92 [6] => 93 [7] => 94 [8] => 95 [9] => 96 [10] => 97 [11] => 98 [12] => 99 [13] => 100 [14] => 101 [15] => 102 [16] => 103 ) )
Array ( [0] => Array ( [process_name] => Building a Basic AI Agent with Pydantic AI [description] => Creating a simple AI agent using Pydantic AI that interacts with a Large Language Model (LLM). [steps] => Array ( [0] => Array ( [step_number] => 1 [title] => Install required libraries [description] => Install pydantic, pydantic-ai, anthropic, python-dotenv. [code_snippet] => ) [1] => Array ( [step_number] => 2 [title] => Import necessary modules [description] => Import agent from pydantic_ai, asyncio, and dotenv. [code_snippet] => ) [2] => Array ( [step_number] => 3 [title] => Instantiate the agent [description] => Create an agent instance with a specified LLM (e.g., CLAUDE-2.7-subnet) and a system prompt. [code_snippet] => ) [3] => Array ( [step_number] => 4 [title] => Run the agent [description] => Execute the agent using run_sync or asynchronously with agent.run and asyncio. [code_snippet] => ) ) [tools_required] => pydantic, pydantic-ai, anthropic, python-dotenv [difficulty] => Beginner [time_required] => 15 minutes ) [1] => Array ( [process_name] => Adding Dependencies to an AI Agent [description] => Injecting context-specific information into the agent's system prompt and tools. [steps] => Array ( [0] => Array ( [step_number] => 1 [title] => Define Dependencies [description] => Create a data class representing the dependencies (e.g., customer name, ID). [code_snippet] => ) [1] => Array ( [step_number] => 2 [title] => Create Dynamic System Prompt [description] => Define a function decorated with @system_prompt that takes RunContext and uses dependencies to create a context-aware prompt. [code_snippet] => ) [2] => Array ( [step_number] => 3 [title] => Inject Dependencies [description] => Pass the dependency instance to the agent's run method using the 'dependency' parameter. [code_snippet] => ) ) [tools_required] => pydantic, pydantic-ai, dataclasses [difficulty] => Intermediate [time_required] => 30 minutes ) [2] => Array ( [process_name] => Integrating Tools with Dependencies [description] => Connecting tools that require access to the agent's context and dependencies. [steps] => Array ( [0] => Array ( [step_number] => 1 [title] => Define a Tool with Dependencies [description] => Create a function decorated with @tool that takes RunContext as a parameter. [code_snippet] => ) [1] => Array ( [step_number] => 2 [title] => Access Dependencies [description] => Within the tool function, access the required dependencies from the RunContext using context.depths. [code_snippet] => ) [2] => Array ( [step_number] => 3 [title] => Use Dependencies in Tool Logic [description] => Utilize the dependencies within the tool's logic (e.g., making API calls with customer ID). [code_snippet] => ) ) [tools_required] => pydantic, pydantic-ai [difficulty] => Intermediate [time_required] => 30 minutes ) [3] => Array ( [process_name] => Using Plain Tools [description] => Using tools that do not require access to the agent's context. [steps] => Array ( [0] => Array ( [step_number] => 1 [title] => Define a Plain Tool [description] => Create a function decorated with @tool_or_plane. [code_snippet] => ) [1] => Array ( [step_number] => 2 [title] => Implement Tool Logic [description] => Implement the tool's functionality without using dependencies. [code_snippet] => ) ) [tools_required] => pydantic, pydantic-ai [difficulty] => Beginner [time_required] => 15 minutes ) )