MLOps Community
+00:00 GMT
Sign in or Join the community to continue

From an API to a Chat GPT Plugin

Posted Jul 17, 2023 | Views 646
# LLM in Production
# Chat GPT Plugin
# GetYourGuide
Share
speaker
avatar
Mathieu Bastian
Director of Engineering, Data Products @ GetYourGuide

Mathieu leads the ML/AI team at GetYourGuide in Berlin and formerly was part of LinkedIn's Data Science team. He also co-founded the open-source graph visualisation software Gephi.

+ Read More
SUMMARY

We've built GetYourGuide's ChatGPT plugin in about a week with a few engineers. It was an interesting experience we would love to share.

+ Read More
TRANSCRIPT

 All right, so we are in a very intense lightning round right now. So next up is Matthew Bastian from Get Your Guide. He's gonna talk to us about from APIs to chat, p d plugin. Um, let's get him on the screen and give him his full 10 minutes. Hi everyone, happy Friday. Um, thanks a lot for the introduction.

So 10 minutes to talk about, uh, Chad g p d plugin. So let's dive right in. So why, uh, actually we were excited about, uh, plugins at the first place. So get your guide, if you don't know. It is an online marketplace for travel activities and typically, um, travelers, they, they use our app to discover what they can do when they travel.

Here's with Barcelona beautiful and sunny right now. Um, and yeah, travel planning is, is hard. There's so much things you can do in a destination, so little time you want to build those incredible memories, right? And then you're most likely doing that last minute on the go in the wifi of the hotel, booking something to for, for today or tomorrow.

So that's kind of what Getchu guys is all about, uh, helping you discover those incredible activities and, and experiences you can do in a destination. And it turns out that Chad Gpt is pretty good at, uh, travel planning. You can, uh, give it, uh, your instructions, um, you know, give a little bit of, uh, of, of, uh, preferences, what you wanna do, how long is it itinerary and so on.

And what we want, what we wanted to do is basically enhance this with, uh, relevant and, uh, bookable activities from, from get your Guide. And that's basically where the, uh, charge BT plugin comes in. And all you need is, uh, is actually an api. The, the whole architecture is built around these manifest file.

So very simply, we have a single endpoint to retrieve activities. You describe what it is in, in, in pure language. You add some, uh, description about parameters, kind of like date filters or price filter or whatever. Um, also responses, uh, and, and schemas and so on. So that's basically all you have to do. And the chat g PT plugin infrastructure would convert these, uh, prompts into API calls that, uh, um, retrieve the results.

And it's a bit of a, of an art, right? So you need to be, uh, you know, maybe hiding some parameters and, and doing a bit of, uh, of massaging of the description to get rid of the behavior you're looking for. But it's, it's really simple and, um, That's what we did. Uh, we shipped that, um, you know, pretty quickly.

It was actually a very moderate effort, uh, a team effort and, you know, just with a, within a week with a few engineers, were able to get our plugin, uh, released. It's not really that, you know, I'm bragging or anything. It's more that the architecture, the is very elegant. You don't really have to do much code and of course you have to have an a p i in the first place, but that's probably not so, uh, uncommon.

And, and here you go. You have a, a, a workable, uh, plugin of, uh, chat g Bt. Uh, that's what it looks like. Essentially you're prompted with, uh, with your intent and you'll get some activities you can do here in Paris and it even has this nice, nice little snippets that you can click on and continue your, your journey, uh, and get your guide.

And basically with, with what it does in the prompt is really identify, um, these entities like locations, but also dates, you know, next Saturday, tomorrow, on Christmas, it's able to convert all of that. Then some kind of interests. So you can say, I like outdoor, um, you know, I'm interested in food or, uh, and so on and so forth.

And then maybe some other types of filters that we support, such as I'm traveling solo, or I have a budget. And so on and so forth. So all of these, uh, kind of elements in the prompts would be converted into some kind of API parameters that we can, uh, we can understand. Um, couple of learnings from building this.

Um, first of all, testing was a bit of a challenge. Uh, it's of course early days, but it's really early days. Sometimes, uh, you can only have up to 15 users, uh, testing the plugin when it's in development. And releasing is a bit of a pain as well. Uh, if you change something in the manifest, your plugin gets, uh, disapproved and it may take actually a couple of days until it's approved again.

So that's, uh, you know, kind of not the same experience as the the Apple store. Um, but still it's early days. Um, the API design was, uh, was a good learning for us. You kind of need to really be specific, you know, uh, about date formats or making the, your errors very understandable so that the bot can actually play with this, uh, nicely and, and get, you get the behavior that you want.

And we, we discovered many interesting concept through this. Um, Build out, for example, prompt injection, something to think about. And also this, uh, open graph protocol that is a bit behind this, uh, uh, little, uh, image snippets that you saw in the, in the screenshot. A few other learnings, uh, from our side is that it's, it makes us rethink how, how the API should be built, uh, for these types of applications because context is hard.

You're gonna be pretty specific about what you want. Uh, you know, I like Rason, for example. Or like you, you're gonna be more, um, More of a, both about your preferences and typically our API or service are more like, uh, working with implicit personalization such as, okay, you booked a couple of, uh, adventure activities, or you're more into food, and then we're gonna show you more of this, uh, this types of experiences.

But here we can really go deep in, in telling Chad g, PT what you want. And then we don't fully understand all of that yet. What's really challenging at this point is how to improve the bot because we actually have no data or insights about, uh, kind of what, what are the prompts that, uh, that are, you know, originating to the queries we receive.

So that's, uh, that's something we, we hope, uh, will improve. And then we were blown away by the ability for, uh, the infrastructure to translate, uh, requests and responses. So you kind of build once and you get, um, an application usable in basically all possible languages, which is amazing. So, So I hope I got you inspired, uh, by, uh, by this, uh, journey.

We actually got inspired, uh, a lot also to continue. And we thought that maybe we should try to build our own chatbot. Um, and essentially could we have the same functionality but integrate it into our website or into our app. And the way we thought about this was, could we. Reverse engineer the way chat G p t translates these prompts into, into API calls.

So that was a little bit of a tinkering and uh, you know, what if can we do this? And it turns out that it works and you end up with a very simple architecture that you receive a prompt. Uh, what can I do in Miami, for example, uh, to our, um, get to guide chat. We send that. Uh, to Chad g PT to translate that query into the same API specifications, um, that, um, you know, we would receive from the Chad G PT plugin infrastructure.

Then we execute that query to retrieve, in that case our experiences, and then send that response back to the user. And that's, um, you know, essentially the. Magic behind it. We, uh, I'm showing you, you hear the, the system prompt that actually replicates the uh, chat g PT plugin capability. So with that system prompt and the user prompt, G P T is able to get us the API specs that we need to call, you know, with the right filters, uh, and the right parameters.

Then we execute that, and then we send it back to the user. So it was fun to, uh, to play with this. Of course. Uh, this now is obsolete, right? Uh, as everything with LLMs, uh, within a couple of days. Um, there's this very cool, uh, function calling, uh, rollout from, uh, open a open AI that I think pretty much does this, uh, without having to, to do this, uh, system prompt.

And that's probably something we need to take a look at and, uh, and, uh, and build further. So, yeah, that, uh, that was, uh, on journey, uh, building chat g PT plugin. I hope, uh, you enjoyed it and I'm open for maybe one or two questions. Awesome. Thank you so much. We are gonna have to send you to the chat. We have our next two speakers lined up.

Um, but thank you so much mu much, Matthew. Sorry it's been a, a long day. Um, we really appreciate it. This was awesome. Thank you. Bye-bye. Thank you. Bye.

+ Read More
Sign in or Join the community

Create an account

Change email
e.g. https://www.linkedin.com/in/xxx or https://xx.linkedin.com/in/xxx
I agree to MLOps Community’s Code of Conduct and Privacy Policy.

Watch More

19:14
How to Build a Multimodal LLM App Using LangChain and GPT-4 Vision
Posted Jan 29, 2024 | Views 466
# Multimodal LLM App
# Artifact Storage
# Siennai Analytics
Learnings from Live Coding: An MLOps Project on Twitch
Posted May 12, 2021 | Views 809
# Interview
# Coding Workshop
# Live Coding
# Twitch
# cargill.com
How To Move From Barely Doing BI to Doing AI - Building A Solid Data Foundation
Posted Dec 16, 2020 | Views 1.3K
# ternarydata.com