over 3 years ago Syntax Podcast
Coding with the Open AI / Chat GPT API
- 00:30 Talking about the OpenAI and ChatGPT APIs
- 00:45 Stumbling over saying OpenAI API
- 01:06 Wes excited to talk about coding with the API
- 01:24 Sentry sponsor
- 03:20 Start talking about the OpenAI API
- 03:47 Axios used in the API
- 04:15 Transcripts summarized with OpenAI API
- 04:50 Scott playing around with the API
- 07:42 Most data sent to OpenAI is text
- 08:13 1000 tokens is about 750 words
- 08:44 Costs a fraction of a cent per 1000 tokens
- 09:51 Output length affects cost
- 10:38 Cheap for one podcast but adds up at scale
- 11:45 Other companies adding OpenAI APIs
- 13:04 GPT pricing very fluid
- 15:11 Chunking transcripts to stay under token limit
- 16:09 Must send full context each request
- 19:01 Fine tuning models not possible yet
- 21:12 Chat completion most popular API
- 22:28 Text completion similar to chat completion
- 22:53 Image generation API
- 24:37 Speech to text API
- 26:17 Embedding API for relatedness
- 27:38 Langchain JavaScript library
- 29:54 Prompt tuning takes work
- 31:22 Anticipating future misinformation
- 32:24 Tip to save responses
- 33:33 Curious about training on old tweets
Scott playing around with the API
Wes Bos
Send the API key along with every single response so they can kind of store it and whatnot. Why do you think they use Axios as opposed to words. So if you think, okay, cool. Yeah, I just spoke 7 50 words. That's about 1,000 tokens and you pay per 1,000 tokens I'm sure you will be able to do that type of thing. So if you do want to fine tune it, it's not possible with the latest and greatest.
Wes Bos
So it's nice to hear. Yeah, so obtuse. And they have lots of like really good note examples as well. So you can just copy paste, Alright. That's it. Thanks, sir, for tuning in. If you're making anything with the OpenAI just make some sort of just have it right to a file. Yeah. JSON file so that you can I go back and review it should you ever need that? That was my little gotcha.
Wes Bos
You simply just sign up. Like, I've been signed up for a while Also, Warp the other day released their own And it's awesome. It actually uses Axios behind the scenes, which is kind of interesting. So if you're familiar with Axios response of every single podcast we've ever recorded, which is roughly about to play with these APIs. So an entire book and say, please summarize this book for me. It's not entirely possible because you can't give it that much text at once. So the solution to that is called summarizing,
Wes Bos
to test it out on their GUI.
Wes Bos
And I thought it was kind of interesting how they use Axios because they have to
Wes Bos
I really like that because a lot of APIs instead of having the chat interface of back and forth, you just give it straight up text that type of thing doesn't They have, like, a bunch of dev tools, but I thought, let's actually write some code against this. So they have a no they have a Python and a Node. Js API, the, like, 5 years from now, Because if you want to rerun something, I had one the other day. This was really interesting.
Scott Tolinski
web APIs, I'm always like, why can't you just give me an API key? And, like, that's it. Like, what? Like, just let me deal with an API key. I can handle that.
Wes Bos
Just just like straight up that. Yeah. I guess they could probably do it under the under the hood.
Scott Tolinski
So I've been playing around with that, feeding it a bunch of transcripts, and I thought we'd just talk about, like, how do you actually use this type of thing? Sick. Yeah. I have you know what? I've I've done a cursory glance at this stuff, so I I'm really excited to play the role of the audience member who has not dove into these quite yet. So I'm gonna be asking you,
Wes Bos
and whatnot. It's pretty easy to get up and running.
Wes Bos
But they
Sentry sponsor
Wes Bos
jumped right into Century. I saw exactly what was happening. I saw, oh, good thing. It only happened once because it was probably a freak thing with the API dotai seems to be more for like transcribing Somebody sent me over. It's a A nested object and freaking the node console Yeah.
Wes Bos
I had caught an actual error of when their API was down. And for some reason,
Wes Bos
cause your node process to crash. So I a OpenAI API, let us know at syntax fm. We'd love to hear your thoughts on working with it. Yeah. Likewise. I wanna hear what people are doing. Who's
Wes Bos
an error of an API. I was submitting some data to It's I was, like, looking at that for 30000 minutes of audio And boom, the thing works has really good error messages returned as to, like, what might have possibly gone wrong. So it's very easy to actually use and get up and running. That's what it's funny. Whenever I use Apple's $0.002,
Wes Bos
Bam, it crashed. And I said, Like, I like I wanted to summarize, Sorry. The input is going to be $0.03 and then you are also paying based on the output, How much text it sends back to you.
Wes Bos
3 months without a single crash. And the other day,
Wes Bos
You see a spike, and it's like, none. None. None. It shows you, like, a 24 hour graph, questions to gauge how smart That would be good for an interview.
Wes Bos
My email newsletter API and and then your graph goes from give me 3 hashtags
Wes Bos
So let's talk about OpenAI
Wes Bos
Century is the savior for figuring out what's going on with your website. Why is your website being slow? Why does your website have bugs? Why did it crash? of us talking about logging.
Wes Bos
none to subset of People who are like, oh, I don't know, 6 or 7 client secrets and OAuth and all this, like, stuff. And it's just exhausting And then I would say, please take this block And each of it also includes timestamps of Scott Tolinski at 4 minutes and 32 seconds says this. And Wes Boss at 8 minutes says this, and it goes back and forth. So a 25 minute podcast,
Wes Bos
being down, It's for measuring relatedness, I really want me 5 questions about CSS.
Cheap for one podcast but adds up at scale
Wes Bos
maybe it scales. Well, it's kind of interesting to just see it now. Like, Raycast added me to their AI beta. Actually, they added you as well. Yeah.
Scott Tolinski
it. A more substantial cost in your business. Yeah. Yeah. Absolutely. That
Wes Bos
for you. Like, I think it's trying to slow down so you don't ask it too much, But I hate that. Like, just give me all of the text immediately.
Scott Tolinski
these numbers get to a point where
Scott Tolinski
that's building on this and you're processing
Scott Tolinski
500 podcasts for each user. Why? It's never gonna be that, but that's when you're gonna start to see
Image generation API
Wes Bos
Actually, it gave me, like, photos of some guy sitting at a computer monitor with his mouth open. But it's, like, very clearly just like some you chunk up the podcast
Scott Tolinski
it where it would be able to
Scott Tolinski
transform layers without text and then understand text as a text layer rather than just pixels
Wes Bos
or is before that, you just believe anything when I started writing the notes for Yeah, I guess that's what GitHub did as well. But
Wes Bos
which is part of me is like, 3 months ago, I was marveling at how amazing this was that it could create a thing But I signed up a couple of years ago and I have a really affordable plan, having to get up. Actually, I have some notes on, like, OAuth APIs using them In general, how that works. So we have another show on that coming. But this is like reminds me of the old days. You give it your API key. It has methods for things like chat completion where you get, like, a $400 to train it on every word we have ever spoken. That's which is that's a lot a lot of A lot of text to send it. Yeah. That's a bargain, all things considered. Yeah.
Scott Tolinski
because text as pixels.
Wes Bos
CS. Do text. It's just random
Scott Tolinski
But who knows, Wes? You know, there there could be a patch next week a new version of something, and it's going to be like all of a sudden, probably by the time this comes out.
Wes Bos
Fever
Scott Tolinski
maybe, you know, maybe, like, the way that that ends up working is inside of actual
Wes Bos
dream Yeah.
Wes Bos
so you can ask it for a specific image of something and it will generate it.
Wes Bos
You know? Impossible. Yeah.
Scott Tolinski
letters, and that makes sense. And when you think about the technology and how it's producing these images,
Wes Bos
a guy on there. And it also doesn't do text at all. None of these AI models related podcasts
Scott Tolinski
software like Figma or something
Wes Bos
replace this with a grandma.
Langchain JavaScript library
Wes Bos
and you sort of nail but you have to send all 3 parts to it. Otherwise, it has no context. I wonder if that will ones. Open AI Hugging Face is another one. There's several of them out there, and
Wes Bos
What does that mean? We can ask, it depends on how big the output You could tell us what do you want? What are you trying to get out of the app? Do you take these 2 sentences and make it into 3 paragraphs, or are you taking this 25 minute podcast and Putting it into
Scott Tolinski
It's a postgraduate academic degree.
Wes Bos
6 or 7 sentences summarizing. So there's one called Recursive Character Text Splitter, it wouldn't be able to do that thing. So what I was I just use this Website Otter dotai.
Scott Tolinski
Language learning.
Scott Tolinski
Yeah.
Wes Bos
summarize it into that me and you were saying.
Wes Bos
initially. And I was like, that's not how Scott and I talk. And I want the show notes to look like it was. So I said, like, Interesting. Basically what it is, it's like a library for working with multiple
Scott Tolinski
It.
Scott Tolinski
LLM stands for master of laws.
Wes Bos
the the wording and whatnot. And, also,
Wes Bos
to massage the summarization Otter So you could say you are a
Wes Bos
That's not correct, obviously. An LLVM can be used as a back end for compiling and optimizing machine learning models
Wes Bos
which will essentially do that. It'll summarize it all for you So you could just give it your entire
Wes Bos
and I was trying to
Wes Bos
they both interface with lots of them, which is nice. And then they also have handy methods like
Scott Tolinski
Language?
Scott Tolinski
GPT. What does LLVM mean? It. Low level virtual machine? No. That's not right.
GPT pricing very fluid
Scott Tolinski
But it also just dropped. So that basically goes to show you that a lot of the stuff is very
Scott Tolinski
And it's also again, it's better, so you're getting a better product for that money. It's not like you're Exactly. Yeah. Paying for nothing. One of the benefits to,
Scott Tolinski
One could come out and be, like, astronomically
Wes Bos
which is what I actually ended up doing for the podcast is Next 1 is speech to text, which is the, I think it's called the Whisper API.
Scott Tolinski
concerned as well as excited that the pricing can be,
Wes Bos
Token limit or something like that, which means that I'm not able to send, like, I was only able to send about 8 minutes worth of our transcript Feed it some sort of info. I'm curious now. Like, I also have my all my tweets downloaded.
Scott Tolinski
expensive,
Scott Tolinski
of pricing, you know, and that would both make me,
Scott Tolinski
and maybe you've built your entire business on this thing, and you might just have to suck up and pay it. You know, who knows? There's probably a case where it's just going to get cheaper all the way down every year as we go. I think it will be a wash eventually.
Scott Tolinski
Fluid in terms
Wes Bos
the GPT 4 is that there is a token limit on request. So I think right now on 3.5, is 8,000 tokens, so 4 times bigger. And then you can also go up to 32,000 will just give you straight up rest API endpoints.
Wes Bos
into what I was doing is I was chunking them up into maybe we could ask them a If I were to feed that into You gotta use Change at some point where you get like a seed or like a unique identifier at 1,000, sorry, at a 5th of a cent per 1,000 tokens, So I'm pretty excited about
Start talking about the OpenAI API
Wes Bos
this surface more information around the podcast I was catching the error and I just threw done for that. Yeah, that would be actually fun.
Wes Bos
So
Wes Bos
it's so funny that And like, that's no problem. But you say, hey, Put the text Wes on top. Impossible.
Wes Bos
API.
Wes Bos
They had released an update to GPT,
Fine tuning models not possible yet
Wes Bos
These are a little bit easier, but
Wes Bos
And the way that it works is and it replies to you and then you ask it like a follow-up question that says Mhmm. No. I've tried that. Please look for x, y, and z.
Wes Bos
and harder.
Scott Tolinski
write us Questions for a potluck quest for a potluck episode, and it's like, oh, here's a I wonder if that would be a total disaster or not. Oh, it's a it's a good question. Or
Wes Bos
bit More technical it was like when we went from 3.5 to The 3.5 turbo, it got 10 times cheaper, and that's the point where I said, alright. I'm dipping into this thing. Ten times cheaper. It's almost nothing. And then GPT 4 comes out and it's 15 times more. So there's image generation, which is the, I think, the DALL E thing.
Wes Bos
Okay. How do you implement a CSS grid layout? How do you create CSS animation that loops infinitely? A a 1,000 tokens is about 750 to update it, you have to give it an array of system, user system, user system, etcetera, back and forth.
Scott Tolinski
I I have a fun idea that we can put into our back catalog. But, yeah, What what if we, like, trained it on all of our potluck episodes specifically and then, like, asked it to
Scott Tolinski
Oh, yeah.
Wes Bos
And I said I just did some back of the napkin math here.
Wes Bos
7 or 8 different APIs that are used for different things. Probably the most popular one is the chat completion API.
Scott Tolinski
Yeah. Robots stumped. I'm
Wes Bos
Hey. You could also have it, like, asked us stumped questions.
Other companies adding OpenAI APIs
Scott Tolinski
this powerful of thing on our computer. Maybe. Maybe. Yeah. You know, it's interesting here is that, like, I I actually didn't know that. I thought It was a token. I thought it was a token based thing so that I thought there was some sort of
Scott Tolinski
So the GPT 4 is is 15 times more expensive right now.
Wes Bos
I thought, well, 10, $11 for GitHub Copilot was kind of a lot, but now looking at this, they might be,
Scott Tolinski
as these languages and these models evolve,
Scott Tolinski
Yeah.
Wes Bos
like, GitHub Copilot, that's what, $11 a month, So using the streaming API. I guess you could do that with fetches. You know what? I don't really know. Probably just for a speed thing.
Scott Tolinski
you know, like,
Wes Bos
If if you think about, every block
Scott Tolinski
the the pricing isn't like set the pricing isn't just for using
Scott Tolinski
The tech the price is on like a per model basis.
Wes Bos
some VC footing the bill for that right now. But I'm very curious if it will get cheaper. They want to be hooked too. Totally.
Tip to save responses
Wes Bos
will not do it unless you console dot dir into But I think with that kind of stuff, it will only get cheaper as the technology evolves. And Probably at a certain point, we'll be able to just run
Wes Bos
To get up and running, if you've got 6 or $7 kicking around, you certainly should try to which Instance you give it your API key, and then every single time that you you create a fetch, you don't have to pass it your API key again. But you could also do that with with straight up fetch. So I'm not really totally sure around that, but it's kind of interesting. You don't really see too much of the Axios API service,
Wes Bos
So And for right now, there are other models that you can And then it said as a machine, I cannot do the 1st person. I got around it somehow, but you really do have to spend some time massaging the prompt before we do anything, I would like to train it on every word we have ever said It's actually pretty nifty. It's not 8 hours a day. Every single line of code I write, it's sending my code All of the information that it's told you so far. So I have a couple comments there. 1, I needed Written in high level languages such as Python, allowing for efficient execution of various hardware targets.
Wes Bos
or like hook up
Wes Bos
I, like, ran this super recursive thing to try to summarize And then they'll also give you, like, Additionally, LLVM can use accelerate the execution of certain operations It's kind of 8 bullet points. And I even went as far as to say,
Wes Bos
6 episodes at once and out the other end.
Wes Bos
the hook up Versus code or whatever. And there's just a pain in the ass. So I, I wasted, like, a dollar.
Wes Bos
for example, I console logged from the looks of it, there's a bunch of like Like custom error handling, it looks like they are
Must send full context each request
Wes Bos
I would like to
Scott Tolinski
you know you know how you you learn these little factoids in life and then you just hear them repeated over and over again, and sometimes it just, like, really, Like, I hear so many people say the goldfish thing, and and I'm the type of person who's, like, listening to my podcast player being like, that's not right.
Scott Tolinski
your your brain matter because
Scott Tolinski
storage essentially of the content. So that makes way more sense, Essentially, like, in from a technical aspect how this works too.
Scott Tolinski
is fake. That's a fake,
Wes Bos
It's like a goldfish. As soon as it sends the data back, it has no recollection of you actually asking that unless you give it That's actually pretty good. Maybe we should do a stumped In the one that's been tuned for no bias and, like like, there's been a for the truth. Exact tune it. Exactly. Yes.
Wes Bos
all of the show notes that we have and and maybe even, like, all the Tweet replies. Like, there's all this information. Like, wouldn't it be nice to give it all that first? Mhmm. And then say, okay. Given that you've listened to every episode, Object. Object. Object. Object.
Scott Tolinski
So Sorry, I had to. I don't like
Wes Bos
500 words, 2nd time 600 words, 3rd time it's and you have to you have to also send it what it sent back to you. So basically you have to say, all right, Chad, Over to GPT and before I hit that actual limit. And that's a bit of a bummer because if you want to give it That's awesome. Honestly, the most expensive console log I ever had because I was Correct. Yeah. And I was Who's the, what we would like to
Scott Tolinski
The goldfish thing actually we have finished all of Yeah. But you also have to consider too, like, that is super cheap for
Scott Tolinski
The goldfish thing was I think you might need to update,
Scott Tolinski
do not have a 5 second memory or whatever. That is a lie that people say. And,
Scott Tolinski
fake thing that yeah. Goldfish, some questions as well as as we go here. So, yeah, I'm interested to hear what you've done. So first of all, using the API is Extremely refreshing.
Wes Bos
maybe even all of our tweets Yeah. Totally. The kind of the thing about the GPT 3.5 Be a bit more relaxed. Yeah. Don't be as verbose. And you and then over time, and I said, give me some variations on this. And it just it
Scott Tolinski
being a know it all in that way, but that's good. Yeah. I appreciate that. We could ask Chad GPT about the goldfish thing. I'm sure I would agree. I like that.
Transcript
Announcer
Open wide dev fans, get ready to stuff your face with JavaScript, CSS, node modules, barbecue tips, get workflows, breakdancing, soft skill, web development, the hastiest,
Announcer
Monday. Monday. Monday.
Announcer
the craziest,
Scott Tolinski
Welcome to Syntax.
Announcer
Tolinski.
Announcer
Boss, and Scott, El Toro Loco,
Scott Tolinski
On this Monday, hasty treat. We're gonna be talking about the open AI and chat GPT
Announcer
the tastiest web development treats coming again hot. Here is Wes, Barracuda,
Chat completion most popular API
Wes Bos
and then it will return to your reply.
Wes Bos
There's also text completion,
Wes Bos
web developer Okay, that's pretty good. What is the cascade of CSS and how does it work? How do you optimize CSS performance on a website? who's the speaker? Because I was telling and I told them, please use the 1st person.
Wes Bos
3 things. You give it a system prompt, Which is basically telling the robot what it is.
Wes Bos
Is Oh, this is affecting 200 people in the last hour. That's kind of off. Drop whatever you are doing right now.
Wes Bos
kind of the same thing as the chat. Basically,
Wes Bos
to it. And then there is also assistant, which is what the what they give back to you. And then you can pass it Like I said earlier, if you wanna pass an entire back and forth conversation There's a moderation API for Just like in in the examples that I was, it says Scott goes on to talk about how he really loved using called GPT Turbo. And then by the time I finished writing these notes, they had released GPT 4, which Just this stuff is moving super fast and we'll sort of keep you updated. But the whole very good, 1 5th of a cent per 1,000 tokens.
Wes Bos
your users are and their experience in CSS. So you sort of set the stage for what the system is. You see, this is who you are, you little robot you.
Text completion similar to chat completion
Wes Bos
maybe do away with that, but they seem to be pushing people more in the area of before you tell it to summarize, a little bit because it was being very cold I would think like, okay, you create a new OpenAI The prices on OpenAI have come down significantly
Wes Bos
I think they will probably and it is running
1000 tokens is about 750 words
Wes Bos
Turbo came out and the price is
Wes Bos
a couple of weeks ago, GPT Wes said he had tried this.
Wes Bos
that you're doing. And when there is a 2,000 There's all types and TypeScript for it.
Wes Bos
3.5 It's getting very cheap
Prompt tuning takes work
Scott Tolinski
And I would find out that it would say it wouldn't it wouldn't do it. I was like as an athlete because I was I was listening us into something. I forgot what it was, but they were talking about the types of performance enhancing drugs that certain athletes are taking to avoid detection. Mhmm. So I wanted to see it. If ChatGPT
Scott Tolinski
just to see it. If people could say, hey, I wanna take steroids in professional sports. How can I get around this? And Chad Gpt is like, and
Scott Tolinski
Performance enhancing drugs.
Scott Tolinski
You know, it's like, no. No. No. No. I'm like, but well, what if I was a police officer? Yeah.
Scott Tolinski
just for fun. I was, like, asking it questions about
Scott Tolinski
before you you get it going in there. Oh, no. It is interesting the types of things that, like, refuses to do,
Scott Tolinski
I ain't doing that.
Scott Tolinski
could be able to
Scott Tolinski
Let's just say you could do that.
Scott Tolinski
how to avoid detection for professional organizations
Scott Tolinski
I'm I'm not dealing with anything illegal here. So then I was like, well, let's just say,
Scott Tolinski
And I'm just trying to understand a little bit more about how these athletes are getting away with it, and they, like, refused at all steps. So I was just trying to dance around that. That's hilarious. You know what I'm Not looking forward to
Transcripts summarized with OpenAI API
Wes Bos
And it really doesn't cost all that much. We'll talk more about how much does it actually cost in just a second? I've been testing it with the syntax transcripts. We talked a while ago about Whisper, So they use them together. There's a bunch of examples out there. It seems a little bit complicated for me at the moment, so I'm just playing with it. So I just downloaded some transcripts of it.
Wes Bos
In terms of, like, descriptions and transcripts, but, like, more helpful information around the transcripts. Specifically, I was trying to summarize as well as,
Wes Bos
every major topic and give it a time stamp that's associated with that. And OpenAI is fantastic at that type of thing.
Chunking transcripts to stay under token limit
Wes Bos
as big of a blocks as you can, and then you pass those maybe as soon as this goes mainstream.
Wes Bos
$0.09 or $0.10 What is the box model and how does it work? How do you center an element horizontally and vertically? What is the difference between visibility hidden UI to ask quick questions rather than have to go to see I haven't. I should do that. OpenAI,
Wes Bos
You don't just send the updated text. You send the entire transcript every single time. So Every time. Every single time. So every time, like if the 1st time it's fine tune. Eventually, depth null but the API itself is Very simple.
Wes Bos
2 blocks into it, and then it summarizes again. And basically, you could just keep summarizing the parts down it kind of does the text completion, but it also does the context of going back and forth. So that's probably the one you're going to want to check out is The chat completion. If you're checking this out yourself, different LLVM's, you give it It's really interesting to see all of these apps just implement it for free right now. And, you know, there's GPT three Io.
Wes Bos
And then you recursively call that meaning that you you summarize Open AI has
Wes Bos
until you reduce it. And every time you're doing that, you are paying for more tokens. So that $0.03 that I said earlier
Wes Bos
When you ask it a question This is what it means for our life.
Wes Bos
Multiple times over and over again. And the same thing is with the chat. So on chat g p t, when you say it's really not that much more than it was 3 weeks ago, you know? Oh, right. Yeah, that that tracks.
Wes Bos
might end up being actually per podcast because I'm running it Which is really cool. I've been finding myself using the Raycast What do you think about X, Y, and Z? So fine tuning the model is not doable on the and you say, okay, I'm following up this conversation, but will tell you? Are you a sheep? and machine learning frameworks such as TensorFlow, PyTorch through just in time compilation.
Stumbling over saying OpenAI API
Wes Bos
high level.
Scott Tolinski
And forgive me for stumbling over OpenAIAPI.
Scott Tolinski
That's, something that is going to be difficult to say the entire episode. My name is it. Got to let's get a developer from Denver. With me, as always, is
Wes Bos
Wes Bos. Hey. I'm excited to talk about this. We had Travis on, and he did, like, a very API around it is somewhat similar.
Curious about training on old tweets
Scott Tolinski
And don't forget to subscribe in your podcast player or drop a review if you like this show.
Speech to text API
Wes Bos
examples where people But And then you have user, which is your your prompt. So you basically you give it an array of prompts. The first one is is usually system. You'd say what it is. The second 1 is your question That's it for working with it. It is really fun I was trying to get it. It would say like Scott and Wes are talking about, So to give you a concept of, like, how much does that actually cost? But then again, you're not paying twice to summarize that tokens, so much to a point where you can just start to play around with it.
Wes Bos
Figma for this example. You know? Like, he was doing it. Really nice examples of, like, Scott and then Wes Another thing that you can do with these models is you can fine tune them, meaning that you can give it information and summarize it into 2 sentences.
Wes Bos
Zoom calls these days.
Wes Bos
who are the speakers, meaning that it's that describes this episode. So in that case, it's returning that actually made sense given that it has listened to everything? so I was just using it as a good way. I probably API.
Wes Bos
It works pretty good. It does not do This x, y, and z, That would cost which I think would be really cool because again, if we give it our entire back catalog of podcasts, what happened? and then they feed those timestamps So
Wes Bos
of that. And if we didn't give it who was speaking which words, And they count their tokens. It's kinda weird, but generally about a 1,000 words sorry.
Wes Bos
moderating comments and spam and whatnot. There's an embedding API. This one's really interesting to me.
Wes Bos
transcripts, but thing and then it will summarize it for you. I did. I'm not sure exactly how that works because I did find one wrong loop or one rogue console log
Wes Bos
asked Scott about his thoughts on X, Y, and Z. Like, it was doing a really good that you know. Right? So, like, right now, it just has this wide body of knowledge. But wouldn't it be nice if you could feed it? Like, for example, syntax? getting into that. Let's talk about one of our sponsors. 1st, though, is Sentry at Sentry.
Wes Bos
speaker detection, though.
Wes Bos
You can also use Descript.
Wes Bos
summarization Use other AI models to detect
Wes Bos
text.
Wes Bos
our my a up and down.
Costs a fraction of a cent per 1000 tokens
Wes Bos
and the chat log in, it makes you log in again. And also, I hate that it like The chat gbt, like, does the word typing Yeah. It's very difficult, I think, in that same sort of way. I find it amazing that it can You can give it an image and say, make me smile large learning but I wasn't catching that. And as you know, if uncaught errors Yeah.
Wes Bos
The following podcast in bullet forms an error. That was my own error. Like, I caught whatever 503 error they had, and I threw an error of like, Looks like the Drip API is down, What's the difference between nth child and nth of type? Like, we'd some somehow feed it a bunch of facts, API, which is cool because it's context of what you're running in your terminal, but you can also ask it questions.
Wes Bos
a 25 minutes podcast of which is kind of cool, like the recursive, the limit to GPT 4
Wes Bos
us Give I asked you this, you told me this, and Now I'm asking you this,
Wes Bos
I took
Wes Bos
And that's really interesting because
Wes Bos
while maintaining the time stamp Wouldn't it be cool to suggest Could end up costing you via all the transcripts, robot version.
Wes Bos
Out the other end for $0.03.
Wes Bos
Extremely cheap if you think about it. Like, I could take a 25 minute podcast and you put some you put a little bit more text on top of you. It says, please summarize I talked I talked a while ago how I had a couple crashes that were here and there, and I had been running for
Embedding API for relatedness
Wes Bos
It's much more expensive per token.
Scott Tolinski
And, what might be the most interesting to you.
Wes Bos
which What would happen if we like it? JavaScript library for working with multiple And what you're doing is you're pretty much just you're compressing it And this will just basically take audio and convert it into dictated
Scott Tolinski
The contents
Scott Tolinski
of a multimedia file
Scott Tolinski
Right. We have all the audio. You have all that text.
Scott Tolinski
relate
Wes Bos
the stuff yourself. So like interesting. We could maybe that's even possible right now. Let's try it. Can you
Scott Tolinski
I don't know how YouTube does their algorithm. I'm sure it's not Doing anything with text in that regard yet, but it does seem like that would be a huge upgrade to be able to scan
Scott Tolinski
to completely understand what it is about and what it's most closely related to. So I talked About summarizing, And you think about it, you know,
Wes Bos
Let's talk about Langchain.
Scott Tolinski
You should be able to say
Talking about the OpenAI and ChatGPT APIs
Scott Tolinski
APIs. We're gonna be talking basically about what the heck the open a
Scott Tolinski
I API what are the episodes that most closely express
Scott Tolinski
really is and what you can do with it.
Wes excited to talk about coding with the API
Wes Bos
here's how you actually code it with JavaScript.
Wes Bos
And this is the kind of the opposite show, which is going to be You can edit an image. So what I did is I gave it my YouTube thumbnail, I had caught
Anticipating future misinformation
Scott Tolinski
It's only the truth has been passed into this. Oh, I am not looking forward to the
Wes Bos
to save your replies.
Wes Bos
All of the COVID stuff and opinions that went flying in the last couple of years put those into your note application. So it's really easy to get up and running.
Wes Bos
the OpenAI And I was able to jump in, fix it. In 2 minutes, I had the thing fixed. Market has fixed in Century, and that's where you hope it doesn't come back. So you're going to check that out for your website. Check it out. Sentry. Io use coupon code tasty treat for 2 months free. Nice. I love being able to see that it's not affecting a lot of people. Like, oh, yes, they can. But I would only have, I think, 11 user. Okay, well, that's bad for that user, but at least it's not everybody. Yeah. Well, the flip side is when it And display none.
Wes Bos
And then people are like, I don't know, there's a lot that is going to hit us at that point in time. So, you you come up with this The chat AI because
Scott Tolinski
Yeah. Buckle up. It's all very heavy in a lot of those regards, but I don't know. You know, there's only so many ways we could say that. Another gotcha. And this is just the interesting thing is make some sort of function
Axios used in the API
Wes Bos
6 or $7. You know, like, it kind of gets expensive to play with. But
Wes Bos
I hadn't dipped into it for a while because So let's talk about the different API. So
Output length affects cost
Wes Bos
almost nothing like it's pretty much free.
Scott Tolinski
1 25 minute podcast, and it's it's gonna be super cheap for
Scott Tolinski
a 500 podcasts.
Wes Bos
But you do have to remember that the return value also. So maybe 3, maybe 4ยข by the time And then it would ask us future, Whisper will be able to do that, but there's also like, the I have tried this. Not Perspective.
Scott Tolinski
But if you have like a company
Most data sent to OpenAI is text
Wes Bos
the data sent Shoe Open AI is in the form of text. It also accepts images as well. We'll talk about that in a second, but most of it isn't in the terms of text. And you are paying based on how much text you send it and how much text is returned from you, and those are referred to as tokens.
Wes Bos
most of So I was like, okay, how much will that cost right now? So their most advanced models called Da Vinci.
Wes Bos
So let's talk about actually running it. The first thing you need to understand is that and coming back with the answer. So I often wonder, oh, I thought Who interviews potential candidates. You ask