Code Monkey home page Code Monkey logo

bard-chatbot's Introduction

Bard Chatbot with Voice Input and Audio Playback

Bard Chatbot

A Python-based chatbot project that integrates the Bard API for natural language processing and voice interaction. This chatbot can listen to voice input, process user queries, and respond with audio output.

Prerequisites

Before getting started, make sure you have the following dependencies installed:

  • Python 3.x
  • Pygame library
  • SpeechRecognition library
  • dotenv library
  • Bard API credentials (You will need to sign up for Bard API and obtain API tokens)

You can install the required Python libraries using pip:

pip install -r requirements.txt

Configuration

  1. Create a .env file in the project directory and add your Bard API tokens:

    Secure_1PSID=your_secure_1PSID_token
    Secure_1PSIDCC=your_secure_1PSIDCC_token
    Secure_1PSIDTS=your_secure_1PSIDTS_token
  2. Make sure you have an active microphone connected to your system.

  3. (Optional) Make changes in .venv\Lib\site-packages\bardapi\core.py if gives any error like requests not found.

add at top:

import requests
  1. (Optional) Make changes in ..venv\Lib\site-packages\bardapi\models\tools\map.py if gives any error like Tuple not found.

add at top:

from typing import Optional, Tuple, List

Usage

Run the bard.py script to start the chatbot with voice input and audio playback:

python bard.py

The chatbot will listen for your voice input, process your queries using Bard API, and respond with audio output. You can speak your queries and receive spoken responses from the chatbot.

To exit the chatbot, simply say "exit" or type "/exit" in the text input. To stop audio, simply say "stop" or type "/stop" in the text input.

Features

  • Voice-based interaction with the chatbot.
  • Natural language processing powered by Bard API.
  • Audio responses for a more interactive experience.

Contributing

Contributions are welcome! If you'd like to improve this project or add new features, please fork the repository and submit a pull request. Feel free to open issues for bug reports or feature requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Thanks to the creators of Bard API for providing powerful natural language processing capabilities.
  • Special thanks to the open-source community for the libraries used in this project.

Replace your_secure_1PSID_token, your_secure_1PSIDCC_token, and your_secure_1PSIDTS_token in the .env section with your actual Bard API tokens.

bard-chatbot's People

Contributors

imkrishnasarathi avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

bard-chatbot's Issues

cannot install simpleaudio

when i try to install all modules in requirements.txt it says
ERROR: Could not build wheels for simpleaudio, which is required to install pyproject.toml-based projects

what shoud i do?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.