ChatGPT / BARD API - Build a FREE Chatbot in Python w/ Google Colab

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

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

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

    Book FREE 1:1 Mentorship for Gen AI / Data Science
    Link 🔗 bit.ly/3wlIIGz

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

    Very helpful vid. Thanks Vidhya!

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

    I followed all the step which you have mentioned but I'm getting error (Exception: SNlM0e value not found. Double-check __Secure-1PSID value or pass it as token='xxxxx'.) can you please help me in that.

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

      Looks like your Secure 1PSID key is not correct. Could you double check that? Follow the steps mentioned in the video and copy the Secure 1PSID from the "Inspect" section.
      Which Browser are you using, anyways?

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

      @@Analyticsvidhya Did that already. Actually sometimes it is working some time it is not.

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

      @@Pradip_Deshmukh Excessive traffic

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

      Here's a resolution to the error you're facing: github.com/dsdanielpark/Bard-API/issues/99#issuecomment-1633060128

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

      @@Analyticsvidhya Yessss now it's working. Thank you so much sir, I really appreciate that you are not just replying to the comment but also providing the solution as well. Thank you once again.

  • @Paul-ib4lu
    @Paul-ib4lu ปีที่แล้ว +2

    This is interesting! Can't wait to try this.

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

    when i run pip install bardapi and thenn try to import it return me module not found error i also restarted run time but no use, what to do sir help me ?

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

      Try changing interpreter, worked for me but still no luck with the __Secure-1PSID

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

      Here's a resolution to the error you're facing: github.com/dsdanielpark/Bard-API/issues/99#issuecomment-1633060128

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

      @@Analyticsvidhya got it bro I need to clear cookies and copy new api 🔐, it worked after i cleared cookies

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

    Thank you for the video. It's really helpful.

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

    Cool ! Thanks you for sharing.

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

    Just not a good way to get the API. Bard API is in beta and can be obtained legally only via Google cloud platform console. Getting the API the way you showed is not really the way to go.

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

      Hi Noam, the learning objective of this video is to enable GenAI aspirants to get a hang of LLM API. At the time when this video was launched, Google PaLM API was not available for use (Now it is, via Google's MakerSuite Platform).
      And we have clearly mentioned in the video that it's not for production use. Just for educational hands-on.

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

      ​@@Analyticsvidhyawhat we required to do for Production need to show my target person to solve their work through this as you understand want to sell that solution.
      Please make a video for guidance of custom sell chatbot

  • @bhuvanachatti7881
    @bhuvanachatti7881 13 วันที่ผ่านมา

    I am getting response error i checked many times but it still comming like that

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

    This is work in hindi language use own hindi data ?

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

      Yes, it will work in Hindi language, as well!

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

    Please dont ever use this generic stock music in the background, makes the whole thing seem very very amateurish, which is not cool because your content is very good

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

    Sir,I got a problem at the time of running the simplest chatbot section also,I can't understand how to solve the problem, it's showing error

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

    one of the most informative videos out here, Thank you so much.
    Question, I am working on a project to provide paid and free AI's for those of us in places such products aren't available or easy to access. I was curious as to how I can integrate these AI's into a website or bots in Telegram, or is it possible to follow these same steps on a website hosting servers?

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

      Yes, it's absolutely possible to integrate LLM functionality on Website/App (using a paid API of ChatGPT / PaLM). However, be careful that Google Bard API that we have used in this video is purely meant for educational purposes. If you make queries on the API beyond a certain threshold, your Google Account might get impacted. So, be very careful..

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

    Great video, when i try to import the BardApi i get this.
    ModuleNotFoundError: No module named 'bardapi'
    I have done the pip install bardapi
    Please help 😇

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

      Once you pip install bardapi, you should restart runtime, comment pip install and then import bardapi. Should work then..

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

      @@Analyticsvidhya Thanks I got that part working now. :)
      But now i get the "Exception: SNlM0e value not found. Double-check __Secure-1PSID value or pass it as token='xxxxx'." instead.
      I have checked the __Secure-1PSID and it's correct.
      Any ideas?

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

      @@priimeone I'm also getting same issue.

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

      @@Pradip_Deshmukh Which? ModuleNotFoundError: or __Secure-1PSID ?

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

      @@priimeone I was using Opera Browser at first, it doesn't work. Then i moved to Edge, it worked only one time. I think it's a matter of traffic.

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

    NameError Traceback (most recent call last)
    in ()
    2
    3 # creating a pdf reader object
    ----> 4 pdfReader = PdfReader(pdfFileObject)
    5 text=[]
    6 summary=' '
    NameError: name 'pdfFileObject' is not defined
    i got this error why??

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

      Double check on the part where you defined pdfFileObject:
      pdfFileObject = open(directory+filename, 'rb')

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

    Did create the files you used for this demonstration?
    Secondly, is there special place we can get files in the event of doing use case scenario.

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

      Dear Ali, link to download reference files is provided in the description part of this video. Do check that out.

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

      @@Analyticsvidhya Thank you. I really appreciate how you help solve queries. I will really like to learn how to fully delve into chatbot, is there a program I can really learn with hands-on from beginner to pro. Even if it require me paying.

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

    wonderful video, but you did not explain how to obtain the api keys!

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

      You got me :)
      Here's a short article from our blog, where we have detailed the step-by-step process: www.analyticsvidhya.com/blog/2023/05/how-to-use-chatgpt-api-in-python/

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

    thank you much it's really helpful and i have some doubts about creation of chatbot please clear it

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

      Glad you liked it. Do share your queries here, please.

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

    I keep getting an exception "Bard API Key must be provided as token argument or extracted from browser."

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

      Try this resolution: Here's a resolution to the error you're facing: github.com/dsdanielpark/Bard-API/issues/99#issuecomment-1633060128
      Alternatively, Google now offers free API key to it's Gemini Model. Here's a quick hands-on tutorial: th-cam.com/video/pJAzg8CORYI/w-d-xo.html

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

    i have a doubt why i have to add all my data in prompt ? using bard cant i just question him based on the data i push.. just like open source ? am new to AI just curious

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

      The thing is this: Bard has a limit on the input Prompt character length of 4000 characters. So, we have to split our book text into small chunks and then feed them to Bard.
      It's also possible to feed entire data within your prompt, with pre-condition being - it should be less than character limit.

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

    Hello, Hope you do well. I used Google Colab and used you exactly and I get an error. Could you please help me I have no experience in coding. I don't know what is wrong.
    I would greatly appreciate your help. Have a great day. Best regards Johan

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

      Could you elaborate the issue/error you got? Just go through the other comments on the video. And see if your issue is already discussed and resolved.

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

    Are the APIs all the same.. i.e. is OpenAPI the same as the API used with Bard, Gemini, OpenAI's Assistant API , Au Mistral, Gemini Pro, llama2 , FastAPI etc?
    I'm interested in creating a Python application to do some basic OCR.. and if I use ChatGPT4 Assistant API (Vision/AI PDF Plugin) then I just pay the API costs whenever someone uses my application.
    Alternatively, if host an open-source model like Ollama on my own computer or on the cloud (beam cloud/ Replicate/Streamlit/replit) then I would just pay for cloud? Is there a model that is already hosted and can be accessed without a paid subscription key?
    For example, if my application uses a model on Google Colab what are the limitations?

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

      Hi Ben, all providers generally share their own documentation for consuming their APIs, like: OpenAI, Google, Mistral, Anthropic.
      If you are consuming some model via Huggingface API (for the limited Open Source models available there), then there's a single documentation you need to follow.
      Additionally, Colab is not a platform where you can deploy your Apps. You may do that on Huggingface Spaces (if you are looking for a free platform). Alternatively, you may try out AWS/Azure/GCP - and start off with the free credits they offer.

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

    sir is it possible to customize the chatbot so that it can only answer questions on agriculture

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

      Yes. Just treat your prompt accordingly.

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

    Hi, I am testing Chatbot with chatgpt API, but it is showing error for response = get_completion(prompt) as now v1 is migrated to newer one. Can you help me with the code for latest version?

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

      Check out this latest video, where we used Google Gemini API..

  • @SamraShaikh-wu8im
    @SamraShaikh-wu8im 6 หลายเดือนก่อน

    How can we make a custom chatbot specially for education purpose by using gemini

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

      Dear learner, drop an email to our Career Counselling team & we’ll help you out with all the information: ummed@analyticsvidhya.com
      Alternatively, you may call on the any of the following numbers:
      Line1: +91 8068342847
      Line2: +91 8046107668

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

    Can I use it for my 3rd year project

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

      Yes, of course. Just one update, you may use Gemini API. Here's the tutorial: th-cam.com/video/3z0a3Ymwj1k/w-d-xo.htmlsi=MmaeBqqiBlg6e_Ld

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

    i get an error when i try to use my cookie id, is it because it is turned to gemini?

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

      Check out this latest tutorial: th-cam.com/video/3z0a3Ymwj1k/w-d-xo.html

  • @Programmer01-d3y
    @Programmer01-d3y ปีที่แล้ว

    Can we build chatbot after training our deeplearning model and how can we execute that in google colab?,I am new to this field Can you please help me?

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

      Absolutely! With your trained deep learning model, building a chatbot on Colab is exciting. Here's what's next:
      1. Interface: Craft a way for users to chat (text input/GUI). Python libraries like ChatterBot can help.
      2. Connect: Bridge your model's predictions to the interface - it'll understand and respond to user input!
      3. Deploy: Host your chatbot online (Colab's temporary, consider cloud platforms later).
      Resources like Rasa and Dialogflow can further enhance your chatbot features. Let me know if you need specific library pointers!

    • @Programmer01-d3y
      @Programmer01-d3y ปีที่แล้ว

      @@Analyticsvidhya okay thankyou if any doubts happening in my projects,i will ask u can u clear my doubts?

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

    I'm working on a self-project and it needs a simple chatbot to help with productivity. How do I export this model so that I can use it on my application?

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

      You'll need to adopt this Jupyter Notebook code to write an App Code for your Application. Could you tell a bit more about your app-building idea, so I may share specific info.

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

      @@Analyticsvidhya I'm working with Flutter at the moment. How do i configure my project for that?

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

      Refer to this video on our channel to know more on this: th-cam.com/video/VKa_qDtGaYo/w-d-xo.html

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

    how to train this ?

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

      Dear learner, drop an email to our Career Counselling team for a free mentorship session: ummed@analyticsvidhya.com
      Alternatively, you may call on the any of the following numbers:
      Line1: +91 8068342847
      Line2: +91 8046107668

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

    Project link will be useful! Thanks :)

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

      Here's the link: docs.google.com/document/d/1NXyhKfj2ckQBXE0xqoI2gKD_2K-7QvfY_JoreITrpf4/edit?usp=sharing

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

    I'm getting the response error ..

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

      Please read through the comments section for a resolution.

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

    Sir i have one problem now it is showing that RAISE EXCEPTION BARD API KEY PROVIDED OR EXTRACTED FROM BROWSER.
    Bard Api key must be provided or extracted from browser...
    While still i have copied from The cookies .... Pls help pls help

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

      Dear learner, please check this resolution link for the error you're facing: github.com/dsdanielpark/Bard-API/issues/99#issuecomment-1633060128

  • @it.a.28.piusdas3
    @it.a.28.piusdas3 3 หลายเดือนก่อน

    can you add streamlit front page to this

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

    amazing on how to get session key

  • @kailashkumar7623
    @kailashkumar7623 9 หลายเดือนก่อน +2

    not working, the erroe is:
    "{'content': 'Response Error: b\')]}\\\'\
    \
    38\
    [["wrb.fr",null,null,null,null,[7]]]\
    54\
    [["di",51],["af.httprm",51,"5319462573973445201",0]]\
    25\
    [["e",4,null,null,129]]\
    \'.
    Unable to get response.
    Please double-check the cookie values and verify your network environment or google account.'}
    "

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

      Try using the free Gemini API, as demonstrated in this video: th-cam.com/video/3z0a3Ymwj1k/w-d-xo.html

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

    Can we access the "input image" feature of the bard by making this API call? Also is there any option for fine-tuning available on the free version of bard??

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

      For "Input Image" feature, let us get back to you. Regarding fine-tuning BARD (PaLM-2 Model), unfortunately it's not freely avaiable.

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

      @@Analyticsvidhya is there any method available where we can ask bard to access the contents of an image using API calls?

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

    Just to clarify - this is not an API. This is quote on quote "illegal" and I don't recommend doing this. Also, the token refreshes every 20 minutes or so, so it's very inpractical.

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

      Hey! Learning objective of this video is to enable GenAI aspirants to get a hang of LLM API. At the time when this video was launched, Google PaLM API was not available for use (Now it is, via Google's MakerSuite Platform). And we have clearly mentioned in the video that it's not for production use. Just for educational hands-on.
      Additionally, now have PaLM API Hands-on Video live on the channel. Take a look:
      1️⃣ Get PaLM API Key Free: th-cam.com/video/pJAzg8CORYI/w-d-xo.html
      2️⃣ Build GenAI Code Explainer App: th-cam.com/video/c0w-EvhU8fE/w-d-xo.html

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

    Where r the files, link,

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

      Here's the link: drive.google.com/drive/folders/1fKdRQ2zSX86B50vEOplstwE77tboIrrf?usp=sharing

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

    doesnt work

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

      Check the other similar comments for troubleshoot.
      Get Free access to PaLM API here: th-cam.com/video/c0w-EvhU8fE/w-d-xo.html

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

    "promosm" 😩

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

    can i use jupyter instead of google colab?

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

    Exception: SNlM0e value not found. Double-check __Secure-1PSID value or pass it as token='xxxxx'.

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

      Here's a resolution to the error you're facing: github.com/dsdanielpark/Bard-API/issues/99#issuecomment-1633060128

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

    Getting erro

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

      Hi Subhadip, could you please share the error message you're getting?

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

    Please help what I choose secure -1PSIDC OR -1PSIDCC

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

      This is the key you need "__Secure-1PSID"

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

    Ugh....this error is killing me
    JSONDecodeError Traceback (most recent call last)
    in ()
    2 # input_text = "Why is the sky blue?"
    3 input_text = "What is the current status of Ashes Series 2023"
    ----> 4 print(Bard().get_answer(input_text)['content'])
    3 frames
    /usr/lib/python3.10/json/decoder.py in raw_decode(self, s, idx)
    353 obj, end = self.scan_once(s, idx)
    354 except StopIteration as err:
    --> 355 raise JSONDecodeError("Expecting value", s, err.value) from None
    356 return obj, end
    JSONDecodeError: Expecting value: line 1 column 1 (char 0)
    please help

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

      Hey, don't fret on this. Between the time this video was released to now, Google has made it's Gemini Model API available on: aistudio.google.com
      Here's a quick tutorial to get your free API key from here: th-cam.com/video/c0w-EvhU8fE/w-d-xo.html