{ "cells": [ { "cell_type": "markdown", "id": "06cf3063-9f3e-4551-a0d5-f08d9cabb927", "metadata": {}, "source": [ "# Welcome to Week 2!\n", "\n", "## Frontier Model APIs\n", "\n", "In Week 1, we used multiple Frontier LLMs through their Chat UI, and we connected with the OpenAI's API.\n", "\n", "Today we'll connect with them through their APIs.." ] }, { "cell_type": "markdown", "id": "2b268b6e-0ba4-461e-af86-74a41f4d681f", "metadata": {}, "source": [ "
\n",
" \n",
" | \n",
" \n",
" Important Note - Please read me\n", " I'm continually improving these labs, adding more examples and exercises.\n", " At the start of each week, it's worth checking you have the latest code.\n", " First do a git pull and merge your changes as needed. Check out the GitHub guide for instructions. Any problems? Try asking ChatGPT to clarify how to merge - or contact me! \n", " \n", " | \n",
"
\n",
" \n",
" | \n",
" \n",
" Reminder about the resources page\n", " Here's a link to resources for the course. This includes links to all the slides.\n", " https://edwarddonner.com/2024/11/13/llm-engineering-resources/ \n", " Please keep this bookmarked, and I'll continue to add more useful links there over time.\n", " \n", " | \n",
"
\n",
" \n",
" | \n",
" \n",
" Any time you change your .env file\n", " Remember to Save it! And also rerun load_dotenv(override=True)\n", " \n", " | \n",
"
\n",
" \n",
" | \n",
" \n",
" Before you continue\n", " \n", " Be sure you understand how the conversation above is working, and in particular how themessages list is being populated. Add print statements as needed. Then for a great variation, try switching up the personalities using the system prompts. Perhaps one can be pessimistic, and one optimistic?\n", " \n", " | \n",
"
\n",
" \n",
" | \n",
" \n",
" Business relevance\n", " This structure of a conversation, as a list of messages, is fundamental to the way we build conversational AI assistants and how they are able to keep the context during a conversation. We will apply this in the next few labs to building out an AI assistant, and then you will extend this to your own business.\n", " | \n",
"