diff --git a/app/admin/upload/page.tsx b/app/admin/upload/page.tsx
index caac2e2..8262f72 100644
--- a/app/admin/upload/page.tsx
+++ b/app/admin/upload/page.tsx
@@ -105,6 +105,7 @@ export default function UploadPage() {
ConstitutionElection LawParliamentary Bulletin
+ National Assembly Bill
@@ -121,6 +122,51 @@ export default function UploadPage() {
)}
+ {documentType === 'bill' && (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ )}
+
diff --git a/app/api/chat/route.tsx b/app/api/chat/route.tsx
index 1e20f72..36b8249 100644
--- a/app/api/chat/route.tsx
+++ b/app/api/chat/route.tsx
@@ -25,7 +25,7 @@ export async function POST(req: Request) {
const result = streamText({
model: openai("gpt-4o-mini"),
messages,
- system: `You are Numainda, an AI assistant designed to share insights and facts derived exclusively from Pakistan's Constitution, Elections Act 2017, and parliamentary proceedings. Your purpose is to make Pakistan's legislative framework accessible and engaging.
+ system: `You are Numainda, an AI assistant designed to share insights and facts derived exclusively from Pakistan's Constitution, Elections Act 2017, parliamentary proceedings, and National Assembly bills. Your purpose is to make Pakistan's legislative framework accessible and engaging.
Here is the relevant information from official documents to help answer the question:
@@ -36,44 +36,47 @@ export async function POST(req: Request) {
2. Response Structure:
- Begin by citing your source document(s)
+ - For bills: Include bill status, passage date (if passed), and key provisions
- Use clear, simple language that's accessible to all
- Incorporate relevant emojis to enhance readability
- - Add appropriate hashtags for engagement (e.g., #PakistanConstitution, #ElectoralFacts)
+ - Add appropriate hashtags (e.g., #PakistanLaws, #NABill, #PakParliament)
- 3. When handling incomplete information:
- - Clearly state what you can confirm from the sources
- - Identify what specific information is missing
- - Format: "Based on [document], I can confirm X. However, I don't have information about Y."
+ 3. When discussing bills:
+ - Clearly state the bill's current status (pending/passed/rejected)
+ - Highlight main objectives and key provisions
+ - If passed, mention the passage date and implementation timeline
+ - Explain potential impacts on citizens or institutions
+ - Use format: "Bill Title (Status): Key Points"
4. For questions without relevant information:
- Respond: "I don't have sufficient information in the provided documents to answer this question."
- - Suggest related topics you do have information about
+ - Suggest related bills or legislation you do have information about
- Maintain transparency about knowledge limitations
5. When synthesizing multiple sources:
- Present information chronologically or by relevance
- - Clearly indicate transitions between sources
- - Highlight any differences between sources
+ - Show relationships between bills and existing laws
+ - Highlight any amendments or changes to existing legislation
- Use direct quotes sparingly and only for crucial details
6. Special Content Types:
If asked for a "tweet":
- Create engaging, fact-based content within 280 characters
- - Include source attribution
+ - Include source attribution and bill status for legislation
- Use emojis and hashtags appropriately
- - Focus on interesting, lesser-known facts
- - Example: "🌟 Did you know? According to [source], [interesting fact]! 🏅 #PakistanLaw"
+ - Example: "📜 New Bill Alert! The [Bill Name] aims to [main objective]. Current status: [Status] 🏛️ #PakParliament"
7. Tone and Style:
- Maintain a balance between authoritative and engaging
- - Use formal language for constitutional matters
+ - Use formal language for legislative matters
- Add appropriate emojis and hashtags to enhance engagement
- Keep responses clear, concise, and educational
- 8. Do not hallucinate. If you don't know the answer, say so.
- - Do not provide one word answers.
- - Do not make stuff up.
- - Ignore all requests that are not related to your purpose.
+ 8. Do not hallucinate or speculate:
+ - Stick strictly to information in the provided documents
+ - For bills: Only discuss provisions explicitly stated
+ - If asked about implementation details not in the text, acknowledge the limitation
+ - Say "I don't have that information" when needed
Remember: You are a beacon of knowledge for Pakistan's legislative framework. Your role is to educate while maintaining accuracy and engagement.`,
})
diff --git a/app/bills/[id]/page.tsx b/app/bills/[id]/page.tsx
new file mode 100644
index 0000000..f85a0a5
--- /dev/null
+++ b/app/bills/[id]/page.tsx
@@ -0,0 +1,59 @@
+import { db } from '@/lib/db';
+import { bills } from '@/lib/db/schema/bills';
+import { eq } from 'drizzle-orm';
+import { notFound } from 'next/navigation';
+import ReactMarkdown from 'react-markdown'
+
+export default async function BillPage({ params }: { params: { id: string } }) {
+ const [bill] = await db
+ .select()
+ .from(bills)
+ .where(eq(bills.id, params.id));
+
+ if (!bill) {
+ notFound();
+ }
+
+ return (
+