LangChain 101: Working With The New ChatGPT API

  Рет қаралды 19,750

Greg Kamradt (Data Indy)

Greg Kamradt (Data Indy)

Күн бұрын

Пікірлер: 48
@YugKhatri-ht8kd
@YugKhatri-ht8kd Жыл бұрын
How's LangChain's ChatGPT API or model whatever you called is different from using simple Chat API from openAI? like if i use LC's model/API than it will use less tokens or what?
@ilovenaturesound5123
@ilovenaturesound5123 Жыл бұрын
What’s the benefit of using LangChain’s openAi wrapper over the OpenAI itself? It looks like the OpenAI can achieve everything the wrapper does anyway. Please correct me if I’m wrong.
@henkhbit5748
@henkhbit5748 Жыл бұрын
Great intro to the new Chatgpt api 👍 Langchanin is really versatile and quick in responding new developments in LLM. Love to see new videos about LangChain and the new chatgpt api.
@DataIndependent
@DataIndependent Жыл бұрын
Nice, glad to hear it.
@junaidmughal3806
@junaidmughal3806 Жыл бұрын
nice subtle lo-fi music in the background.
@DataIndependent
@DataIndependent Жыл бұрын
I had a bunch of users say it didn't sound good when they sped up the video so I removed it from current videos.
@nattapongthanngam7216
@nattapongthanngam7216 6 ай бұрын
Great tutorial!
@adriancaor
@adriancaor Жыл бұрын
Does it work well with vectorstore? Like pinecone?
@DataIndependent
@DataIndependent Жыл бұрын
Pinecone is just used as a tool to get relevant documents and text. So you can grab that text independent from this process and use it how you'd like. I'm sure there will be more first class support in the future.
@adriancaor
@adriancaor Жыл бұрын
@@DataIndependent Makes sense, I have been using "VectorDBQAWithSourcesChain" so far but without OpenAIChat; I guess, as you say, it will be in the langchain roadmap to include first-class support to this kind of chains for OpenAIChat. Thank you for your reply.
@chriszuidema
@chriszuidema Жыл бұрын
Quote of the day @ 6:07 : "The moon is not out, yep, that's interesting!". Not sure why, but I started laughing like crazy haha! Great vids about LangChain btw, I learned a ton going trough them. Much appreciated!!
@DataIndependent
@DataIndependent Жыл бұрын
Ha glad they’re helpful! One day I’ll do more editing.
@shaunpx1
@shaunpx1 Жыл бұрын
love your video series', id like to know of you think it is possible to set template where a user can answer a series of limited questions. where we can step the persesion of user messages based on a countdown loop. say if the user says" I have 5 people joining me sessions' got can the use a template to get the name and email of each user separately, user 1 user 1 email, then loop back to get user 2 and user2 email... and so on and know to stop at 5 since that was the initial prompt?
@DataIndependent
@DataIndependent Жыл бұрын
Hm, that is a good example and very sound. I haven't seen a best practice to do that yet. You could of course do it hardcoded, but then it would be flexible to other situations
@catyung1094
@catyung1094 Жыл бұрын
Love the video, but also curious to know why the : messages = [ SystemMessage(content="Say the opposite of what the user says"), HumanMessage(content="I love programming."), AIMessage(content='I hate programming.'), HumanMessage(content="What is the first thing that I said?") ] chat(messages) The output is not following the SystemMessage , it should output the opposite, instead of AIMessage(content='You said, "I love programming."', additional_kwargs={})? Does it means we should specify the SystemMessage everytime before the HumanMessage ?
@DataIndependent
@DataIndependent Жыл бұрын
It's still a bit of an unknown territory from what I can tell. Everyone is trying to figure out the best way to use this new functionality. I believe that if I would have worded the System Message even *stronger* then it might have obeyed. But as it's written right now it's a loose command. I bet there is some prompt engineering to make it more strict on responses.
@henkhbit5748
@henkhbit5748 Жыл бұрын
I think the answer is correct if u look at the chat history list. The chat history: 1 I love programming, 2. I hate programming, 3.What is the first thing that I said...ergo first sentence is I love programming.
@juhu3709
@juhu3709 Жыл бұрын
I was wondering the same thing
@sysadmin9396
@sysadmin9396 Жыл бұрын
What would be the difference of using “batch messages” vs “templates” ?
@ddd12343
@ddd12343 Жыл бұрын
In the documentation there is section about "Memory" and there are examples there of how to build knowledge graphs (ConversationKGMemory), but all examples seem to be using this old "text in text out" approach. Can I somehow use this class also with ChatGPT API in this conversation based manner?
@DataIndependent
@DataIndependent Жыл бұрын
Thanks for the comment and yes you can do it with memory. I'll add that to the video list
@albus-hc
@albus-hc Жыл бұрын
Can we combain this API with a custom dataset yet? (i.e. upload my documents, make API Call questions about that data)
@DataIndependent
@DataIndependent Жыл бұрын
Oh ya - big time. You could do that through prompt templates or a variety of other ways. Check out langchain documentation for more
@THCV4
@THCV4 Жыл бұрын
Are you intentionally spelling “incorporate” as “incorportate” for some reason (like an AI optimization or something)? I’ve noticed a pattern of oddly misspelled words with a lot of AI KZbin videos lately and I’m curious… P.S. Thanks for putting together this video and sharing the information!
@DataIndependent
@DataIndependent Жыл бұрын
Nice! Whoops, no. That's an interesting side effect of LLMs. Just updated the code on the github
@caiyu538
@caiyu538 Жыл бұрын
great, great, great
@berkkilicoglu6587
@berkkilicoglu6587 Жыл бұрын
I have one related question on Embeddings. So every time a user asks the bot a question, the bot searches the knowledgebase and answers. the following use case impossible: USER: How can I register for starter training ? BOT: If you meet all the conditions, you can register from the link … USER: What does it cost ? BOT: I dont know. how can i deal with this problem.Since the user specified the course name in the previous question, but not in this question, there will be no match from the knowledgebase. How can I search while keeping the context from the previous question?
@DataIndependent
@DataIndependent Жыл бұрын
That is a great question. There was a bunch of talk about it on the Q&A webinar today. Check out the langchain twitter and see if you can snag the recording. The answer was on there.
@user-wr4yl7tx3w
@user-wr4yl7tx3w Жыл бұрын
What is the purpose of streaming?
@DataIndependent
@DataIndependent Жыл бұрын
Other than UX I'm not sure yet. It certainly makes the app feel more special and alive.
@bartzhang4798
@bartzhang4798 Жыл бұрын
Reduces the appearance of latency by returning a response token by token
@AITwo_co
@AITwo_co Жыл бұрын
Can you create a video on explanation of visual ChatGPT?
@DataIndependent
@DataIndependent Жыл бұрын
You mean using the image recognition functionality? I don't have access to that yet, I don't think anyone does outside of researched and a closed beta
@DhananjayMudgule-f4g
@DhananjayMudgule-f4g Жыл бұрын
can I use : agent with this NEW chat GPT API with serpapi as tool ??? How?? llm = OpenAI(temperature=0,openai_api_key=open_ai_api_key) tools = load_tools(["serpapi"],llm=llm,serpapi_api_key=serp_api_key) memory = ConversationBufferMemory(memory_key="chat_history") agent_chain = initialize_agent(tools, chat, agent="conversational-react-description", verbose=True, memory=memory) with this NEW chat GPT API ...????? If YES --- How..???
@DataIndependent
@DataIndependent Жыл бұрын
You totally could, check out the langchain documentation for agents in the new chat api
@DhananjayMudgule-f4g
@DhananjayMudgule-f4g Жыл бұрын
@@DataIndependent "role": "system" not able to define system role as per the documentation
@khairulhaaziq2332
@khairulhaaziq2332 Жыл бұрын
Hi greg! thank you for these videos, learnt aton! can you possible remake the langchain+pinecoin tutorial adapted with the new chatgpt api? how would you do it differently? maybe we dont need pinecone?
@DataIndependent
@DataIndependent Жыл бұрын
Nice! And you would definitely still need pinecone (or a different vectorstore) because of prompt limits. Ex: You can't feed a whole book into the new chatgpt api. I'll add this to the list of videos!
@khairulhaaziq2332
@khairulhaaziq2332 Жыл бұрын
@@DataIndependent I see.. so I guess there isnt any way to leverage the chatgpt api and better to just use the previous method?
@khairulhaaziq2332
@khairulhaaziq2332 Жыл бұрын
@@DataIndependent may I have a quick question? In the langchain function the params are the docs and the query, does that mean we run through the docs with openai api each time? because that would be very costly. or no? how does it work?
@juhu3709
@juhu3709 Жыл бұрын
@@DataIndependent I would be interested in that as well
@aaroldaaroldson708
@aaroldaaroldson708 Жыл бұрын
what’s wrong with just substituting the previous opeai class with the new chatopenai class?
@RealEstate3D
@RealEstate3D Жыл бұрын
I cant imagine “Bacon and shrimp Sauerkraut“ as German food though.
@larrysankey6976
@larrysankey6976 Жыл бұрын
My comments keep disappearing.
@DataIndependent
@DataIndependent Жыл бұрын
Really? Sorry to hear that, I don't know why. What's up?
@larrysankey6976
@larrysankey6976 Жыл бұрын
​@@DataIndependent I appreciate your videos. They really helped me understand langchain. I got through the ChatGPT API examples and am trying to figure out how to do agents and memory in the same configuration. There was something like that for the GPT-3 models. Can't figure it out for ChatGPT. Are there examples somewhere, or do you plan to cover it? Thanks!
@DataIndependent
@DataIndependent Жыл бұрын
@@larrysankey6976 It's so new that I haven't done the videos for it yet. I'll add it to the list
@larrysankey6976
@larrysankey6976 Жыл бұрын
@@DataIndependent Thanks!
OpenAI + LangChain Wrote Me 100 Custom Sales Emails
17:28
Greg Kamradt (Data Indy)
Рет қаралды 14 М.
Introduction to Generative AI
22:08
Google Cloud Tech
Рет қаралды 1,8 МЛН
А что бы ты сделал? @LimbLossBoss
00:17
История одного вокалиста
Рет қаралды 9 МЛН
小蚂蚁会选到什么呢!#火影忍者 #佐助 #家庭
00:47
火影忍者一家
Рет қаралды 113 МЛН
Smart Sigma Kid #funny #sigma
00:14
CRAZY GREAPA
Рет қаралды 11 МЛН
버블티로 부자 구별하는법4
00:11
진영민yeongmin
Рет қаралды 19 МЛН
The LangChain Cookbook - Beginner Guide To 7 Essential Concepts
38:11
Greg Kamradt (Data Indy)
Рет қаралды 344 М.
Connect OpenAI To +5,000 Tools (LangChain + Zapier)
10:01
Greg Kamradt (Data Indy)
Рет қаралды 26 М.
OpenAI Embeddings and Vector Databases Crash Course
18:41
Adrian Twarog
Рет қаралды 480 М.
Discover GPT-4o: The New Frontier of Multimodal AI!
11:18
TechyTricksAI
Рет қаралды 8 М.
5 Levels Of LLM Summarizing: Novice to Expert
19:19
Greg Kamradt (Data Indy)
Рет қаралды 53 М.
How To Use ChatGPT 4o - Easy Prompts to Get The Best Results
20:15
Unlimited AI Agents running locally with Ollama & AnythingLLM
15:21
Tim Carambat
Рет қаралды 143 М.
LangChain 101: YouTube Transcripts + OpenAI
11:08
Greg Kamradt (Data Indy)
Рет қаралды 24 М.
А что бы ты сделал? @LimbLossBoss
00:17
История одного вокалиста
Рет қаралды 9 МЛН