This Streamlit Chatbot works over your Notion documents

Поділитися
Вставка
  • Опубліковано 9 лип 2024
  • Harrison Chase, CEO of LangChain, created a Streamlit app to demonstrate the power of LangChain Q&A over a Notion Database export 6 months ago. Let's see if we can improve anything in this app :)
    ☕ Want to support me? www.buymeacoffee.com/andfanilo
    🐦Follow my daily updates on Twitter: / andfanilo
    🗣️ Find me on: andfanilo.com
    00:00 Intro
    02:54 Whiteboarding the process
    04:46 Exploring the code
    13:25 Improving the Streamlit part
    20:40 Outro
    👉 Links
    - Streamlit app: github.com/hwchase17/notion-qa
    My tools (Affiliate links)
    - 🎵 Music (Epidemic Sound) - www.epidemicsound.com/referra...
    ______
    🪶 Hello DataFans! Thanks for reading this far! I've been struggling to script those past few days. You may have noticed, this video is more code-heavy talking head than what I usually do.
    I don't like doing those, I don't want to become a channel with only code talking heads. I love editing, sound design and just being more than a talking head educational channel. I got some comments that told me they don't like it. I'm okay with it, I'm targeting people that want to learn AND get inspired at the same time. But it takes a lot of time, and I do understand I may be too witty or put too much distracting elements in a tutorial. I'm working on reducing it while keeping the inspiring experience.
    Sometimes I wonder how easier it would be to just do talking heads...but eh, I have to tell myself, I firmly believe to teach by providing a valuable experience, not just valuable information. Now I'm spending a lot of time re-evaluating what it means to have a valuable experience in my videos, so I hope you keep up with me while I go through this.
    Thanks for watching!
    👍 On this channel, we love building a lot of small yet smart Streamlit apps to improve our Python chops, and recall our stories around Data Science and Content Creation. Like & Subscribe if you would like to see more videos!
    ⚠️ Disclaimer: This video is not sponsored, I receive no compensation by any brand quoted in this video. Views are my own and do not represent my employer's.
    Links included in this description might be affiliate links. If you purchase a product or service with the links that I provide I may receive a small commission. Thank you for supporting my channel so I can continue providing you with free content!
    #streamlit #python #datascience #dataapps

КОМЕНТАРІ • 28

  • @akshanshkmr
    @akshanshkmr Рік тому +3

    You deserve a million subscribers

    • @andfanilo
      @andfanilo  Рік тому +1

      In 7 years maybe ahah. You can claim you were in the first 3000 subscribers :) I should distribute badges depending on when you subscribed!

  • @cynthrakotoson1902
    @cynthrakotoson1902 8 місяців тому

    its an amazing video , thank you

    • @andfanilo
      @andfanilo  8 місяців тому

      Thanks for the support 🙂

  • @SwanepoelDewald
    @SwanepoelDewald Рік тому

    Your channel is amazing. You explain everything so clearly and I love the casual funny delivery as well! Its sad to see only 3.4k subs. I guess your content is quite niche. I agree, you deserve a million subscribers.

    • @andfanilo
      @andfanilo  Рік тому

      Thanks for the support. Building a channel and niching out to a larger audience takes time and energy...but hopefully one day if I hit 10k at least, you'll be able to say you were in the first 3k subscribers 😁

    • @SwanepoelDewald
      @SwanepoelDewald Рік тому

      @@andfanilo I'll be rooting for you all the way to 1 million 😉

  • @SwanepoelDewald
    @SwanepoelDewald Рік тому

    Thanks!

    • @andfanilo
      @andfanilo  Рік тому

      I am very grateful for the support, that will pay for multiple cups of tea to support my time editing 💖

  • @dkly499ssdgh
    @dkly499ssdgh Рік тому

    That's a big one!

    • @andfanilo
      @andfanilo  Рік тому

      Way too big 😂 this is a more experimental video, won't probably do that a lot

  • @fabmeyer_ch
    @fabmeyer_ch Рік тому

    Thanks for the video, I made a similiar app with Streamlit to query information from JSON files with an LLM.
    However I am struggling to implement streaming of the LLM response.
    It seems that with this implementation streamlit waits until the LLM has finished the response.
    How to overcome this? Any ideas?

    • @andfanilo
      @andfanilo  Рік тому +1

      Hey, thanks for watching. You're the 2nd who asks for streaming support, unfortunately I have no easy solution for that yet :/
      Well apart from refreshing Streamlit on every small part of the response which...is not pretty...or using some asyncio/threading quirks like in discuss.streamlit.io/t/issue-with-asyncio-run-in-streamlit/7745/7 so the update of the placeholder with a longer streamed text doesn't trigger a full rerun (but that is some advanced stuff)
      I'm sending the info to the PMs of Streamlit, but in the meantime you're better off waiting for the long response

    • @andfanilo
      @andfanilo  Рік тому

      You can maybe try ua-cam.com/video/CqqELxWGUy8/v-deo.html too

  • @xylyx_
    @xylyx_ Рік тому

    Hello Fanilo,
    I have a python application which takes some inputs and sends a post request to a rest endpoint where all the computation happens and user awaits for the response with a loading animation on the website. But if the user refreshs the web page, then how to continue from the same place where they left off, I mean from the same state.
    Your help would mean a lot.
    Thank you.

    • @andfanilo
      @andfanilo  Рік тому

      Hey!
      Yeah session state is deleted after a refresh, so you would need to store this information externally...like store all this info in a local JSON file (wouldn't work well on Streamlit Cloud because you may connect on a different pod in some cases), in a cookie on the browser of the user with github.com/Mohamed-512/Extra-Streamlit-Components, or in a remote database, and then at the start of the app, read state from this file/cookie/database and inject it as original value into your different widgets.
      Hope this helps quick start!

    • @xylyx_
      @xylyx_ Рік тому

      @@andfanilo thanks for the reply. Github repo seems promising, I will try that.
      Enjoy watching your content.❤️

  • @luiscardenas8639
    @luiscardenas8639 Рік тому

    Get this error when trying to use my own data set : openai.error.InvalidRequestError: This model's maximum context length is 8191 tokens, however you requested 23323 tokens (23323 in your prompt; 0 for the completion). Please reduce your prompt; or completion length.

  • @1littlecoder
    @1littlecoder Рік тому

    Welcome to the world of LLMs :)

    • @andfanilo
      @andfanilo  Рік тому

      Yeah, my company is currently investigating this world, so this video is a bit of me diving head first into it 😆

  • @alessandroceccarelli6889
    @alessandroceccarelli6889 Рік тому

    Would be cool with PDSs too; awesome video though

    • @andfanilo
      @andfanilo  Рік тому

      Had no clue what PDS was ^^ I suppose one could build a custom data input for this, that could be fun.
      I do think you still need good data import and cleaning skills to enable those kind of projects, I implemented a Q&A over a lot of PDFs on my own and had lots of trouble correctly parsing the PDFs that other tutorials don't talk about 🤔

    • @alessandroceccarelli6889
      @alessandroceccarelli6889 Рік тому

      @@andfanilo *PDFs ... sorry; would be nice if you could share those troubles too.

    • @andfanilo
      @andfanilo  Рік тому +1

      I suppose you saw my Langchain/PDFs thread on Twitter :) I do admit I post most of my struggles there!

  • @arminalimardani2553
    @arminalimardani2553 Рік тому +1

    I can't believe streamlit still doesn't have a proper chat API. The current one is really bad. It goes from top to bottom instead of the other way around. When you submit the text, it doesn't remove it, and you have to remove it manually.

    • @andfanilo
      @andfanilo  Рік тому

      You can +1 here: github.com/streamlit/streamlit/issues/6320 to reinvigorate the discussion
      In the meantime yeah, your best bet is to reverse the session state list of messages before displaying it for bottom to top, and yes removing the elements from session state when needed 😐 (or use the Gradio one, but I think it's the same behavior?)

    • @akshanshkmr
      @akshanshkmr Рік тому

      The layout fix should be doable with placeholders

    • @andfanilo
      @andfanilo  Рік тому

      Oh I found this nice chat implementation in pure CSS github.com/tipani86/CatGDP/blob/master/src/app.py from the CatGDP demo catgdp.streamlit.app/ you can tinker with it in the meantime (EDIT: there's a blog post about it blog.streamlit.io/chat-with-the-cat-generative-dialogue-processor-catgdp/#how-to-tweak-the-ui-so-it-looks-like-an-actual-chat-program)