LangChain 101: Quickstart Guide

Sdílet
Vložit
  • čas přidán 23. 07. 2024
  • Twitter: / gregkamradt
    Newsletter: mail.gregkamradt.com/signup
    LangChain 101 Quickstart Guide. We run through 4 examples of how to use the LangChain Library
    View Code: github.com/gkamradt/langchain...
    Follow me on Twitter
    Personal: / gregkamradt
    * LLMs
    * Prompt Management
    * Memory
    * Agents
    For more information sign up for details at www.dataindependent.com

Komentáře • 172

  • @burakylmaz9973
    @burakylmaz9973 Před rokem +77

    Hi Greg, I'm diving deep into all your lang-chain related videos today and wanted to say 'thank you' for putting these out there.

    • @DataIndependent
      @DataIndependent  Před rokem +4

      Awesome, thank you!

    • @struki84
      @struki84 Před rokem +4

      yep and also it's split into manageable time formats, not a 90 min lecture :D

    • @Amr-Ibrahim-AI
      @Amr-Ibrahim-AI Před rokem

      Same here. I am watching the full playlist and I am grateful to you Greg. Thank you so much.

  • @martinp3839
    @martinp3839 Před 11 měsíci

    I am so glad I stumbled across your channel. You have a gift of explaining things and not skipping the basic steps especially for beginners. Thanks!

  • @zwdavezhang6408
    @zwdavezhang6408 Před rokem +1

    Thank you for your teaching, I started to understand LangChain from this, I also compiled some notes to share with my partners, these introductory courses will give us the opportunity to open the future world.
    Thank you very much!

  • @AngusLou
    @AngusLou Před rokem +4

    Short and sweet, clearly explained the concepts of langchain and how it works with OpenAI

  • @adhithia
    @adhithia Před 8 měsíci +1

    Hey Greg, I am just entering the world of LangChain, and it is mind blowing! What's more mind blowing is the simple but effectively explained content you have in your videos! This is beautiful! A big thanks! ✨

  • @LesCalvin3
    @LesCalvin3 Před rokem +10

    I'm fairly lost, because I've thrown myself into the deep end with this stuff. But when you got to "Dynamically call chains..." Holy moly. I'm blown away.
    I really hope videos like this can help me get up to speed before I get left behind. Thank you so much. 🙏

    • @DataIndependent
      @DataIndependent  Před rokem +3

      Nice! I'm glad to hear it.
      Check out my latest video on the 7 core concepts of LangChain which I think will help

  • @RunyCalmera
    @RunyCalmera Před rokem

    Greg!!! ❤❤❤❤❤ thank you so much!!
    I just put 3 months away to follow this series. Every day I will do one tutorial.
    I’m conviced that I need to invest in this as a python programmer!!!

  • @nattapongthanngam7216
    @nattapongthanngam7216 Před 3 měsíci

    Thank you for this clear and concise introduction to LangChain! The four examples you provided were very helpful in understanding how to use the library. I'm excited to explore LangChain further and I'm excited to keep going through your playlist. Thanks again!

  • @feignedjesse2
    @feignedjesse2 Před rokem

    This introduction is great, I'm gonna go through the whole series!

  • @OfficialPeterArizBurner

    Wow! Thanks Greg! Best walk-through video I've found yet! Keep it up. Thanjs again

  • @tejaswi1995
    @tejaswi1995 Před rokem

    Thank you Greg for these tutorials. Super helpful

  • @MarkusEicher70
    @MarkusEicher70 Před 8 měsíci

    Hello Greg. Thanks for giving us a high level overview of what we can do with langchain. As a newbie, I like this kind of introduction. Just going through the whole playlist now and I'm sure, I will come back often to your channel for further studies. Have a good time and be well.

  • @codeandfood
    @codeandfood Před rokem

    you made it so clear to understand LangChain. Thank you!

  • @PunjabiCodeMaster
    @PunjabiCodeMaster Před rokem

    Thanks Greg!! Will follow entire series.

  • @anihe8892
    @anihe8892 Před rokem

    This is an excellent tutorial about langchain. Many thanks!🤩

  • @amansharma5139
    @amansharma5139 Před rokem

    Great explanation and easy to follow. Thanks

  • @sreeramkrishnamachari8556

    Great videos, Greg - Thanks for pulling this content together. Quick one - Looks like the "llm-math" is expecting input a certain way to calculate prime number below the age of Japans leader. It is not getting the query in the right format to to do the calculation. It is doing the first two steps accurately. I am getting ValueError message:
    ValueError: unknown format from LLM: This is not a math problem and cannot be translated into an expression that can be executed using Python's numexpr library.
    Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...

  • @chandankumarmishra336
    @chandankumarmishra336 Před 4 měsíci

    Hi Greg, thanks a ton for creating this masterpiece and useful stuff on the real world examples and awesome presentation...kudos...

  • @luqi4230
    @luqi4230 Před rokem +2

    your video really helps a lot for a beginner! Thanks for the effort!

    • @DataIndependent
      @DataIndependent  Před rokem

      Great! Thank you for the kind words

    • @b326yr
      @b326yr Před rokem

      Beginner? I must be really really far behind

    • @b326yr
      @b326yr Před rokem

      NAH, this is not for me 😁

  • @tenicg7045
    @tenicg7045 Před rokem

    Great job, Greg! Your walkthrough video was incredibly helpful, and I learned a lot from it.

  • @mrlions420
    @mrlions420 Před rokem

    Awesome tutorials. Also, I loved you in Limitless

  • @ADHDOCD
    @ADHDOCD Před rokem +1

    Wow, finally understand where langchain can be used!

  • @mahdiyartaghavi9753
    @mahdiyartaghavi9753 Před 4 měsíci

    At the end of the video, when the chatbot remembered you said 'Hi there', the satisfaction in your eyes is priceless!

    • @DataIndependent
      @DataIndependent  Před 4 měsíci

      Ha, nice! Thank you. I had to go back and look at it. It looks like that video was filmed with a potato

  • @mr.daniish
    @mr.daniish Před rokem

    Amazing content Greg!

  • @KinoInsight
    @KinoInsight Před rokem

    Thanks Buddy! This is extremely useful

  • @Harry_Hugh
    @Harry_Hugh Před rokem +1

    quick question: around 3'36 for prediction, which gpt model are you using by default?

  • @user-dz2gg4jn6w
    @user-dz2gg4jn6w Před 9 měsíci

    you've done a great job. please keep going

  • @brentdunklau4536
    @brentdunklau4536 Před rokem

    This is an awesome series. One observation: At 9:10, I got a different answer than 65/61. I actually got 68/67. Then I just re-ran that step and got 65/61. Kinda surprised by that.

    • @DataIndependent
      @DataIndependent  Před rokem

      These language models aren't always deterministic which is a pain for reliability. So that behavior isn't unexpected

  • @tanujgarg20
    @tanujgarg20 Před rokem

    The question you asked to your large language model about what are 5 vacation destination ,the output is searched by OPENAI or you have fed some document and searched from that?

  • @caioraimundo1609
    @caioraimundo1609 Před rokem

    Awesomeeeee stuff! Thanks for sharing!

  • @Whiskey9o5
    @Whiskey9o5 Před 10 měsíci

    Whoaaa, You have my attention. Subscribed!

  • @potmmy
    @potmmy Před rokem

    Great videos, looking forward to your videos :)

  • @JackyZhang69
    @JackyZhang69 Před rokem

    This is what I really want. Thanks

  • @gurmukhsingh-uh5qo
    @gurmukhsingh-uh5qo Před rokem +1

    thank you for sharing

  • @premsaikarampudi3944
    @premsaikarampudi3944 Před rokem

    Hi Greg, I was trying to execute the code but then I got an error saying exceeded limit. I did some research looks like we need to pay to use OpenAI?

  • @romakhajiev9535
    @romakhajiev9535 Před 3 měsíci

    I have a question, if I were to use langchain on a website where multiple users can have a conversation with the bot and if I use conversationChain , does it remember every single user’s chat history even though all the users send a request to a backend API?

  • @tauantorresmendes1671
    @tauantorresmendes1671 Před rokem +1

    Hey, man! Thank you for your videos. They are very helpful. I would like to ask you if you could do a video explaining how did install the LangChain, because I am having a lot of trouble doing it. Thanks, man!

    • @DataIndependent
      @DataIndependent  Před rokem

      Are you having a hard time with LangChain or a supporting library?

  • @vidbina
    @vidbina Před rokem +1

    Liking the series. Tinkering with LangChain atm and watching your vids to find things I may have missed.
    What do you use to record these videos?

    • @DataIndependent
      @DataIndependent  Před rokem +1

      Thanks, glad they are helping. Any run through you want to see specifically?
      I started with Loom. It’s super easy to record with, but limited.
      Went to OBS for the recent videos which gives you more flexibility.
      I’ll likely stick with that if I keep upgrading my set up

  • @ankansharma4897
    @ankansharma4897 Před rokem +1

    Hey Greg, Everything is great. But there is one feedback please improve your video quality to 1080p standard aspect ratio for future videos. Thank you for the effort.

    • @DataIndependent
      @DataIndependent  Před rokem

      Nice! thank you - I upgraded the set up a bunch since this first video

  • @MatthiasHerodotus
    @MatthiasHerodotus Před rokem

    wonderful video. I have a question about how to output a result more than maximum tokens?

    • @DataIndependent
      @DataIndependent  Před rokem +1

      You can either
      * Call your LLM multiple times and append the outputs to each other for more data
      * Adjust your max_token parameter to something higher

  • @venkat1195
    @venkat1195 Před rokem +2

    you are a legend :)

  • @smreeves2004
    @smreeves2004 Před rokem +3

    I figured out how to install jupyter but how do you open the notebook for langchain??

    • @Gorto68
      @Gorto68 Před rokem

      I'm equally mystified - where is the link to launch the notebook?

  • @katotoy6755
    @katotoy6755 Před rokem

    mind blown to the demo.. 😁

  • @myselfandpesit
    @myselfandpesit Před 6 měsíci +1

    Hi Greg, this is my first video about langchain. When I run the code, I get ratelimiterror. How is it possible? I've never made any calls to OpenAI before.

  • @andresrello
    @andresrello Před rokem +5

    This is really cool thanks! Do you do these videos as a hobby? I always wonder how people has time to do this kind of things

    • @DataIndependent
      @DataIndependent  Před rokem +15

      Long story short: Yes just a hobby for now. I’m putting full time energy into my own venture outside of this.
      Doing these videos are fun, make me learn new things and introduce me to other builders which is fun too. And I like helping others leverage up their skills

    • @CentigradeMind
      @CentigradeMind Před rokem +1

      @@DataIndependent Thank you.

    • @lutfiikbalmajid
      @lutfiikbalmajid Před rokem +1

      @@DataIndependent keep it up! Thanks 🙏🙇

  • @manelaloui7069
    @manelaloui7069 Před rokem

    Hi , thank you for this tuto,
    But I faced an error:
    RateLimitError: You exceeded your current quota, please check your plan and billing details.
    What should I do , I generated this token just one week ago.

  • @succesonline2581
    @succesonline2581 Před 5 měsíci

    amazing video! As a complete noob at Python and Ai.. I was wondering whether it'd be possible to have an output to be a complete social media post following a certain provided template, based on information like a PDF for example? All other non-coding solutions like ChatGPT and other AI's didn't work... Keep up the good stuff man!

  • @LuisOrtega-ue1vp
    @LuisOrtega-ue1vp Před rokem

    When I try running the code snippet at 3:29 I get a RateLimitError. Do I need to buy something on OpenAI before continuing?

    • @DataIndependent
      @DataIndependent  Před rokem

      Check out openai's documentation on rate limits and see if you went over it. I sometimes do

  • @kiranjoshi4966
    @kiranjoshi4966 Před rokem

    Hello! Grey, In this line llm = OpenAI(temperature=0.9) getting error is Did not find openai_api_key, please add an environment variable `OPENAI_API_KEY` which contains it, or pass `openai_api_key` as a named parameter. (type=value_error). Pls help me out here.

    • @DataIndependent
      @DataIndependent  Před rokem

      You need to give your open ai key. You can do this via an environment variable or place it right when you create your llm.
      Pass your error into chatgpt for more help on debugging

  • @____2080_____
    @____2080_____ Před rokem +1

    I’m more excited about Langchain then I am with GPT itself.

  • @AliAliOxenFree
    @AliAliOxenFree Před rokem

    First off, excellent content. Prompt engineering is gonna be the hot ticket for probably the next 2-3 years.
    unfortunately i've been stuck at the 7:22 mark (i even went to your github and copied the exact code in case i made a spelling mistake or something). And i keep getting the same error with the initialize_agent: AttributeError: 'str' object has no attribute 'value'.
    Anyways super stoked to have stumbled on your channel, can't wait to go through all your content.

    • @AliAliOxenFree
      @AliAliOxenFree Před rokem

      ok i found the solution... I think things may have changed since this video was made.
      First add this line to imports:
      from langchain.agents import AgentType
      then modify the initialization of the agent to this:
      agent = initialize_agent(tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)

    • @DataIndependent
      @DataIndependent  Před rokem +2

      Thanks for letting me know. I’ll see if I can reproduce the bug.
      If this one gets stuck I recommend heading over to the “7 core concepts” video which will work

  • @cornershop5268
    @cornershop5268 Před rokem

    Hi Greg, for some reason when I run it - it does not search for the prime ministers age - see the below. How can I fix this?
    I need to find out who the leader of Japan is and then use a calculator to find the largest prime number that is smaller than their age.
    Action: Search
    Action Input: "Current leader of Japan"
    Observation: Fumio Kishida
    Thought: I now need to find the largest prime number that is smaller than Kishida's age.
    Action: Calculator
    Action Input: Kishida's age (68)
    Observation: Answer: 68
    Thought: I now know the final answer.
    Final Answer: 67

  • @merodiro
    @merodiro Před rokem +3

    Note: LLM-math here didn't help with the prime number answer. it gave the wrong answer (65) but because GPT-3 already memorized the first prime numbers it was able to answer

  • @lij3900
    @lij3900 Před rokem +1

    I was following the tutorial and encountered this error while running the agent on leader of Japan and prime number smaller than their age:
    ValueError: unknown format from LLM: This is not a math problem and cannot be translated into an expression that can be executed using Python's numexpr library.
    Anyone see the same?

    • @anielkali704
      @anielkali704 Před rokem

      I encountered the same problem.

    • @blueslee1
      @blueslee1 Před rokem

      try change the temperature in line 22 to 0.9 instead of 0.

  • @pragatijagadale134
    @pragatijagadale134 Před rokem +1

    I get this error, every time-
    You exceeded your current quota, please check your plan and billing details.

  • @user-ms2zi2oq6f
    @user-ms2zi2oq6f Před rokem

    is it possible to do the same thing your doing with vertexAI instead of OPENAI?

    • @DataIndependent
      @DataIndependent  Před rokem +1

      Yep totally, just swap out your LLM for whatever you want

    • @user-ms2zi2oq6f
      @user-ms2zi2oq6f Před rokem

      @@DataIndependent okay any documentation which could be referred to do so?

  • @rajivraghu9857
    @rajivraghu9857 Před rokem

    One thing I did not understand in agent :: user gave input as ‘"Who is the current leader of Japan? What is the largest prime number that is smaller” …. And after we run , it shows > Entering new AgentExecutor chain...
    I need to find out who the leader of Japan is and then calculate the largest prime number th at' is smaller than their age. . Did it send the prompt to openai In order to rephrase

    • @DataIndependent
      @DataIndependent  Před rokem

      Yep exactly. There are a lot of calls happening in the background to form the decisions

  • @robodev6033
    @robodev6033 Před rokem

    Hi I have a question can langchain understand the data of the mechanical drawing and electrical drawing in the pdf?

    • @DataIndependent
      @DataIndependent  Před rokem +1

      No not yet, but you could try and image recognition model from another provider

    • @robodev6033
      @robodev6033 Před rokem +1

      @@DataIndependent I have tried but none of these can do that yet. I think it's time to invent this thing up.

    • @nahfid2003
      @nahfid2003 Před rokem +1

      @@robodev6033 tell us when u do

  • @BasselIssa
    @BasselIssa Před rokem

    Actually this is great, but in some cases Google search is not getting the right answer so it can be used in the math lib. there should be a way to validate the results the agent returns first before proceeding

  • @ryandury
    @ryandury Před rokem

    Wow, this is fantastic. One thing I didn't see demonstrated is: Will this chain use an OpenAI model to answer the question, rather than using google api if it has the answer? Did you demo that in another video? Thank you so much.

    • @DataIndependent
      @DataIndependent  Před rokem +1

      If you're working with an agent it will have a series of tools to choose from. It may choose google or straight to openai if it feels that's the best one to go for.

    • @ryandury
      @ryandury Před rokem

      @@DataIndependent Thank you for your response, that's what I was wondering. Great series. Appreciate it!

  • @skillerd7429
    @skillerd7429 Před rokem +1

    Great!

  • @VaibhavPatil-rx7pc
    @VaibhavPatil-rx7pc Před rokem

    Really awesome quick start !!

  • @sushmaregandla4902
    @sushmaregandla4902 Před 11 měsíci

    I am getting error at llm = OpenAI (temperature=0.9). Can anyone help me on this

    • @DataIndependent
      @DataIndependent  Před 11 měsíci

      What's the error? Make sure your api key is set as an environment variable or set in when your make your LLM

  • @shahriardhruvo6281
    @shahriardhruvo6281 Před rokem

    Please consider recording future videos with a better software than loom example: OBS studio. The reason is as you are showing a lot of text content if things get blurry it gets difficult for us viewer to read them. And lastly thank you for these awesome tutorials

    • @DataIndependent
      @DataIndependent  Před rokem +3

      ya...I've considered it and likely will. My setup is currently getting an upgrade that will be finished tonight or tomorrow.

  • @kaushikkatikala
    @kaushikkatikala Před 7 měsíci

    print(llm(text))
    and
    print(llm(prompt.format(food="desserts")))
    both these are not executing for me

  • @HeatonResearch
    @HeatonResearch Před 6 měsíci +1

    Note, alot of the syntax here is out of date and will give warnings and soon not work.

    • @DataIndependent
      @DataIndependent  Před 6 měsíci

      Ya - it’s worth an update shortly.
      One of the downsides of making tutorials so quick for the content

  • @johnsarvosky533
    @johnsarvosky533 Před 4 měsíci

    Hi Greg, Thanks for the Video. OpanAI API key is no longer free. Can you please show/ comment how to implement other opensource LLMs with Langchain..?
    Thanks again!

    • @DataIndependent
      @DataIndependent  Před 4 měsíci +1

      All LLMs will cost a bit if you don't run them locally. I haven't dipped into local running yet

  • @sampsonarchibaldclaxton7872

    I am inspired by your tutorials, but I am a complete noob. Do you have training on how to even access the screen you are on, Jupyter? I was lost trying to figure out where to put the pip install langchain and it was all downhill from there.

    • @DataIndependent
      @DataIndependent  Před rokem +1

      Try installing anaconda: www.anaconda.com/products/distribution
      That is the place I usually start w/ a fresh computer. There are tons of tutorials for it online.
      Alternatively you can use a google colab notebook which is like a jupyter notebook but in the cloud.

    • @4f52
      @4f52 Před rokem

      Yep I have no idea what is happening but I try to follow and backtrack from that

  • @KerimBahadirTunc
    @KerimBahadirTunc Před rokem

    Hey, I guess I'm the clumsy one but I don't understand how to get it to work. Even when I entered the links, I could only look at it. Can someone tell me how I can do this setup and take advantage of this great blessing?

    • @DataIndependent
      @DataIndependent  Před rokem +2

      Check out tutorials on jupyter notebooks or google colab notebooks if you want to get the editor up and running

  • @archiewoosung5062
    @archiewoosung5062 Před rokem

    good idea to have short videos...those taking 17hrs are daunting!
    Why did chaining cause a list of countries to be returned in response to a 'fruit' prompt...places to go to eat fruit?

  • @amitchaudhary6
    @amitchaudhary6 Před rokem +1

    Hi really great video, why aspect ratio of this video is 4:3 and not 16:9 or 18:9?

    • @DataIndependent
      @DataIndependent  Před rokem

      This was before I switched over to obs. New videos are better.

  • @fraternitas5117
    @fraternitas5117 Před rokem +1

    how do I hookup langchain with a non english language model?

    • @DataIndependent
      @DataIndependent  Před rokem +1

      Here's the integrations they support and should have documentation on how to do what you want
      langchain.readthedocs.io/en/latest/modules/llms/integrations.html

    • @drmartinbartos
      @drmartinbartos Před rokem +1

      As far as I can see, the language dependency is in the model you use, not the Langchain library itself (except if there are any character encoding issues with prompt passing), so presumably you just need to have a suitable end-use language model.. and the integrations show you how you could link up to various sources which may include models of the language you are looking for..

  • @Dnyanu01d
    @Dnyanu01d Před rokem

    hey there i can't able to assign API KEY . please help

    • @DataIndependent
      @DataIndependent  Před rokem +1

      You need to get an openai api key and them pass it in when you make your LLM

    • @Dnyanu01d
      @Dnyanu01d Před rokem

      @@DataIndependent it worked. Thank you.

  • @petera.4707
    @petera.4707 Před rokem

    didn't understand anything. where to start as a beginner? python?

  • @OfficialChatbotBuilder

    This is great for those that know code! For those that don't a visual editor is the fastest and easiest way to use AI🚀

  • @starjx126
    @starjx126 Před rokem

    You are handsome and make so good contents, keep on

  • @user-zt4fr2eb2f
    @user-zt4fr2eb2f Před rokem

    Hey bro! What you're doing here? You best suits for Hollywood.

  • @evapardeza1647
    @evapardeza1647 Před rokem

    ChatGPT API is not free... is there any way to learn Lang Chain without using ChatGPT API?

  • @nikhilsingh-jy9dt
    @nikhilsingh-jy9dt Před rokem

    bro i am getting empty message

  • @artemiofilho
    @artemiofilho Před 3 měsíci

    The largest prime number smaller than 66 is 61.

  • @_thehunter_
    @_thehunter_ Před rokem

    most of the part are replaced by chatgpt plugins except for memory

    • @DataIndependent
      @DataIndependent  Před rokem

      And customizing agents, and prompt templates, example selection and a bunch of others. Check out my latest video on 7 core concepts for more.

  • @neerajshrivastava5600

    Excellent content, however if you speak slowly it will make it easy to absorb the information

  • @gogogame268
    @gogogame268 Před 11 měsíci

    i wanted to say your explaining is extremely good
    But it's really sad that you are using the openai api instead of free open source llm on hugging cause not a lot of people that are watching your videos and want to learn langchain have the access to buy the openai api keys
    eventhough thank you so much for explaining the basics

  • @Gorto68
    @Gorto68 Před rokem

    For the life of me I can't seem to follow how to load the notebook.

    • @DataIndependent
      @DataIndependent  Před rokem

      Try asking gpt 3.5 or gpt 4 to help trouble shoot

    • @Gorto68
      @Gorto68 Před rokem

      @@DataIndependent What I mean is -- where is the link to the notebook you are running, or is the direction to create the notebook from scratch ourselves and to type in the commands. The latter route is what I ended up doing. Which was probably for the best, as it forced me to learn the notebook format. For Dynamic calls and Add state to chain, I received "Error in on_chain_start callback: 'name'" Tried to find a solution through GPT, but no luck. Any thoughts? Otherwise following along with the tutorial. For the Japanese Prime minister, my answer was 67.

    • @DataIndependent
      @DataIndependent  Před rokem +1

      Oh, the code is in the description of all my videos!

  • @glenhinkle
    @glenhinkle Před rokem

    Another notebook tutorial. Hidden state, visual clutter, and interleaved context. Hooray. I'm starting to believe that all of these tutorial videos are made by people that don't actually create software.

  • @MartinsErmanis
    @MartinsErmanis Před 2 měsíci

    Came for a quickstart guide - got a 50% guide. Was good information, but the things i came here to understand you said: "Already did that, so I won't do it." :(
    Otherwise Thanks!

  • @DoctorMandible
    @DoctorMandible Před rokem

    You need a compressor on your voice over. The quiet parts are too quiet.

    • @DataIndependent
      @DataIndependent  Před rokem

      Thanks for the feedback. This video was using my v.5 set up ha, I've upgraded since then.
      For a longer quickstart guide check out this video
      czcams.com/video/2xxziIWmaSA/video.html

  • @Rundik
    @Rundik Před rokem

    Isn't it just a glorified text templating engine?

  • @danielhenshaw3089
    @danielhenshaw3089 Před 5 měsíci

    Hey Greg! Thank you for this beautiful content.
    Actually, I am stuck somewhere. First I want to import OpenAi from langchain.llms but I got an error message. Did some research and found out that I needed to change them all to lowercase I.e openai as against OpenAi. That went successfully.
    Now I’m trying to write the code llm= openai(temperature=0.9) and I keep getting the TypeError that the module object is not callable

  • @shivrajnag12
    @shivrajnag12 Před rokem

    Hi Greg, I am facing this error
    Retrying langchain.llms.openai.completion_with_retry.._completion_with_retry in 4.0 seconds as it raised RateLimitError: You exceeded your current quota, please check your plan and billing details..
    I would see it's related to rate limit but in OpenAI console under Usage tab I could see that I haven't exceeded the limit. Please help

    • @DataIndependent
      @DataIndependent  Před rokem

      You may not have exceeded your quota but looks like you’re over your rate limit.
      Try putting in a sleep timer

    • @shivrajnag12
      @shivrajnag12 Před rokem

      @@DataIndependent But how is this even possible I am using OpenAI API for the first time. Anyways can you tell me where I need to add this line ?

    • @DataIndependent
      @DataIndependent  Před rokem

      They have a token per minute limit so you don’t overload them. For example you can’t send them 3 textbooks in 1000 parallel requests. It would overload them.
      Just make your calls slower so you don’t go over the limit. I think it’s 40k tokens/minute

  • @lokeshsharma5088
    @lokeshsharma5088 Před 5 měsíci +1

    pip install -U langchain-openai
    from langchain_openai import OpenAI
    llm = OpenAI(temperature=0.9)
    text = "which are the top 5 countries in pick pocket cases?"
    print(llm.invoke(text))

  • @sankarsana
    @sankarsana Před rokem

    I tried OpenAI api for the first time following this tutorial. I get this error.
    Retrying langchain.llms.openai.completion_with_retry.._completion_with_retry in 4.0 seconds as it raised RateLimitError: You exceeded your current quota, please check your plan and billing details. I am on free tier since April.

    • @DataIndependent
      @DataIndependent  Před rokem

      Looks like you may have to get on a paid plan or wait till your limits pass

    • @sankarsana
      @sankarsana Před rokem

      @@DataIndependent I see. This is the first time I used and it is not clear how the limit was exceeded. Later I noticed there was an 18 USD limit that was probably created automatically when I registered in April. Today the status shows the limit has expired.

  • @aswathinrp
    @aswathinrp Před rokem

    got this error: 'Retrying langchain.llms.openai.completion_with_retry.._completion_with_retry in 4.0 seconds as it raised RateLimitError: You exceeded your current quota, please check your plan and billing details..'

    • @learnvik
      @learnvik Před rokem

      I got the same error, any resolution ? I get the response from chat gpt when I put the same question directly, but not getting any response via API

  • @jmojnida
    @jmojnida Před 2 měsíci

    How to deal with errors in case of agents?
    My prompt is this:
    qry = "Who is the current prime minister of UK? What is the largest prime number that is smaller than his age? Include the name and age of the prime minister in your response."
    agent.run(qry)
    It found the prime minister of US Rishi Sunaak. His age 42 years (may be). But, check out the prime number, it arrives at 42. 42 is NOT a prime number. How to deal with such errors?
    Action Input: "Rishi Sunak age"
    Observation: 43 years
    Thought: I need to find the largest prime number that is smaller than 43.
    Action: Calculator
    Action Input: "Largest prime number smaller than 43"
    Observation: Answer: 42
    Thought: I now know the final answer.
    Final Answer: The current prime minister of UK is Rishi Sunak, who is 43 years old. The largest prime number that is smaller than his age is 42.
    > Finished chain.
    The current prime minister of UK is Rishi Sunak, who is 43 years old. The largest prime number that is smaller than his age is 42.

  • @usoppgostoso
    @usoppgostoso Před rokem

    Conversation.predict returns nothing for me, weirdly.