{ "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 the APIs for Anthropic and Google, as well as OpenAI." ] }, { "cell_type": "markdown", "id": "2b268b6e-0ba4-461e-af86-74a41f4d681f", "metadata": {}, "source": [ "
\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. Any problems? Try asking ChatGPT to clarify how to merge - or contact me! \n", " After you've pulled the code, from the llm_engineering directory, in an Anaconda prompt (PC) or Terminal (Mac), run: \n", " conda env update --f environment.yml \n", " Or if you used virtualenv rather than Anaconda, then run this from your activated environment in a Powershell (PC) or Terminal (Mac): \n", " pip install -r requirements.txt \n",
" Then restart the kernel (Kernel menu >> Restart Kernel and Clear Outputs Of All Cells) to pick up the changes.\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",
" 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",
" 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",
"