LangChain 101: Working With The New ChatGPT API

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ย. 2024

ความคิดเห็น • 48

  • @henkhbit5748
    @henkhbit5748 ปีที่แล้ว +1

    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.

  • @nattapongthanngam7216
    @nattapongthanngam7216 4 หลายเดือนก่อน

    Great tutorial!

  • @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.

  • @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.

  • @caiyu538
    @caiyu538 ปีที่แล้ว

    great, great, great

  • @YugKhatri-ht8kd
    @YugKhatri-ht8kd ปีที่แล้ว +1

    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?

  • @catyung1094
    @catyung1094 ปีที่แล้ว +1

    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

  • @adriancaor
    @adriancaor ปีที่แล้ว +3

    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.

  • @sysadmin9396
    @sysadmin9396 ปีที่แล้ว

    What would be the difference of using “batch messages” vs “templates” ?

  • @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

  • @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.

  • @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.

  • @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

  • @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

  • @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 TH-cam 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

  • @user-wr4yl7tx3w
    @user-wr4yl7tx3w ปีที่แล้ว +1

    What is the purpose of streaming?

    • @DataIndependent
      @DataIndependent  ปีที่แล้ว +1

      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

  • @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  ปีที่แล้ว +1

      Oh ya - big time. You could do that through prompt templates or a variety of other ways.
      Check out langchain documentation for more

  • @RealEstate3D
    @RealEstate3D ปีที่แล้ว

    I cant imagine “Bacon and shrimp Sauerkraut“ as German food though.

  • @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?

  • @user-uf5un3kd5p
    @user-uf5un3kd5p ปีที่แล้ว

    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

    • @user-uf5un3kd5p
      @user-uf5un3kd5p ปีที่แล้ว

      @@DataIndependent "role": "system" not able to define system role as per the documentation

  • @larrysankey6976
    @larrysankey6976 ปีที่แล้ว

    My comments keep disappearing.

    • @DataIndependent
      @DataIndependent  ปีที่แล้ว +1

      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  ปีที่แล้ว +1

      @@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!