Skip to content

Latest commit

 

History

History
109 lines (66 loc) · 3.55 KB

File metadata and controls

109 lines (66 loc) · 3.55 KB

PythonAgentAI

The PythonAgentAI project aims to leverage advanced OpenAI models (including gpt-4o-mini with a 128k context window) to perform a variety of AI-powered tasks. This project integrates Scrapeless for Google Maps and the llama-index library (version 0.12.22) along with its experimental extensions to enable large language models to provide real-time responses.

Features

  • Integration with OpenAI’s gpt-4o-mini model, supporting a 128k context window.
  • Modular code structure including components like main.py, pdf.py, prompts.py, and note_engine.py.
  • Advanced indexing and querying via llama-index and llama-index-experimental libraries.

Installation

Prerequisites

Configuration

  1. Create the .env File

    The project requires a .env file for storing environment variables, including the OpenAI API key. You can create it by running:

    cp .env.example .env
  2. Set Your OpenAI API Key

    Open the .env file in a text editor and configure your OpenAI API key:

    OPENAI_API_KEY=your_openai_api_key_here
    

    Replace your_openai_api_key_here with your actual API key from OpenAI.

Get the Scrapeless API key

Setup Instructions

  1. Clone the Repository

    Open your terminal and run:

    git clone https://github.com/your-username/PythonAgentAI.git
    cd PythonAgentAI
  2. Create a Virtual Environment

    It's recommended to use a virtual environment to manage dependencies. To create one using Python's venv module:

    python3.11 -m venv env
  3. Activate the Virtual Environment

    • On Unix or macOS:

      source env/bin/activate
    • On Windows:

      .\env\Scripts\activate
  4. Install Dependencies

    With the virtual environment activated, install the required packages:

    pip install -r requirements.txt

    This will install the following essential packages:

    • llama-index==0.12.22
    • llama-index-experimental==0.5.4
    • pypdf==5.3.1
    • python-dotenv==1.0.1
    • pandas==2.2.3

Usage

After setting up the environment and installing the dependencies, you can run the main script:

python main.py

Ensure that you have configured any necessary environment variables or settings required by the script. Refer to the prompts.py and note_engine.py files for customizable parameters and functionalities.

  1. Input the provided prompts to receive results. After a short wait, you’ll see output similar to the images below:
  • Find the highest rated coffee shop within 0.5km

Result of the highest rated coffee shop within 0.5km

  • Find the closest coffee shop to the target location

Result of the closest coffee shop to the location