मन्त्रालयको सहमति लिई आयोगले बनाएको कार्यविधि बमोजिम गर्नु पर्नेछ । \n\n२१. विशेषज्ञको सेवा लिन सक्ने: (१) आयोगले आवश्यकता अनुसार निर्वाचनको कामको सम्बन्धमा विशेषज्ञको सेवा लिन सक्नेछ । \n\n(२) उपदफा (१) बमोजिम लिइएको विशेषज्ञको सेवाको कार्य विवरण र पारिश्रमिक आयोगले निर्धारण गरे बमोजिम हुनेछ । \n\n
}


Here is a sample pipeline for prompt to create a high-quality QA dataset.
from this just understand the prompt format:
"""
Nepal Legal QA Fine-Tuning Dataset Generator
===================================================
 - Updated SYSTEM_PROMPT_QA to strict QA schema and markdown answer format
 - Removed question-starter template hints from the user prompt flow
 - Enforced exactly 3 QA variants per section/dafa
 - Retained strict language, self-contained, and citation controls
"""

import os
import json
import asyncio
import argparse
import logging
import re
from pathlib import Path
from dataclasses import dataclass, field, asdict
from collections import defaultdict
from datetime import datetime, timezone

import aiofiles
from openai import AsyncOpenAI
from tqdm.asyncio import tqdm as atqdm

─────────────────────────────────────────────
Configuration
──────────────────────────────── ─────────────

@dataclass
class PipelineConfig:
 input_dir: str = "./laws"
 output_dir: str = "./output_v5"
 output_file: str = "nepal_legal_9law_QA_pairs.jsonl"
 failed_file: str = "failed_sections.jsonl"
 progress_file: str = "progress.json"

 model: str = "gpt-4.1-mini-2025-04-14"
 max_tokens_response: int = 4096
 temperature: float = 0.75 # slightly higher for more diverse phrasing

 max_chunk_size: int = 3000
 qa_pairs_per_section: int = 3
 max_concurrent_requests: int = 10
 retry_attempts: int = 3
 retry_delay: float = 2.0

 law_name_map: dict = field(default_factory=lambda: {
 "Constitution_Nepal_2072": "Constitution of Nepal, 2072 (2015)",
 "Criminal Procedure (Code) Act, 2017": "National Criminal Procedure (Code) Act, 2017",
 "National Civil Code 2017": "National Civil (Code) Act, 2017",
 "National Penal Code Act, 2017": "National Penal (Code) Act, 2017",
 "नेपालको संविधान, २०७२": "नेपालको संविधान, २०७२",
 "मुलुकी अपराध संहिता, २०७४": "मुलुकी अपराध संहिता, २०७४",
 "मुलुकी देवानी (संहिता) ऐन, २०७४": "मुलुकी देवानी (संहिता) ऐन, २०७४",
 "मुलुकी देवानी कार्यविधि ऐन, २०७४": "मुलुकी देवानी कार्यविधि ऐन, २०७४",
 "मुलुकी फौजदारी कार्यविधि संहिता, २०७४": "मुलुकी फौजदारी कार्यविधि स ंहिता, २०७४",
 })

─────────────────────────────────────────────
Progress Tracker — unchanged from V3
─────────────────────────────────────────────

class ProgressTracker:
 def __init__(self, progress_path: Path):
 self.path = progress_path
 self.data = {
 "completed_section_ids": [],
 "total_pairs_generated": 0,
 "failed_section_ids": [],
 "pairs_per_law": {},
 "last_updated": None,
 "started_at": None,
 "status": "not_started",
 }
 self._lock = asyncio.Lock()

 def load(self) -> bool:
 if self.path.exists():
 try:
 with open(self.path, "r", encoding="utf-8") as f:
 saved = json.load(f)
 self.data.update(saved)
 logging.info(
 f"Resumed: {self.data['total_pairs_generated']} pairs, "
 f"{len(self.data['completed_section_ids'])} sections done"
 )
 return True
 except Exception as e:
 logging.warning(f"Could not load progress: {e}.