Skip to content

danielibarrola/sql-generator

Repository files navigation

AI SQL Generator

A conversational AI application designed to generate synthetic data and perform natural language data querying on SQL schemas. This project uses Google's Gemini 2.0 Flash model, Streamlit for the UI, and PostgreSQL for data storage.

Prerequisites

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd ai-app
  2. Install uv (if not installed):

    # On macOS/Linux
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    # On Windows
    powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
  3. Install Dependencies: This command creates a virtual environment and installs both project and development dependencies (like pytest, pylint, mypy).

    uv sync --extra dev
  4. Environment Setup: Create a .env file in the root directory based on your configuration:

    # .env
    # Google Cloud / Vertex AI
    GOOGLE_CLOUD_PROJECT=your-project-id
    GOOGLE_CLOUD_LOCATION=us-central1
    
    # Database
    DB_USER=postgres
    DB_PASSWORD=postgres
    DB_NAME=synthetic_db
    DB_HOST=db
    DB_PORT=5432
    
    # Langfuse
    LANGFUSE_SECRET_KEY=sk-lf-...
    LANGFUSE_PUBLIC_KEY=pk-lf-...
    LANGFUSE_HOST=https://cloud.langfuse.com

Running the Application

This spins up both the Streamlit app and the PostgreSQL database.

docker compose up

Code Quality & Testing

This project uses pylint for linting and mypy for static type checking.

Run Linting:

uv run pylint src tests

Run Type Checking:

uv run mypy

Run Tests:

uv run pytest

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published