And welcome back everybody.
Welcome to week two day three.
It's a continuation of our enjoyment of radio, our celebration of everything that is radio and user
interfaces.
Uh, what you can already do in addition to using open AI, anthropic and Gemini, you can now also
build UIs for your solutions.
And you should feel pretty good about that.
Uh, by the end of today, you'll be able to do more.
You'll be able to build chat UIs, a specific type of UI which is very common.
You'll be able to provide the history of conversation in a prompt, and you will build your very first
customer support assistant, an AI assistant, also known as a chat bot.
A very common I use case.
You will have mastered it today.
So again, very common.
J'en ai use case.
I think we're all very familiar with them.
Llms based on chat bots.
Super effective at conversation.
It's hard to remember that only a few years ago, if you experienced one of these chatbot style interfaces
on a website, you would be in the world of responding one, two, three, or four to different things,
or use a keyword like booking or something like that.
How far we have come.
You can now have an informed conversation with customer service chatbots on websites, and you often
do.
And, you know, frankly, there have been times when I've got more value from a conversation with a
chatbot than I have from a human being, which is a sorry, sad sense of the times.
Um, but obviously we can't do things like asking it how many times the letter A appears in that sentence.
Uh, but anyways, uh, the, uh, the chatbot use case.
Very familiar, very important indeed.
And something where llms excel.
You can imagine some of the things that we're familiar with, the friendly personas that we can give
chatbots, or indeed any persona we can have the ability to maintain context between messages this staggering
way that you can hold a conversation and refer to things that you said earlier.
And we all know now that that is some, some, some trickery going on there.
It's an illusion that you're really having this persistent conversation.
What's happening is at each step.
The entire conversation history is being provided to the LLM in order to get back the next response.
Um, and then also these assistants can have subject matter expertise, which they use to answer questions
in a knowledgeable way.
So, uh, very important aspect of interacting with assistants is the correct use of prompts.
We're very familiar now with the system prompt that we can use to set the tone of the conversation.
You can establish ground rules.
There is a common prompt technique of saying if you don't know the answer, just say so.
To try and encourage llms to be truthful and not to hallucinate.
Uh, context is how you can use, uh, the add additional information into the conversation to give
the LLM more context on what's being discussed.
And then multi shots prompting is when you add information to the prompt to give multiple examples of
interactions as a way to, uh, craft, to sort of hone the character of the LLM by giving it examples
to work from, and also to prime it with information that might be useful later.
It's interesting that this feels a bit like training because it's learning from multiple examples,
but of course, this isn't training in the data science sense.
The model has already been trained.
The neural network training has happened.
This is all at what we call an inference time at runtime.
It's all just generating future tokens based on past.
But the point is that if that past set of tokens includes a bunch of questions and answers, then when
it's predicting the future, it's more likely it's more likely to pick future tokens that are consistent
with what it's seen in the past.
And that's why this works so very well.
So we're now going to build a chatbot.
Our first chatbot.
And it's going to look like this.
It's going to have a sort of instant message style interface to it with questions from us, responses
from the chatbot in this sort of interface, which, you know, that's that's reasonably sophisticated
and I'm telling you that we're going to be able to do it all in this one lesson, and it will give you
tooling to be able to do the same thing in the future.
So without further ado, let's go over to JupyterLab.