Steps to run Ai Assistant

Step 1: Install Conda

If you haven’t installed Conda yet, download and install it from the official Anaconda website.

Step 2: Create a Conda Environment

Open your terminal or command prompt and create a new Conda environment:

$conda create -p venv python=3.12

Replace venv with your desired environment name and adjust the Python version if needed.

Step 3: Activate the Environment

Activate your newly created environment:

# On Windows
conda activate myenv/

# On macOS/Linux
conda activate myenv/

Step 4: Install Packages from requirements.txt

Create a requirements.txt file in your project directory with the following content:

openai
opencv-python
numpy
python-dotenv
langchain
langchain-openai
pyaudio
SpeechRecognition
mss

Then, install the packages using pip within your Conda environment:

$pip install -r requirements.txt

Step 5: Generate OpenAI API Key

  1. Visit OpenAI’s Platform Website: Go to OpenAI’s Platform and sign in with your account. If you don’t have an account, create one using the provided options (e.g., email, Google, or Microsoft).
  2. Access API Keys: Click on your profile icon in the top-right corner and select “View API Keys” from the dropdown menu.
  3. Generate a New API Key: On the API keys page, click “Create New Secret Key.” This will generate a new API key.
  4. Save the API Key: Copy and save the API key securely. You won’t be able to view it again once the window closes.

Step 6: Generate Google API Key

  1. Access Google Cloud Console: Navigate to the Google Cloud Console.
  2. Select Your Project: Ensure the correct project is selected from the dropdown menu at the top.
  3. Navigate to Credentials: Click on the navigation menu and select “APIs & Services” > “Credentials.”
  4. Create Credentials: Click on “Create Credentials” and choose “API key.”
  5. Generate API Key: A new API key will be generated. You can restrict its usage by specifying services like Google Maps if needed.
  6. Save the API Key: Copy and save the API key securely. It will be your authentication key for accessing Google Cloud services.

Step 7: Set Up .env File

Create a .env file in your project root and add your API keys:

OPENAI_API_KEY=your_openai_api_key_here
GOOGLE_API_KEY=your_google_api_key_here

Replace your_openai_api_key_here and your_google_api_key_here with the actual keys you generated.

Once Everything is setup and installed, please run below command to run the assistant.

$ python assistant.py