DeepLearning.AI
AI is the new electricity and will transform and improve nearly all areas of human lives.

๐Ÿ’ป ย  Accessing Utils File and Helper Functions

In each notebook on the top menu:

1: ย  Click on "File"

2: ย  Then, click on "Open"

You will be able to see all the notebook files for the lesson, including any helper functions used in the notebook on the left sidebar. See the following image for the steps above.


๐Ÿ’ป ย  Downloading Notebooks

In each notebook on the top menu:

1: ย  Click on "File"

2: ย  Then, click on "Download as"

3: ย  Then, click on "Notebook (.ipynb)"


๐Ÿ’ป ย  Uploading Your Files

After following the steps shown in the previous section ("File" => "Open"), then click on "Upload" button to upload your files.


๐Ÿ“— ย  See Your Progress

Once you enroll in this courseโ€”or any other short course on the DeepLearning.AI platformโ€”and open it, you can click on 'My Learning' at the top right corner of the desktop view. There, you will be able to see all the short courses you have enrolled in and your progress in each one.

Additionally, your progress in each short course is displayed at the bottom-left corner of the learning page for each course (desktop view).


๐Ÿ“ฑ ย  Features to Use

๐ŸŽž ย  Adjust Video Speed: Click on the gear icon (โš™) on the video and then from the Speed option, choose your desired video speed.

๐Ÿ—ฃ ย  Captions (English and Spanish): Click on the gear icon (โš™) on the video and then from the Captions option, choose to see the captions either in English or Spanish.

๐Ÿ”… ย  Video Quality: If you do not have access to high-speed internet, click on the gear icon (โš™) on the video and then from Quality, choose the quality that works the best for your Internet speed.

๐Ÿ–ฅ ย  Picture in Picture (PiP): This feature allows you to continue watching the video when you switch to another browser tab or window. Click on the small rectangle shape on the video to go to PiP mode.

โˆš ย  Hide and Unhide Lesson Navigation Menu: If you do not have a large screen, you may click on the small hamburger icon beside the title of the course to hide the left-side navigation menu. You can then unhide it by clicking on the same icon again.


๐Ÿง‘ ย  Efficient Learning Tips

The following tips can help you have an efficient learning experience with this short course and other courses.

๐Ÿง‘ ย  Create a Dedicated Study Space: Establish a quiet, organized workspace free from distractions. A dedicated learning environment can significantly improve concentration and overall learning efficiency.

๐Ÿ“… ย  Develop a Consistent Learning Schedule: Consistency is key to learning. Set out specific times in your day for study and make it a routine. Consistent study times help build a habit and improve information retention.

Tip: Set a recurring event and reminder in your calendar, with clear action items, to get regular notifications about your study plans and goals.

โ˜• ย  Take Regular Breaks: Include short breaks in your study sessions. The Pomodoro Technique, which involves studying for 25 minutes followed by a 5-minute break, can be particularly effective.

๐Ÿ’ฌ ย  Engage with the Community: Participate in forums, discussions, and group activities. Engaging with peers can provide additional insights, create a sense of community, and make learning more enjoyable.

โœ ย  Practice Active Learning: Don't just read or run notebooks or watch the material. Engage actively by taking notes, summarizing what you learn, teaching the concept to someone else, or applying the knowledge in your practical projects.


๐Ÿ“š ย  Enroll in Other Short Courses

Keep learning by enrolling in other short courses. We add new short courses regularly. Visit DeepLearning.AI Short Courses page to see our latest courses and begin learning new topics. ๐Ÿ‘‡

๐Ÿ‘‰๐Ÿ‘‰ ๐Ÿ”— DeepLearning.AI โ€“ All Short Courses [+]


๐Ÿ™‚ ย  Let Us Know What You Think

Your feedback helps us know what you liked and didn't like about the course. We read all your feedback and use them to improve this course and future courses. Please submit your feedback by clicking on "Course Feedback" option at the bottom of the lessons list menu (desktop view).

Also, you are more than welcome to join our community ๐Ÿ‘‰๐Ÿ‘‰ ๐Ÿ”— DeepLearning.AI Forum


Sign in

Create Your Account

Or, sign up with your email
Email Address

Already have an account? Sign in here!

By signing up, you agree to our Terms Of Use and Privacy Policy

Choose Your Learning Path

Enjoy 30% Off Now. Cancel Anytime!

MonthlyYearly

Change Your Plan

Your subscription plan will change at the end of your current billing period. Youโ€™ll continue to have access to your current plan until then.

View All Plans and Features

Welcome back!

Hi ,

We'd like to know you better so we can create more relevant courses. What do you do for work?

DeepLearning.AI
  • Explore Courses
  • Community
    • Forum
    • Events
    • Ambassadors
    • Ambassador Spotlight
  • My Learnings
  • daily streak fire

    You've achieved today's streak!

    Complete one lesson every day to keep the streak going.

    Su

    Mo

    Tu

    We

    Th

    Fr

    Sa

    free pass got

    You earned a Free Pass!

    Free Passes help protect your daily streak. Complete more lessons to earn up to 3 Free Passes.

    Free PassFree PassFree Pass
Welcome to Pydantic for LLM workflows. In this course, you'll learn how you can use the Pydantic Python package to get an LLM to give you structured output. And by that, I mean output that's formatted exactly the way you want it to be. So of course, In general, LLMs produce free form text. And that can be great if you're doing something like summarizing an article or maybe coming up with an idea for a new recipe. But if you're building an LLM into a larger software system where you have multiple components and you want to be able to pass the data you're getting from an LLM to the next component in the system in a predictable way, that's when pydantic and structured output can be a big help. So for example, imagine you're building a customer support application where the user can submit a request. Maybe something like Hey, I forgot my password. or a complaint like, I'm not happy with the product I bought. You could pass that customer query to an LLM and have it generate a structured response that might look like this, where you have the user's information, like their name and email, the text of their request, a priority and a category. And then you might record some other things, like whether or not this request is a complaint. And maybe some tags or keywords about the request. Then your system could take this structured response and decide what to do next. Like if it's an urgent issue, you might create a support ticket and route it to a human support agent who can follow up and help. Or for this simple request of I forgot my password, you might pass the structured response to another LLM agent that can call a tool, like a function that can look up an FAQ response that could help the user. So maybe in this case that would be an FAQ response with a password reset link and instructions. So whether it's this step of having an LLM create a structured response that becomes a Support Ticket with this exact set of fields and content, or having an LLM provide the parameters you need. to call a tool and look up an FAQ response. You have very precise expectations for what each of those LLM responses needs to look like and what kind of data it needs to contain. So in this course, you'll learn different methods for using Pydantic to ensure that an LLM is giving you exactly the data that you need. Or in other words, you'll learn to validate the data that you're getting in a response from an LLM. And along the way, you'll also be learning data validation skills that can help you with handling a wide variety of data in really any kind of software system. And that might include things like human input to the system or external APIs and data sources, or really any data that you're wanting to pass from one component to the next in your system. It turns out that pydantic has actually been around since well before LLMs were a thing. And it's one of the most popular data validation frameworks. works out there. In fact, Pydantic sees over 300 million downloads per month, making it not just one of the most popular data validation frameworks, but really one of the most popular Python packages, period. And that's because data validation is at the core of really any software application. And so, in the lessons that follow, you'll be learning how you can use Pydantic to get structured output from an LLM. And you'll also be building data validation skills that you can use in any software application where you want to pass data from one component to the next. So, let's go on to the next video to get started.
course detail
Next Lesson
Pydantic for LLM Workflows
  • Welcome to Pydantic for LLM workflows
    Video
    ใƒป
    3 mins
  • Introduction to Pydantic for LLM workflows
    Video
    ใƒป
    10 mins
  • Pydantic model basics
    Video with Code Example
    ใƒป
    13 mins
  • Validating LLM responses
    Video with Code Example
    ใƒป
    15 mins
  • Passing a Pydantic model in your API call
    Video with Code Example
    ใƒป
    9 mins
  • Tool calling
    Video with Code Example
    ใƒป
    19 mins
  • Conclusion
    Video
    ใƒป
    1 min
  • Appendix โ€“ Tips, Help, and Download
    Code Example
    ใƒป
    10 mins
  • Course Feedback
  • Community