LangChain 🦜️ - COMPLETE TUTORIAL - Basics to advanced concept!

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ต.ค. 2024

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

  • @codingcrashcourses8533
    @codingcrashcourses8533  3 หลายเดือนก่อน

    UPDATE: PLEASE USE THE UPDATED (2024) VERSION OF THIS COURSE: th-cam.com/video/-maRNgjEvLU/w-d-xo.html

  • @AdrianMark
    @AdrianMark ปีที่แล้ว +6

    This channel is a real gem. Excellent teaching style, and the tutorials are concise yet filled with a treasure trove of information and application. Thank you for making these, and I hope you will continue to explore AI with us. Will definitely look forward for your first masterclass.

  • @azizultex
    @azizultex ปีที่แล้ว +7

    Best Langchain video I have ever watched. 🎉

  • @anikcabidenov9802
    @anikcabidenov9802 ปีที่แล้ว +13

    Exactly what i was looking for! Awesome job. Keep going on 🎉

  • @mjmtaiwan
    @mjmtaiwan ปีที่แล้ว +4

    That was a lot of work. Thank you for making this very enlightening video.

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

      For me or for you? ;-). Great you liked it, thank you for your comment

  • @otimistarj
    @otimistarj 3 หลายเดือนก่อน

    Excellent information, very helpful

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

    Good Stuff- Explanation is great!

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

    Thank you so much for sharing your knowledge and expertise.

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

    answers all my doubts, great job sir!!

  • @RipNonoRasta
    @RipNonoRasta 7 หลายเดือนก่อน

    Really helpful your videos ❤!! I would like to add in min 11:10, if you are getting this warning 'LangChainDeprecationWarning: The function `__call__` was deprecated in LangChain 0.1.7 and will be removed in 0.2.0. Use invoke instead. ' change the line --> response = chat(messages) by --> response = chat.invoke(messages) :)

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

    Thanks for bringing so much value!

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

    Are you a Web Developer and more interested in JavaScript? Check out my LangChainJS Course: th-cam.com/video/mAYS4d0hrek/w-d-xo.html

  • @MH-zk3yd
    @MH-zk3yd ปีที่แล้ว

    Awesome explanations!

  • @canerakca7915
    @canerakca7915 ปีที่แล้ว +4

    This is awesome thank! I wonder how to add recent announced function calling functionality in our project, since it makes much more easier to work with structured json objects.

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

      I already worked with them - they are quite of a big deal. I uploaded a Video with the basics: th-cam.com/video/vJot6WCUlGE/w-d-xo.html .

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

    Its a very good video to understand langchain.

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

    That was excellent.Thank you!

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

    This was so helpful. Thank you!

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

    Great job!

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

    Great video! Keep up the good work!

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

    Excellent instruction. How would you approach getting SEO keywords from a blog article using LangChain? Perhaps make a video about how that would be done.

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

      Should that be Dynamic? Website scraping can be quite difficult because of Client side rendered js frameworks.

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

      @@codingcrashcourses8533 I believe there a libraries that mimick a browser to first render the page then get the page content. I kinda have that figured out in my mind but I'm just not sure how one would architect the flow using LangChain. Do I need to use Agents, the new OpenAI function calling feature, or something else which Chaining could handle alone. I'm too new to LangChain to wrap my head around a basic programmatic workflow for this use case using LangChain.

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

      @@StephenPasco yeah, the content will still be highly dynamic. Not easy

  • @codingcrashcourses8533
    @codingcrashcourses8533  11 หลายเดือนก่อน +1

    Sign up for my complete LangChain course: www.udemy.com/course/langchain-in-action-develop-llm-powered-applications/?couponCode=557BD137E003DD93E491

  • @PedroSotomayor-lh4fp
    @PedroSotomayor-lh4fp ปีที่แล้ว +2

    Amazing video! I have one question. In the Index part of the video, you go ahead and create the prompt_template with two arguments, 'question' and 'context'. But then, you didn't specify the 'question' and 'context values', so I think your query is not taking into consideration your template.
    To verify it, I added in the prompt 'In all your answers, start them by saying "Dear Pedro" ' and it didn't follow the instructions.
    I'm looking for ways in which to combine PromptTemplate and Embeddings, to be able to give the model a prompt and at the same time using data from .txt files

    • @codingcrashcourses8533
      @codingcrashcourses8533  ปีที่แล้ว +2

      The High Level chains like RetrievelQAChain handles that for you. Context is used under the hood, but you as "user" of that chain only have to use "question". Forget to provide "context" in your template and you will see an error. For some chains it´s a little bit tricky to pass the template to the RetrievelChain.

  • @Ahmed-n9m1o
    @Ahmed-n9m1o ปีที่แล้ว

    Thank you sooooo much!!!

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

    Nice! Can you run the notebooks on google colab as is, or are modification needed?

  • @MMO-g2w
    @MMO-g2w 6 หลายเดือนก่อน

    marcus!! are u going to make a 2024 version of this with the LCEL and updated things?
    A hug from spain!

    • @codingcrashcourses8533
      @codingcrashcourses8533  6 หลายเดือนก่อน

      Yes, a version is planned. I´ll be honest: I will release a Udemy couse and release the new crashcourse at the same time to get some traffic from the updated Crashcourse. Will be finished probably in ~6-7 weeks.

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

    Thanks dude!

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

    great video thank you

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

    Great job

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

    thanks for the free key! 😉

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

    Great video and explanations.............................:) bye

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

    What modifications are needed to run against another LLM models, like those on hugging face?

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

      python.langchain.com/docs/modules/model_io/models/llms/integrations/huggingface_hub
      You need to load models differently, that´s pretty much it

    • @HarishM-m1v
      @HarishM-m1v ปีที่แล้ว

      ​@@codingcrashcourses8533
      Is this approach fits for chatOpenAI also? At 39:11

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

    Should I fill OpenAI balance to activate OpenAI Key? Or is it working free?

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

      I would recommend to Set a rate limit. The 3.5 turbo model is very cheap

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

    Bomben Video! What about a locally running opensource LLM? Would be a Gamechanger for German companies especially in finance since the burdens and regulations are very strict

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

      I tried multiple open source LLMs. I have not seen a single one that comes closes to what OpenAI offers. The problem is that GPT performance is expected when you introduce a service with an LLM.
      I work in finance in germany and our solution is currently not to use critical information from users and use a private endpoint on azure.

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

      Ich bin prozessmanager (nicht IT) bei einem deutschen Versicherer und bin genau an diesem Thema dran. Azure kam ich irgendwie nicht zurecht. Würde mich zu gern mit dir darüber austauschen - oder du machst dazu auch ein Tutorial😃

    • @codingcrashcourses8533
      @codingcrashcourses8533  ปีที่แล้ว +2

      @@monkeyy992 Azure müsste dein Unternehmen schon im größeren Stil einbinden. Bei diesem Thema passiert auf Infrastrukturseite bei uns sehr viel, wo ich allerdings nicht genau weiß, was alles geprüft wird. Firewalls und der Ganze Kram eben. Groß austauschen kann ich mich da nicht, mehr als das was ich gesagt habe, kann ich da nicht als Info weitergeben.
      Es gibt noch einen deutschen Anbieter für LLMs, aleph alpha oder so ähnlich, vielleicht wäre das ja eine Alternative. Ich halte nicht viel davon Modelle selbst zu hosten, das ist erstens ganz schön teuer und bei der Geschwindigkeit aktuell hat man ruck-zuck eine veraltete Technologie am Bein.

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

      @@codingcrashcourses8533 danke dir fürs Feedback!

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

    appreciated but allot of these modules are outdated which is very frustrating. Is the code from your course updated to the latest ? e.g.: openai.ChatCompletion is replaced with the Python API.

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

      I will release a 2024 Version in a few Weeks:)

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

      @@codingcrashcourses8533 alright, keep us updated!

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

    I love you bro

  • @karthikb.s.k.4486
    @karthikb.s.k.4486 ปีที่แล้ว

    Nice tutorial what theme is used for VS code

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

    Excellent... however, if I can add, I think you are not using the latest langchain version ?
    Just a minor thing really, I think the imports are different.

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

      can you tell me what exactly does not work? Since the langchain version almost changes every day, I probably did not use the latest one. I used 0.0.190 for the video.

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

      @@codingcrashcourses8533 sure, so for example when i run the code in the notebook called models_prompts_parsers I get the following error:
      type object 'ChatPromptTemplate' has no attribute 'from_template'
      I checked the latest documentation and indeed it doesn't have that attribute/method

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

      @@ldandco i had that Problem when i used an old Version. Can you Tell me your Version you are using? The latest one definately has got this classmethod

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

      @@codingcrashcourses8533 I used a new kernel in the notebook, and it now worked. So, perhaps something that was cached, i am still not completely sure. But it works. thanks

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

      @@ldandco great :)

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

    Does langchain have caching? What if the same questions are asked by users of the bot?

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

      python.langchain.com/docs/modules/model_io/models/llms/llm_caching
      Take a look at that. Have ot used it yet :)

  • @savire.ergheiz
    @savire.ergheiz ปีที่แล้ว

    Problem will always be the tokens usage. Even though its already reduced by a lot but it will still sending it to openAI API in full blown so it will use your token credits fast depending on how big your embedded data are.

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

      I think its quite cheap, I never used more than 3$ for the API. But you can also use an open source modell from Huggingface. In another video I show how to use the falcon-7b model

    • @savire.ergheiz
      @savire.ergheiz ปีที่แล้ว

      @@codingcrashcourses8533 The oss version are garbage even cgpt 4 still garbage if we dont know how to properly used it 😁
      I'm not talking about personal usages here but in a more professional way. cgpt took quite a long time to produce result too albeit its a paid product, the performance are awful right now.

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

    Thank you for this video but I don't get what is the difference between the .predict and .run methods , can you please explain?

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

      It is normally doing the same, one might even call the other. I recommend looking in the source Code for getting a deeper understanding

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

    31:00 Why we don't need to pass parameter in the "context" variable, how does the qa object knows our query goes into "question" variables?

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

      thats handles by Langchain under the hood with these high level chains

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

    Your video is good; however, I am quite confused about the output_parser, as you did not explain the uses of the module, the method, or the overall logic behind it. I need to reread the documentation again."

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

    Does this require a paid subscription? I'm asking because I am new to using langchain, and I tried using my own text file as a custom dataset to asks questions on, but when I got it to run after fixing all dependency errors, it showed rate limit exceeded, but I am using an API key from a new account with the very first key. Would be great if anyone could point out what I am getting wrong?

    • @codingcrashcourses8533
      @codingcrashcourses8533  ปีที่แล้ว +2

      You need an OpenAI Account, which has nothing to do with the ChatGPTPlus Subsscription. Without the subscription to OpenAI, you can not use an API Key

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

      @@codingcrashcourses8533 I see, so what you're saying is - create an open ai account, go to profile section, get a secret key(api key), and the key should work. Right?

    • @codingcrashcourses8533
      @codingcrashcourses8533  ปีที่แล้ว +2

      @@mriganktiwari3782 yep :)

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

      @@codingcrashcourses8533 Yeah that is how I expect it to work as well. But for some reason I am hitting a rate limit exceeded error... :(

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

      @@mriganktiwari3782 same with me . Did you find any solution?

  • @otimistarj
    @otimistarj 3 หลายเดือนก่อน

    minute 2: it needs atualization
    from openai import OpenAI
    client = OpenAI(api_key=api_key)
    def chat(input):
    response = client.chat.completions.create(
    model="gpt-3.5-turbo",
    messages = [{"role": "user", "content": input}],
    temperature = 0.7,
    max_tokens = 256,
    top_p = 1
    )
    print(dict(response).get('usage'))
    return response.choices[0].message.content

  • @ZhannaOrlova-t8c
    @ZhannaOrlova-t8c หลายเดือนก่อน

    can you teach onion architecture in python with OOP?

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

    I have OpenAI to generate SQL query which can take Mysql schema as a prompt. How can i leverage Langchain in this use case. Can you please help me on this.

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

      I prefer a new apporach. Use functions and make requests via a dedicated REST Service. my experience with letting the AI create queries was pretty aweful. You can try an SQL Agent from Langchain to test that yourself

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

      If possible can u please architecture for this SQL Agent from langchain

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

      @@arunakumari71795 my recommendation is to use something easier to control and also more reliable

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

      @@codingcrashcourses8533
      So, you said you prefer a new apporach. Use functions and make requests via a dedicated REST Service. How to do this for my usecase or please suggest. because with OPEN AI facing token limit issue, sql query syntax error when openai generates sql query, and random SQL query generated with different outputs and also due to token limit, not able to generate chart for the report

  • @joxa6119
    @joxa6119 9 หลายเดือนก่อน

    Issues while using RetrievalQA
    ```
    ValidationError: 2 validation errors for RetrievalQA
    retriever
    field required (type=value_error.missing)
    retriver
    extra fields not permitted (type=value_error.extra)
    ```

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

    Can we change ConversationChain's system role?

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

      python.langchain.com/docs/modules/memory/how_to/conversational_customization
      I would have to look at the implementation details, but probably yes. You can use a custom prompt and I assume under the hood Langhchain converts that into a System Message

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

    Why you call the LLM = chat OpenAI(temperature 0.0) without referring to any model (like gpt3.5)? It is not clear to me.

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

    Hey a Langchain JS tutorial by any chance?

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

      Since I am currently working on that, yes, 100% ;-). Gonna release it next weekend

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

    As a beginner in GitHub I did not understand how to download your book

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

      just run: git clone github.com/Coding-Crashkurse/Langchain-Full-Course.git inside a terminal (make sure git is installed!)
      Then you will create a new directory Langchain-Full-Course. Inside this folder you will find all notebooks. I would recommend using Visual Studio Code to work with them, but plain Jupyter will also do the job :-)

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

      @@codingcrashcourses8533 thank you very much. Will try. Hope to manage 🙂😉

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

      @@acap2025 if it does not work, you can of course ask follow up questions

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

    what skills and language i have to know first before getting into langchain

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

      Python or JavaScript, since these two languages are supported. You should have intermedia knowledge with the language itself and also have some understanding about language models ifself.

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

      @@codingcrashcourses8533 thanks

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

      @@codingcrashcourses8533 is this langchain the future? Should one really get into this field? Cuz Im a web developer too,will it help me in this?

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

      @@powerball200 LLMs are the future for sure. LangChain maybe, but that is just a wrapper to work with LLMs. Go for it if you are interested ;-)

  • @dglopes
    @dglopes 8 หลายเดือนก่อน

    You're just made comments about the langchain notebooks....

  • @ButchCassidyAndSundanceKid
    @ButchCassidyAndSundanceKid 8 หลายเดือนก่อน +1

    The ChatGPT API keys are not free.

    • @codingcrashcourses8533
      @codingcrashcourses8533  8 หลายเดือนก่อน

      Where did I say that the openai api is for free?

    • @ButchCassidyAndSundanceKid
      @ButchCassidyAndSundanceKid 8 หลายเดือนก่อน

      @@codingcrashcourses8533 If you read what I wrote. It's a statement, not a question.

  • @TF-qt3jh
    @TF-qt3jh ปีที่แล้ว +3

    Thank you 🙏 so much for your super comprehensive and massively detailed tutorial. I can’t believe this is free.
    Knowing you are an expert in this area, I have a quick question for you, and I’d appreciate it if you could give your advice on it.
    I’m a non-tech founder with good amount of conceptual knowledge about Python, LangChain, and other relevant approaches, frameworks and tools.
    I’ve been trying to develop a market research app similar to but more complex than this (th-cam.com/video/zP8JUbyCUk0/w-d-xo.html). If I just think about its mechanics, I.e., data flow, building it doesn’t seem awfully difficult. But the engineer I hired and others I was going to hire have trouble in coming up with practical development/design plan, let alone, building it.
    Do you think the development of something like mine is a pipe dream? Or am I searching engineers in wrong places?
    Thank you for reading this lengthy message. ❤

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

    Good video, a bit too much content and little context. Huge subject and limited time.

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

      yes. I will also create a project based course in the next few days :)

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

    thanks for the video! I tried to execute the prompt template in the model_prompts_parsers but it return error. Can you help me on this? thank you
    ---------------------------------------------------------------------------
    AttributeError Traceback (most recent call last)
    Cell In[10], line 3
    1 from langchain.prompts import ChatPromptTemplate
    ----> 3 prompt_template = ChatPromptTemplate.from_template(template=template)
    4 chain = LLMChain(llm=llm, prompt=prompt_template)
    5 chain.predict(input="I ordered Pizza Salami and it was awesome!")
    AttributeError: type object 'ChatPromptTemplate' has no attribute 'from_template'

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

      I am pretty sure you use an old version of langchain. Update it to a new version. from_template came at ~0.0.190 or so. pip install --upgrade langchain. Should solve that problem

    • @0xgenji
      @0xgenji ปีที่แล้ว

      Thanks for the input. I Already upgraded langchain version ro 0.0.206 but oddly still give me the same error..

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

      @@0xgenji Maybe you use the wrong environment?
      import pkg_resources
      def print_version(package_name):
      try:
      version = pkg_resources.get_distribution(package_name).version
      print(f"The version of the {package_name} library is {version}.")
      except pkg_resources.DistributionNotFound:
      print(f"The {package_name} library is not installed.")
      print_version("langchain")
      try checking the result or what code