Stream LLMs with LangChain + Streamlit | Tutorial

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

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

  • @davidtindell950
    @davidtindell950 16 วันที่ผ่านมา +1

    Another very useful "AO" vid that I must have missed somehow ! TUVM !!!

  • @gabrieljauregui654
    @gabrieljauregui654 6 หลายเดือนก่อน +4

    Great tutorial to keep us practicing both LangChain and Streamlit! Greetings from Argentina 😊😊

    • @alejandro_ao
      @alejandro_ao  6 หลายเดือนก่อน +1

      greetings!

  • @ronikh4n
    @ronikh4n 5 หลายเดือนก่อน +5

    Fantastic walkthrough! I was wondering if you could create a tutorial on how to build a custom Knowledge Retrieval service using Langchain. The idea behind this service is to allow users (multi tenancy) to chat with their uploaded documents in different formats like PDF, CSV, and Text, while ensuring that the data remains accessible only to the user/owner who uploaded the file.

  • @chibuzoemelike6403
    @chibuzoemelike6403 6 หลายเดือนก่อน +1

    This is very helpful, will be great to see something on Langraph and Agents. Thank you for all your support

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

      i have been planing to bring langgraph for a while. so many things to cover. i have started covering agents a bit more, though!

  • @duanxn
    @duanxn 5 หลายเดือนก่อน +1

    great tutorial, step by step and crystal clear

    • @alejandro_ao
      @alejandro_ao  5 หลายเดือนก่อน

      it's my pleasure :)

  • @cindywu3265
    @cindywu3265 5 หลายเดือนก่อน +1

    Very clear and great content to follow along! I am able to build a chat app with multiple pdfs with ConversationalRetrievalChain, but not sure how to implement streaming with that. Hope I will see one soon!

    • @alejandro_ao
      @alejandro_ao  5 หลายเดือนก่อน +1

      hey there. yeah, you can totally implement streaming with conversational retrieval chain. but you would probably need to use the latest version of it. i think that the class-based chains (like the one you mentioned) are not compatible with LCEL but I am not certain. try creating your chain like this: python.langchain.com/docs/expression_language/cookbook/retrieval

    • @cindywu3265
      @cindywu3265 5 หลายเดือนก่อน

      @@alejandro_ao Awesome, thank you Alejandro! Look forward to your next video

  • @edsonrodas3954
    @edsonrodas3954 5 หลายเดือนก่อน

    I'm recently learning python and for me this is amazing. You make it look so easy, thanks for share your knowledge

    • @alejandro_ao
      @alejandro_ao  5 หลายเดือนก่อน

      this is beautiful to hear. thank you 😊 keep it up, you're on the right path!

  • @jamessebastian8912
    @jamessebastian8912 5 หลายเดือนก่อน +2

    Thanks! Great Tutorial.

    • @alejandro_ao
      @alejandro_ao  5 หลายเดือนก่อน

      hey thanks for the tip

  • @hakikitosunpasa335
    @hakikitosunpasa335 6 หลายเดือนก่อน +1

    Amazing tutorial, I wonder how to use LCEL with RAG and streaming output in conversational setting...

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

    That write_stream function is cool.. thanks for sharing this buddy.

    • @alejandro_ao
      @alejandro_ao  5 หลายเดือนก่อน +1

      i know, they released it a few days ago. those guys at Streamlit are building super cool things

    • @ayoolaadedeji9353
      @ayoolaadedeji9353 5 หลายเดือนก่อน

      I can't get the write_stream attribute to be recognised :/@@alejandro_ao

  • @amorotto
    @amorotto 6 หลายเดือนก่อน +1

    Great video! would be great to create a similar one for conversational agents with tools using LCEL as well!

    • @alejandro_ao
      @alejandro_ao  6 หลายเดือนก่อน +2

      i'm working on something like that :)

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

    yeah good video thank you, I will try to had a sidebar to ajust temp and token lenght with previous videos and see how it goes.

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

    Great content, amigo! Awesome work!

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

      Thanks amigo!

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

    This is an amazing video. Extremely helpful. How would you go about sequential chains with this? I have been picking up errors and not sure where to read into this more.

  • @mikachiche
    @mikachiche 5 หลายเดือนก่อน

    Thanks you very useful tuto, you should explain a little more what and why you're doing something

  • @shobhitagnihotri416
    @shobhitagnihotri416 6 หลายเดือนก่อน +2

    How can we generate an assistant that can provide code after uploading documentation of frame work . Please make something related to this . Thank in advance

    • @alejandro_ao
      @alejandro_ao  6 หลายเดือนก่อน +1

      that's a bit more tricky since we usually need a lot of context to write good code. gemini 1.5 is capable of doing this afaik. i'll make some videos about this!

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

    Great video! I was wondering, why is it necessary to use a Str output parser? Why not getting the content string from de answer directly?
    Thanks!

    • @alejandro_ao
      @alejandro_ao  3 หลายเดือนก่อน +1

      hey! you can do that too. that was mostly to show how to use the output parsers. but usually you would use the output parser within a chain rather than at the end. inside a chain, if your next step in the chain requires a string input, using an output parser will make sure that it works regardless of what the intermediate step returns 👍

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

    Is there a way to do streaming with CustomLLM class with Custom Finetuned model or SageMaker Endpoint (not chat gpt) and using langchain?

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

    Is it possible to add tools to this chatbot or must an agent be used?
    Maybe you could show how the best way to add search tool for the bot?

  • @softwareideology2033
    @softwareideology2033 5 หลายเดือนก่อน

    Hi ! I impressed with your chat with MySQL solution Can you make a video about chat with api which has swagger docs ?

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

    How can we do the streaming if the backend chain logic is exposed as REST API? In this example, both backend and frontend logic is there in the same file.

  • @srikanthverpula6271
    @srikanthverpula6271 5 หลายเดือนก่อน

    its good but if possible can you work on function calling (Realtime API multiple) in conversational way?

  • @AIdevel
    @AIdevel 5 หลายเดือนก่อน

    Thanks for this great video I wonder how to integrate the streaming method in my RAG application, how to stream the response in RAG based app that uses Qdrant database would you explain it for me ❤❤

  • @Emmanuel-xe5bc
    @Emmanuel-xe5bc 3 หลายเดือนก่อน

    great job. I hope i can use part of your code for school assignments?

    • @alejandro_ao
      @alejandro_ao  3 หลายเดือนก่อน +1

      absolutely! and tell your friends about the channel in case they want to learn more about LLM apps :)

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

    Thank you so much ❤❤

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

      it's my pleasure!

  • @ajay.kartheek
    @ajay.kartheek 6 หลายเดือนก่อน

    Great Tutorials...... Can you tell me what I need to know to build an RAG application like webpage query bot without using streamlit (python based web developemnt will be very useful for me)... I am trying to build an project for my Placement drives. Plz help me through this!! Thank you!!

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

    Thanks a lot !! great

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

      Glad you liked it!

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

    what a voice men

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

    Hey! Really awesome tutorial! Just a bit confused with how the template and the invoke method work together. The user question: {user question} in the template and then {user question: query} in the invoke method. How do they correlate please. Thanks

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

      hey there, great question.
      the variables in the template are in between curly braces, like {user_question}. these values will be replaced later, when you "invoke" it.
      and when you run the invoke method on a prompt (or a chain that starts with a prompt), you pass an object that looks like this:
      {
      variable_to_replace: "my value"
      }
      this will replace all the {variable_to_replace} in your prompt with "my value".
      so if your prompt looks like this:
      prompt = PromptTemplate.from_template("this is the user question: {user_question}")
      and
      query = "what is love?"
      then when you run
      prompt.inovoke({
      user_question: query
      })
      will return this: "this is the user question: what is love?"

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

      @@alejandro_ao thank you! So helpful. Can’t wait to start playing with langchain and crewai. Just finishing off a deep learning (tensorflow) course and some projects then I’ll get into it.
      I’m a data analyst trying to transition into data science/ML engineering btw 😊

    • @alejandro_ao
      @alejandro_ao  29 วันที่ผ่านมา +1

      ​@@cheybrown2076 you are on the right path! actually, i am opening a cohort in a couple of weeks precisely about building AI apps. if you would like to join: course.alejandro-ao.com
      let me know if you're interested or have any questions!

  • @dhmkkk
    @dhmkkk 5 หลายเดือนก่อน

    is there any way to incorporate streamlit button inputs and llm to answer from that like i ask give menu options and it shows options as buttons and when i click one the llm knows what i selected

  • @user-yh1qt9tf4u
    @user-yh1qt9tf4u 4 หลายเดือนก่อน

    I like your so helpful videos so much. Recently, with the help of your videos, I created a customized Rag chatbot with nice avatars and customized HTML. So with the langchain chat message function and the chat history.
    Text streaming using chat message instead simple langchain message as add on is not possible, is it?

  • @anuvratshukla7061
    @anuvratshukla7061 5 หลายเดือนก่อน

    How can we do the same streaming with Mixtral LLM? I'm using Mixtral (huggining face inferecing) + Langchain + Streamlit. LLM is used as pandas agent and I want to stream the response.

  • @ersaaatmeh9273
    @ersaaatmeh9273 5 หลายเดือนก่อน

    Hi , could I ask you how I can do the same step if I try LLM from Hugging Face?

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

    nice. gracias alejandro

    • @alejandro_ao
      @alejandro_ao  5 หลายเดือนก่อน +1

      un placer, cristian :)

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

    Can you please make a chatbot on an open source model.
    And Great Tutorial as always 🎉

    • @alejandro_ao
      @alejandro_ao  5 หลายเดือนก่อน +1

      hey there! sure, i will be including more open source models in the demos fron now on :)

  • @limjuroy7078
    @limjuroy7078 5 หลายเดือนก่อน

    After watching this video, I am thinking of updating the code for your Multiple PDF Chat Tutorial that I have followed fw months ago. I am considering replacing the existing ConversationalRetrievalChain and BufferMemory with LCEL as demonstrated in the video.

    • @alejandro_ao
      @alejandro_ao  5 หลายเดือนก่อน +1

      yes! i really need to update that video. the core remains relevant, but the code might need some brushing up

    • @limjuroy7078
      @limjuroy7078 5 หลายเดือนก่อน

      @@alejandro_ao Hope you will do that and come out with a video asap.

  • @jamessebastian8912
    @jamessebastian8912 5 หลายเดือนก่อน

    Thanks!

    • @alejandro_ao
      @alejandro_ao  5 หลายเดือนก่อน

      *thanks to you!*

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

    Great video. Can you make a video on LangGraph?

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

      hey there, sure! coming soon!

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

    We I reimplement your code I got errors I wonder, I almost clone three of your repo and fails although I try to use free API such as hugging face

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

    Just stumbled across your channel. Looks pretty decent. Curious what the AO means.

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

      thanks! welcome to the community :) AO is just my initials btw

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

    This is really excellent video It’s exactly what I have been looking for
    Would you please tell me how to use it with RAG applications please make video about that because it’s a game changer in python chat bots 🤖
    I tried but failed I need your assistance 😊

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

      hey there! glad to hear this! sure thing. i have been covering RAG quite a bit. even though i have much more content about this coming :)
      - my most recent video about it is this one, which shows how to do RAG on a web page's contents: th-cam.com/video/bupx08ZgSFg/w-d-xo.htmlsi=A8fPDeepjKuPe2oP
      - this one is a more detailed and is about PDF files, but with a slightly older version of langchain: th-cam.com/video/dXxQ0LR-3Hg/w-d-xo.htmlsi=FnULh8P7fn4Iq7df

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

      @@alejandro_ao Off course I am keen follower of yours I’ve seen them but I mean how to integrate the message streaming with RAG app ? In the retrieval chain ? and how exactly to achieve it ?

    • @alejandro_ao
      @alejandro_ao  5 หลายเดือนก่อน

      @@AIdevel oh alright! i will incorporate streaming next time i make a RAG app! 🤓 thanks for following the channel!

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

      @@alejandro_ao pretty sure retriever objects don't support streaming, I know it's possible to have some elements in your chain that don't support streaming though

  • @tojitojira858
    @tojitojira858 5 หลายเดือนก่อน

    Thank, how should be process to add this functionality on your example "chat wit a website" ?

    • @alejandro_ao
      @alejandro_ao  5 หลายเดือนก่อน

      hey there! all you got to do is use `stream` instead of `invoke` and yield the results using `st.write_stream`. did you manage to make it work?

    • @tojitojira858
      @tojitojira858 5 หลายเดือนก่อน

      @@alejandro_ao I applied the changes mentioned in your video, but I didn't manage to get the same result as you.

    • @tojitojira858
      @tojitojira858 5 หลายเดือนก่อน

      @@alejandro_ao the message is displayed but a very long json variable

  • @geekyprogrammer4831
    @geekyprogrammer4831 5 หลายเดือนก่อน

    Can you create a tutorial on Langgraph?

  • @abhijitubale
    @abhijitubale 5 หลายเดือนก่อน

    Hey Alejandro, Please do let us know which code completion extension/plugin are you using…it seems really “ahead” of you in the video…

    • @abhijitubale
      @abhijitubale 5 หลายเดือนก่อน

      Does anyone know ??

    • @alejandro_ao
      @alejandro_ao  5 หลายเดือนก่อน +1

      hey there! i am using github copilot. it's great :)

  • @Shakti18348
    @Shakti18348 6 หลายเดือนก่อน +1

    How to stream responses of the previous chatbot you made where you used create_retrieval_chain
    I'm getting an error:
    return conversational_rag_chain.stream({
    TypeError: 'generator' object is not subscriptable

  • @KumR
    @KumR 2 หลายเดือนก่อน

    Sorry but how is this different from doing same thing in chatgpt

    • @alejandro_ao
      @alejandro_ao  2 หลายเดือนก่อน

      not very different. this tutorial is mostly for creating your own version of chatgpt or your own implementation of a LLM-chatbot for a "chat over your data" kind of application. arguably, you could also use this app instead of chatgpt if you wanted to have access to GPT-4 at a fraction of the price, but chatgpt has more features (like storing your conversations, voice-to-text, multimodal input) that you would have to code yourself. on the other hand, coding those features yourself might be a great learning experience!

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

    Can u use not openAI API s

    • @alejandro_ao
      @alejandro_ao  5 หลายเดือนก่อน +1

      sure thing :)

  • @parkeatshark4364
    @parkeatshark4364 5 หลายเดือนก่อน

    Could it possible to do this with free account of openai

    • @alejandro_ao
      @alejandro_ao  5 หลายเดือนก่อน

      hey there, if you don't want to use openai, you can always use a free model. Groq has a free API (for now) and they allow you to try out Mistral, Gema and Llama2 for free. check them out and the just implement them like this: python.langchain.com/docs/integrations/chat/groq
      (it should be about a couple lines of code!)

    • @parkeatshark4364
      @parkeatshark4364 5 หลายเดือนก่อน

      Thanks you, I will try this one btw your content is very helpful and easily understood@@alejandro_ao

  • @ErwinWientjes
    @ErwinWientjes 5 หลายเดือนก่อน

    where has your site gone

    • @alejandro_ao
      @alejandro_ao  5 หลายเดือนก่อน

      hey can you please check again? i think the dns is taking too long to propagate :S