methunraj
refactor: restructure project with modular prompts and instructions
90b0a17

Prompts Directory

This directory contains all prompts used by the Data Extractor application in JSON format.

Structure

prompts/
β”œβ”€β”€ README.md (this file)
└── workflow/
    β”œβ”€β”€ data_extraction.json     # Financial data extraction prompt
    β”œβ”€β”€ data_arrangement.json    # Data organization prompt  
    └── code_generation.json     # Excel code generation prompt

JSON Format

Each prompt file follows this structure:

{
  "prompt": "The actual prompt text with {variable} placeholders",
  "variables": ["list", "of", "variable", "names"],
  "description": "Brief description of what this prompt does",
  "category": "workflow or other category"
}

Variables

Prompts can include variables in {variable_name} format. These are substituted when the prompt is loaded using the prompt_loader.load_prompt() function.

Usage

from utils.prompt_loader import prompt_loader

# Load prompt with variables
prompt = prompt_loader.load_prompt("workflow/data_extraction", 
                                  file_path="/path/to/document.pdf")

# Load prompt without variables  
prompt = prompt_loader.load_prompt("workflow/code_generation")