How to Use GPT-4V With Next.js 14 | Text Streaming, Image Upload, and More!

  Рет қаралды 5,365

Cooper Codes

Cooper Codes

Күн бұрын

Enjoying my videos? Sign up for more content here: www.coopercodes.com/
📩 Join CodeLetter by Cooper Codes, the 3 minute tech newsletter: thecodeletter.com
Join the Cooper Codes Community: / discord (Weekly calls, free resources, tutoring, and more!)
In this video I use Next.js 14 and GPT-4V to analyze the image that a user uploads. This is a complete project, featuring streaming, image upload, API route creation, and even more features! If you’re looking for a starter project to start working with GPT-4V and Next.js 14, this video is exactly what you need. Throughout the tutorial I make sure to discuss each aspect of the process of using GPT-4V, allowing you to understand every single thing you need to know when it comes to using GPT-4V within your own Next.js 14 applications. This video should also be helpful for those familiar with GPT chatbots, and are interested in learning how to add GPT-4V to their existing workflows.
Final project: github.com/coopercodes/GPT4VW...
0:00 Introduction / Project showcase
1:31 Create Next.js 14 application
4:00 Create UI for image upload and AI response
9:15 Image upload functionality in Next.js 14
18:10 Create API route with Next.js 14 and OpenAI GPT-4V
26:10 Call GPT-4V from Next.js 14 (streaming response to user)
34:14 Final project, thanks for watching!

Пікірлер: 28
@devsirat
@devsirat 7 ай бұрын
I like how you always focus on the most important stuff instead of things like tailwind classes.
@CooperCodes
@CooperCodes 7 ай бұрын
Haha thank you. I have found that for teaching the core next.js / JavaScript functionality it helps to keep the UI simple.
@byteolu
@byteolu 7 ай бұрын
This was exactly what I needed! Great video!
@GoatLord_
@GoatLord_ 6 ай бұрын
Amazing content bro
@apoorvaraj3894
@apoorvaraj3894 Ай бұрын
You saved me Man. Really 😄. Thank you for the video and your work.
@likeGPT
@likeGPT 7 ай бұрын
Very great video. Thank you! I don't know much about useChat, how do I pass custom parameters defined on the front end to the api/chat interface?
@maskman4821
@maskman4821 7 ай бұрын
Great tutorial 😊😊
@CooperCodes
@CooperCodes 7 ай бұрын
Thank you so much :) glad you enjoyed!
@paulthomas1052
@paulthomas1052 7 ай бұрын
Great demo as usual. Thanks.
@CooperCodes
@CooperCodes 7 ай бұрын
Appreciate the comment as always :) glad you enjoyed
@paulthomas1052
@paulthomas1052 7 ай бұрын
@@CooperCodesNo probs - I've been digging about in Bun again ....any plans to do a Bun video ?
@deoarlo
@deoarlo 7 ай бұрын
Amazing tutorials as always, would love to see you cover the latest Assistant API.
@CooperCodes
@CooperCodes 7 ай бұрын
Thanks so much for the comment and support :), I'll check out the Assistant API. Any type of implementation in particular you'd be interested in seeing?
@deoarlo
@deoarlo 7 ай бұрын
@@CooperCodes An app which involves users creating their own chatbot for others to use would be great. With function calling involved.
@parkerrex
@parkerrex 7 ай бұрын
Just wrote the assistant api integration in swift. it's simple in web. Getting a chat to decide if it should reply to a query with the assistant using its tools versus gpt4-turbo versus reaching for an embedding would be a good video.@@CooperCodes
@diogos7233
@diogos7233 6 ай бұрын
Great video. Why did you use api routes instead of server actions? Would it be possible to build this app with server actions instead of api routes? I'm new to next js and this is what confuses me the most. Thanks for the video. Keep up the good work.
@Rajvirnahar
@Rajvirnahar 4 ай бұрын
Cooper, can we get a video where you loop dall e 3 and gpt 4 vision preview together so users can change or remove certain parts of the image they've uploaded while keeping everything else the same. and only what they type in the prompt of what they want changed changes
@Deus-lo-Vuilt
@Deus-lo-Vuilt 6 ай бұрын
I was just thinking if it's possible to make a video with Next 14 using supabase to pass the context to Openai
@shotbyviera
@shotbyviera 7 ай бұрын
nice!
@CooperCodes
@CooperCodes 7 ай бұрын
Thanks for the comment :)
@bradleywoolf3351
@bradleywoolf3351 5 ай бұрын
why do you need to use the 'use client' at the deepest level? can it not be inherited from parent components? why would be it better to be as narrow as possible with using it?
@likhikaroutray5575
@likhikaroutray5575 7 ай бұрын
great tutorial!! can this be used in supabse as i am trying to build a chat interface web app which fetch chat history on user authentication. Thank you!
@CooperCodes
@CooperCodes 7 ай бұрын
This can 100% be used alongside Supabase, but you would have to create some PostgreSQL tables in order to save chat history and things along those lines. Within the POST request made in this tutorial you can implement a supabase client to do any database / auth operations that you may need. Hopefully this helps! Thanks so much for watching :)
@tabletuser123
@tabletuser123 3 ай бұрын
fantastic vid but how do we deploy
@ungaria446
@ungaria446 6 ай бұрын
29:18
@marvellousadedapo8952
@marvellousadedapo8952 2 ай бұрын
I keep getting the error cannot find module "open-ai"
@andy111007
@andy111007 7 ай бұрын
I tried to run it and giving me an error, shared on the git repo
@CooperCodes
@CooperCodes 7 ай бұрын
Did you change the API key? It will not work just from cloning the repo if you do not replace the configuration with your own API key. github.com/coopercodes/GPT4VWithNextJS14ImageAnalysis/blob/20dde4b9702976204a9a699ff1d2849afe91451c/app/api/analyzeImage/route.ts#L7C17-L7C65 this link should bring you to the line.
La revancha 😱
00:55
Juan De Dios Pantoja 2
Рет қаралды 51 МЛН
Each found a feeling.#Short #Officer Rabbit #angel
00:17
兔子警官
Рет қаралды 7 МЛН
TRY NOT TO LAUGH 😂
00:56
Feinxy
Рет қаралды 13 МЛН
Climbing to 18M Subscribers 🎉
00:32
Matt Larose
Рет қаралды 24 МЛН
10 common mistakes with the Next.js App Router
20:37
Vercel
Рет қаралды 182 М.
Chatbot from scratch with Next, AI SDK, OpenAI, and Shadcn/UI
36:08
What tech I used to code my new startup in 2024
16:19
Anthony Sistilli
Рет қаралды 27 М.
Building a Spotify API Searcher in React
37:56
Cooper Codes
Рет қаралды 42 М.
My ChatGPT 4 Workflow & Tips as a Software Engineer
4:52
Marko
Рет қаралды 627 М.
Introduction To Svelte Runes (Every Svelte Rune Explained)
12:36
Cooper Codes
Рет қаралды 3,6 М.
Building Generative UI with Next.js (Jared Palmer)
13:16
Vercel
Рет қаралды 10 М.
Build SaaS Boilerplate with Next.js, Supabase, React-Query, Stripe, Shadcn
2:21:38
The Truth about Rust/WebAssembly Performance
29:47
Greg Johnston
Рет қаралды 171 М.
ВЫ ЧЕ СДЕЛАЛИ С iOS 18?
22:40
Overtake lab
Рет қаралды 118 М.
5 НЕЛЕГАЛЬНЫХ гаджетов, за которые вас посадят
0:59
Кибер Андерсон
Рет қаралды 1,6 МЛН
i love you subscriber ♥️ #iphone #iphonefold #shortvideo
0:14
Si pamerR
Рет қаралды 3,1 МЛН
iPhone 15 Pro vs Samsung s24🤣 #shorts
0:10
Tech Tonics
Рет қаралды 13 МЛН
📦Он вам не медведь! Обзор FlyingBear S1
18:26
i like you subscriber ♥️♥️ #trending #iphone #apple #iphonefold
0:14