Build a Streamlit Chatbot FAST 🤯

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ก.ค. 2024
  • 👉 Explore All My Excel Solutions: pythonandvba.com/solutions
    𝗗𝗘𝗦𝗖𝗥𝗜𝗣𝗧𝗜𝗢𝗡
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    In this video, I demonstrate how to use the new chat feature in Streamlit to build a ChatGPT clone. Beginning with a simple chat application, we explore Streamlit's "chat_message" and "chat_input" features, adjust user roles, and customize avatars.
    I also explain how to use the session state feature to retain conversation history, similar to a regular browsing session. Later in the video, we enhance our application by integrating the OpenAI library and Streamlit's secrets manager to securely manage API keys.
    All code used in this video is sourced from the Streamlit documentation which can be found here: docs.streamlit.io/knowledge-b...
    ⭐ 𝗧𝗜𝗠𝗘𝗦𝗧𝗔𝗠𝗣𝗦:
    0:00 - Intro
    0:30 - Simple Example
    1:39 - Echo Bot
    4:10 - ChatGPT Clone
    7:44 - Outro
    𝗧𝗢𝗢𝗟𝗦 𝗔𝗡𝗗 𝗥𝗘𝗦𝗢𝗨𝗥𝗖𝗘𝗦
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    🆓【𝗙𝗥𝗘𝗘】Excel Add-in (𝗠𝘆𝗧𝗼𝗼𝗹𝗕𝗲𝗹𝘁): pythonandvba.com/mytoolbelt
    📊 Dashboard Excel Add-In (𝗚𝗿𝗮𝗳𝗹𝘆): pythonandvba.com/grafly
    🎨 Cartoon Charts Excel Add-In (𝗖𝘂𝘁𝗲𝗣𝗹𝗼𝘁𝘀): pythonandvba.com/cuteplots
    🤪 Fun Emoji Excel Add-In (𝗘𝗺𝗼𝗷𝗶𝗳𝘆): pythonandvba.com/emojify
    📑 Excel Templates: pythonandvba.com/go/excel-tem...
    🎓 My Courses: pythonandvba.com/go/courses
    📚 Books, Tools, and More: pythonandvba.com/resources
    𝗖𝗢𝗡𝗡𝗘𝗖𝗧 𝗪𝗜𝗧𝗛 𝗠𝗘
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    🔗 LinkedIn: / sven-bosau
    📸 Instagram: / codingisfun_official
    💻 GitHub: github.com/Sven-Bo
    💬 Discord: pythonandvba.com/discord
    📬 Contact: pythonandvba.com/contact
    ☕ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲?
    If you want to support this channel, you can buy me a coffee here:
    ▶ pythonandvba.com/coffee-donation

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

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

    *Here is the link to the written tutorial, incl. the code:* ⤵
    docs.streamlit.io/knowledge-base/tutorials/build-conversational-apps

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

    You have an amazing teaching style! Really love it and wish you could produce more content

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

      Thanks for the kind words! I am glad you enjoyed it. ♥

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

    love it, great video as always🙌

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

      Happy to hear that you enjoyed this one too! Thanks for the comment! 🙏

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

    This is awesome, thanks for the content.

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

      My pleasure! Appreciate you taking the time to watch and leave a comment. 👍

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

    thanks man, this helped me a lot 🙌

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

      Glad I could help! Thanks for watching and for the kind words. Cheers, Sven ✌️

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

    Cool!! Thanks for this.

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

      Glad you liked it. Thanks for watching and taking the time to leave a comment!

  • @micbab-vg2mu
    @micbab-vg2mu ปีที่แล้ว

    Great video - thank you

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

      Glad to hear you liked it! Thank you for commenting and watching.

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

    i just love you man

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

      Thank you ❤️

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

    Super Awesome video. which editor do you use ?

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

      Thanks for watching. Glad you liked it. For that video, I used "Atom"

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

    It was really great. Please provide a tutorial on deploy app in streamlit that we can make public and always available. I don't want it to go to sleep after 7 days.

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

      Thanks for watching. Here you are: th-cam.com/video/4SO3CUWPYf0/w-d-xo.html

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

    Hi. Thank you for an amazing video once again. What other models can I use that will be free or is this only for paid OpenAI accounts?

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

      As always, thanks for watching. As far as I know, there are no free APIs offered by OpenAI

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

    Hi that was a great session, could you please give me the complete path for this file which you had uploaded in Github Repo? thankyou!!

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

      Thanks. As I am mentioned, I took the code from the streamlit docs: docs.streamlit.io/knowledge-base/tutorials/build-conversational-apps

  • @Burmachach-zc2ls
    @Burmachach-zc2ls 2 หลายเดือนก่อน

    Thanks! I have a question, is it possible to do chat_input disabled till we get full response, and enable back again after we get it

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

      Thank you very much for watching the video and your comment. Your requirements are well noted. Yet, I receive many requests for creating individual solutions. As much as I want to help, I simply do not find the time in my daily schedule to develop & test all the different requests. I hope you can understand. Thank you! Cheers, Sven ✌️

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

    Thank you.. I have exhausted the openai api key usage... Are there any free options?

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

      Thanks for watching. Not that I know of.

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

    Hey, I need an Excel formula that can apply comma before an entirely uppercase word but without VBA cuz using VBA is not allowed in my company. Could you pls help me?

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

      Thanks so much for watching the video and leaving a comment! Your request is definitely noted. However, I get a ton of requests for custom solutions and, as much as I'd love to help everyone out, I just don't have the time in my schedule to develop and test all of them. I hope you can understand. Happy Coding!

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

      @@CodingIsFun okayy thankss

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

    Im trying to make code in such a way that if my input in streamlit chat is some specific questions then user get s options as buttons and on clicking that thing gets input in chat . I tried doing it but the buttons only work outside the if prompt loop seperately and not inside the prompt loop. Any solution?

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

      Thank you very much for watching the video and your comment. Your requirements are well noted. Yet, I receive many requests for creating individual solutions. As much as I want to help, I simply do not find the time in my daily schedule to develop & test all the different requests. I hope you can understand. Thank you! Cheers, Sven ✌️

  • @ma-kel
    @ma-kel ปีที่แล้ว

    Where was this last week! I was hired to make a chatgpt clone and was stuck thanks to you I can continue it

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

      This feature is fresh out of the oven and was just released on June 27. Good luck with your project! 🍀

    • @ma-kel
      @ma-kel ปีที่แล้ว

      @@CodingIsFun Thanks for the tutorial, I'll try my best.

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

    Isn't the streamlit folder and all the secrets visible in your github once you push the code?

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

      Thanks for watching. You don't want to push the secrets file to GitHub. Therefore, make sure to include it in the .gitignore file. Cheers, Sven ✌

  • @sumitranjan5212
    @sumitranjan5212 4 วันที่ผ่านมา

    How to put a attachment bUtton in the left corner of text input box??

    • @CodingIsFun
      @CodingIsFun  3 วันที่ผ่านมา

      That's natively not supported in Streamlit according to the docs: docs.streamlit.io/develop/api-reference/chat/st.chat_input
      Cheers, Sven 🤞

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

    This video is very interesting. The only issue is this requires Open API (Secret Key).

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

      Thanks for watching! 👍

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

      You can do it with gemini or any other open model from hugging face, for free

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

    I hate that thing I can't use chatgpt api with out a billing address. Maybe it's free but I need to give my bank details. I hate this about chatgpt api.

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

    Great video. However, I'm getting an error: "RateLimitError: You have exceeded your quota" and I haven't even generated a conversation using the API. Or are OpenAI APIs just whack

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

      Thanks for watching. Have a look here: help.openai.com/en/articles/6891831-error-code-429-you-exceeded-your-current-quota-please-check-your-plan-and-billing-details
      I hope it helps! Cheers, Sven ✌️

    • @sharonefsr24
      @sharonefsr24 11 วันที่ผ่านมา

      Hello, Did you debug the error? The same error I just went throw. Could you please say the steps taken to debug the error?

    • @arcanum360YT
      @arcanum360YT 10 วันที่ผ่านมา

      @@sharonefsr24 I wasn't able to

  • @user-tl3ko6vu7d
    @user-tl3ko6vu7d 22 วันที่ผ่านมา

    is we have to pay for the api of openai

    • @CodingIsFun
      @CodingIsFun  21 วันที่ผ่านมา

      You can use any other API / LLM if you want. I just use the OpenAI API as an example. Cheers, Sven ✌️

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

    🎉 can you create a sample projects calculator of Solar system

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

      Thank you very much for watching the video and your comment. Your requirements are well noted. Yet, I receive many requests for creating individual solutions. As much as I want to help, I simply do not find the time in my daily schedule to develop & test all the different requests. I hope you can understand. Thank you!

  • @shahinaperveen-yq4pb
    @shahinaperveen-yq4pb 9 หลายเดือนก่อน

    Please address my query, how to deploy a chatbot on our website?

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

      Ok, but please do not spam

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

    does this still work? i think open ai upfated and it says outdated.

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

      Thanks for watching. Yes, it works

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

      ​@@CodingIsFunNo, I've tried it and it updates. Mine is an error, please make a new tutorial video 😢🙏

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

      @@Aynay27 My example is staight from the docs: docs.streamlit.io/knowledge-base/tutorials/build-conversational-apps
      If you think, there is a bug in the Streamlit docs, you might want to raise a Github issue.

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

      @@CodingIsFun I don't think @tanyyu and @Aynay27 are referring to Streamlit, that part is fine! What doesn't work is the way you interact with the OpenAI API which indeed has updated and it doesn't work like it's showing on the video anymore as that is considered deprecated. The solution could be to either to downgrade the version of the OpenAI lib with `pip install` or to update the code to reflect the new OpenAI API on chat completions which would be something like:
      ```
      for response in OpenAI().chat.completions.create(
      model=st.session_state["openai_model"],
      messages=[
      {
      "role": m["role"],
      "content": m["content"],
      } for m in st.session_state[MESSAGES]
      ],
      stream=True,
      ):
      full_response += response.choices[0].delta.content or ""
      message_placeholder.write(full_response)
      ```

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

      @@Nuno_Reis_Official Thanks, that's a good point. Regarding my previous answer, I simply cannot give any advice without knowing the error message

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

    Great tutorial, but I have one small issue. From asking second question onwards, I find that all of the previous "assistant" content will display twice on the screen. Example of asking up to 3rd question and stop:
    User: Hi!
    Assistant: Hi, how can I help you?
    Assistant: Hi, how can I help you?
    User: Do you know CodingIsFun channel?
    Assistant: Yes, he teaches many Streamlit tutorials in his channel
    Assistant: Yes, he teaches many Streamlit tutorials in his channel
    User: Where is he from?
    Assistant: He is from Germany

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

      Thanks for watching. Hard to tell from a distance why you are facing an issue

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

      @@CodingIsFun I solved it 10 minutes ago 😂
      I didn't notice that my program saved the assistant response twice in the session.state.messages

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

    Can we share streamlit url to anyone?

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

      Yes, after you have deployed your app, you can also share the url. I already have tutorials here on my channel on how to deploy a Streamlit app. Cheers, Sven ✌️

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

      @@CodingIsFun thanks 😊

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

    Bro I’m aspiring data analyst but I am worried and really depressed because of gpt 4

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

      Don't worry. I suggest you get to know these tools well. Use them to help you work better and faster. I might actually make a separate video on this topic.

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

    Good job. Cool videos

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

      Thank you! Happy to hear that you're enjoying the videos! :)

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

    What is difference st.secrets vs os.getenv?

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

      The key difference is that os.getenv reads environment variables from the operating system, while streamlit.secrets provides a secure way to store and access sensitive data specifically within Streamlit applications, adding an extra layer of security when sharing or deploying these apps.