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.
Before getting started, make sure you have the following dependencies installed:
You can install the required Python libraries using pip:
pip install -r requirements.txt
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
Make sure you have an active microphone connected to your system.
(Optional) Make changes in
.venv\Lib\site-packages\bardapi\core.py
if gives any error like requests not found.
add at top:
import requests
..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
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.
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.
This project is licensed under the MIT License - see the LICENSE file for details.
Replace your_secure_1PSID_token
, your_secure_1PSIDCC_token
, and your_secure_1PSIDTS_token
in the .env
section with your actual Bard API tokens.