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

Поділитися
Вставка
  • Опубліковано 15 січ 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.

  • @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

  • @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.

  • @gamewithlegand6626
    @gamewithlegand6626 Рік тому +2

    This is work in hindi language use own hindi data ?

    • @Analyticsvidhya
      @Analyticsvidhya  11 місяців тому

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

  • @bhuvanachatti7881
    @bhuvanachatti7881 9 днів тому

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

  • @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

  • @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/

  • @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..

  • @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

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

    Cool ! Thanks you for sharing.

  • @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.

  • @zedcodinacademibychinvia9481

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

  • @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

  • @it.a.28.piusdas3
    @it.a.28.piusdas3 3 місяці тому

    can you add streamlit front page to this

  • @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.

  • @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: ua-cam.com/video/3z0a3Ymwj1k/v-deo.htmlsi=MmaeBqqiBlg6e_Ld

  • @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.

  • @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: ua-cam.com/video/pJAzg8CORYI/v-deo.html

  • @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.

  • @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.

  • @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

  • @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..

  • @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: ua-cam.com/video/VKa_qDtGaYo/v-deo.html

  • @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: ua-cam.com/video/3z0a3Ymwj1k/v-deo.html

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

    amazing on how to get session key

  • @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.

  • @asthajain7207
    @asthajain7207 9 місяців тому

    I'm getting the response error ..

    • @Analyticsvidhya
      @Analyticsvidhya  9 місяців тому

      Please read through the comments section for a resolution.

  • @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

  • @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')

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

    Where r the files, link,

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

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

  • @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?

  • @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

  • @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: ua-cam.com/video/pJAzg8CORYI/v-deo.html
      2️⃣ Build GenAI Code Explainer App: ua-cam.com/video/c0w-EvhU8fE/v-deo.html

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

    doesnt work

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

      Check the other similar comments for troubleshoot.
      Get Free access to PaLM API here: ua-cam.com/video/c0w-EvhU8fE/v-deo.html

  • @khairinnadia683
    @khairinnadia683 7 місяців тому

    can i use jupyter instead of google colab?

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

    Getting erro

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

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

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

    "promosm" 😩

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

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

  • @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

  • @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: ua-cam.com/video/c0w-EvhU8fE/v-deo.html

  • @kailashkumar7623
    @kailashkumar7623 8 місяців тому +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  8 місяців тому

      Try using the free Gemini API, as demonstrated in this video: ua-cam.com/video/3z0a3Ymwj1k/v-deo.html