Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Directory Reader with LlamaIndex

A Python application that reads documents from a local directory and answers questions about their content using OpenAI's GPT models and LlamaIndex.

Features

  • Read multiple documents from a local directory
  • Convert document content into vector embeddings
  • Query documents with natural language questions
  • Uses OpenAI's GPT for intelligent responses
  • Support for various file formats

Prerequisites

  • Python 3.8+
  • OpenAI API key

Installation

  1. Clone or download this project
  2. Install dependencies:
pip install llama-index llama-index-core llama-index-llms-openai python-dotenv

Setup

  1. Create a .env file in the project root:
OPENAI_API_KEY=your_api_key_here
  1. Get your API key from OpenAI Platform

Usage

Run the script:

python directoryreader.py

How It Works

  1. Reads all documents from the specified directory
  2. Creates vector embeddings of the content
  3. Builds a searchable index
  4. Answers your query using OpenAI's GPT model

Configuration

Update the main() function with your directory path:

main(url=r"your_directory_path_here")

Rate Limits

  • Free tier: 3 requests per minute
  • Upgrade your OpenAI account for higher limits

License

MIT License - See LICENSE file for details

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages