Skip to content

vickytr44/QueryDataUsingNaturalLanguage

Repository files navigation

QueryDataUsingNaturalLanguage

Project Overview

QueryDataUsingNaturalLanguage is a Python-based toolkit that enables users to generate graphql query from natural language. It leverages advanced language models and modular components to interpret user requests, generate queries, and return results in a user-friendly format.

Features

  • Convert natural language requests into structured queries
  • Modular architecture for easy extension
  • Error resolution and query validation
  • Report and chart generation from data
  • Example-driven modules for learning and testing

Prerequisites

This project uses the Azure OpenAI service so you will need azure open ai endpoint.

If you wish to use a different service (such as OpenAI directly), you will need to update the code and environment variables accordingly.

Installation

Environment Variables

Before running the application, create a .env file in the project root with the following variables:

#OPENAI_API_KEY=your_openai_api_key
AZURE_OPENAI_API_KEY=your_azure_openai_api_key
OPENAI_API_VERSION=your_api_version
AZURE_OPENAI_ENDPOINT=https://your-azure-openai-endpoint/
MODEL_NAME=your_model_name

Replace the placeholder values with your actual API keys and endpoint information. Do not share your secret keys publicly.

  1. Clone the repository:

    git clone https://github.com/vickytr44/QueryDataUsingNaturalLanguage.git
    cd QueryDataUsingNaturalLanguage
  2. Install dependencies:

    pip install -r requirements.txt

Usage

You can run the main application using:

python main.py

Modify or extend the modules in the DspyModules/ directory to customize functionality.

Project Structure

QueryDataUsingNaturalLanguage/
├── main.py                  # Entry point for the application
├── dto.py                   # Data transfer objects
├── prompt.py                # Prompt templates and logic
├── query_validator.py       # Query validation logic
├── token_utils.py           # Tokenization utilities
├── requirements.txt         # Python dependencies
├── DspyModules/             # Modular components for query, report, and error handling
├── Examples/                # Example scripts and use cases
├── OptimizedPrograms/       # Pre-trained or optimized models
├── Schema/                  # Schema definitions

Contact

For questions, issues, or suggestions, please open an issue on the GitHub repository or contact the maintainer at vickytr44@gmail.com or https://www.linkedin.com/in/vickraman-tr-54670313b/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages