Тёмный
No video :(

How to create ChatGPT with Langchain OpenAI Nextjs Javascript 

tylerwhatsgood
Подписаться 2,5 тыс.
Просмотров 4,7 тыс.
50% 1

In this video we will create a chatbot that uses Nextjs and Langchain #ai #chatgpt #langchain
- 👉Looking for a Hosted AI Chatbot 👉 chatterdocs.ai/?via=tyler

Опубликовано:

 

4 апр 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 28   
@tylerwhatsgood
@tylerwhatsgood Год назад
hi everyone! there will likely be an update video where I try to do this with Route Handlers and Edge Functions in Vercel. in the interim here is the repo so you can try the current implementation. REPO 👉 github.com/linuxandchill/langchat
@tylerwhatsgood
@tylerwhatsgood Год назад
Updated! You should now be able to deploy this to Vercel and tokens should be streamed when AI replies
@ivanezquerra8902
@ivanezquerra8902 Год назад
@@tylerwhatsgood thanks for the video tyler! I'm using typescript and req.json() throws an error 'property 'json' does not exist on type 'NextApiRequest'.' Do you know a workaround? (:
@tylerwhatsgood
@tylerwhatsgood Год назад
@@ivanezquerra8902 hmmm what is your nextjs version? it might something to do with bodyParser but not really sure. can you please throw your api route in a gist so i can take a look? thanks Ivan!
@ivanezquerra8902
@ivanezquerra8902 Год назад
thanks for your reply@@tylerwhatsgood ! Yes, it was to do with bodyParser and running an edge function. the solution was simple in the end, this is how the code looks: const handler = async (req: any) => { const body = await req.json() .... thanks again for the video! Based on it, I've made a harm reduction bot with a specialised database on psychoactive substances for health workers
@DePhpBug
@DePhpBug 7 месяцев назад
glad this clips promoted by RU-vid to me ,wee ~
@philamavikane9423
@philamavikane9423 Год назад
Hey Tyler, thanks for the awesome video. There are some of us in the universe trying to figure things out, thank you for helping make sense of it all
@tylerwhatsgood
@tylerwhatsgood Год назад
thanks for the kind words Phila! glad i was able to be a little helpful, will keep em coming! thanks again
@haodongruan3958
@haodongruan3958 Год назад
those videos deserve more watch
@tylerwhatsgood
@tylerwhatsgood Год назад
thank you !
@leotrieu84
@leotrieu84 Год назад
Love your videos, Tyler. Did you use Loom to record the videos? I was struggling to find the right software for that :(
@tylerwhatsgood
@tylerwhatsgood Год назад
Hey Lee! I think this was Look but I’ve since switched to OBS and set everything up, it’s a lot better IMO and free!
@aoeargentina915
@aoeargentina915 Год назад
hey! great video! Thanks a lot! do you have a second part were you add the memory ?
@aoeargentina915
@aoeargentina915 Год назад
I download your repo but I have not been able to achieve it 🥲
@nelohenriq
@nelohenriq 5 месяцев назад
What if I want to use ollama or huggingface models instead of openai?
@tylerwhatsgood
@tylerwhatsgood 5 месяцев назад
hey! sorry for late reply. check this out and lmk if this work js.langchain.com/docs/integrations/llms/ollama I have some python examples in this video that would use Ollama or HF ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-U_Sg3Odf1vk.html at 05:06 It is in python but if you search the `javascript langchain` docs u should be able to find a way to do the same in js! lmk if u cant figure out i will try to help. thank u!!
@reyco1
@reyco1 Год назад
How do you know how many openai tokens have been used per session or interaction? I would love to keep track of that in case we need to charge users for a paid app.
@tylerwhatsgood
@tylerwhatsgood Год назад
Hey Reynaldo, I have not tried it but what about this pkg npx @ai-assist/openai-apilyzer community.openai.com/t/use-cli-to-batch-download-the-usage-data-of-openai-api/127734
@reyco1
@reyco1 Год назад
@@tylerwhatsgood But Open already returns that as part of their response.... its just not returned in the reponse sent by LangChain 😕
@tylerwhatsgood
@tylerwhatsgood Год назад
ok i see,, how about here python.langchain.com/en/latest/modules/models/llms/examples/token_usage_tracking.html?highlight=get_openai_callback
@SebastianBergeNorge
@SebastianBergeNorge Год назад
Hey, what is the reason for not using the App directory?
@tylerwhatsgood
@tylerwhatsgood Год назад
sorry for late response! this video is a bit older and i didn't really need the new folder structure for anything special (i think it was still under heavy dev also) but i will probably start all new Nextjs projects with it just to get used to it. how are you liking it?
@PmartN
@PmartN Год назад
Am getting OPENAI_API_KEY is not defined, am using GPT 3.5 any ideas?
@tylerwhatsgood
@tylerwhatsgood Год назад
hey ! did you save the key from OpenAI in the .env.local file? make sure you restart the server once you add that file or it won't get picked up. let me know if youre still having issues after trying that, thanks!!
@PmartN
@PmartN Год назад
@@tylerwhatsgood Thanks, so in theory it would be something like create .env.local file then inside put a export const OPEN_AI_KEY = 'personal ai key here'?
@tylerwhatsgood
@tylerwhatsgood Год назад
@@PmartN if you are following the video and did it in a NextJS project then it would just be OPEN_AI_KEY=examplekey123 (export cons const). if it is not a Nextjs project might be a bit different, can you tell me a bit more about the project?
@PmartN
@PmartN Год назад
@@tylerwhatsgood it was cloned from repo
@tylerwhatsgood
@tylerwhatsgood Год назад
@@PmartN ok gotcha, in that case it's just OPEN_AI_KEY=examplekey123, no export const as it's not a js or ts file. hope u got it worked out! lmk if still need help
Далее
NOOOO 😂😂😂
00:14
Просмотров 4,2 млн
skibidi toilet 77 (part 1)
03:51
Просмотров 14 млн
OpenAI Embeddings and Vector Databases Crash Course
18:41
Build an AI RAG Application with LangChain & Next.js
33:34
ChatGPT for YOUR OWN PDF files with LangChain
14:20
Просмотров 267 тыс.