From 8baa31e07ef23b9697d1774a34ec6505967dcb65 Mon Sep 17 00:00:00 2001 From: GeorgeWebberley Date: Sun, 1 Mar 2026 12:28:05 +0100 Subject: [PATCH] Refined ai parser. Updated .env.example --- .env.example | 3 +++ src/cases/parser/parser.service.ts | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 2a65ae3..4dc8043 100644 --- a/.env.example +++ b/.env.example @@ -16,3 +16,6 @@ STORAGE_SECRET_KEY=minioadmin STORAGE_BUCKET=cases STORAGE_REGION=us-east-1 STORAGE_FORCE_PATH_STYLE=true + +# AI Config +GOOGLE_API_KEY=your_gemini_api_key_here \ No newline at end of file diff --git a/src/cases/parser/parser.service.ts b/src/cases/parser/parser.service.ts index a90914e..7d71270 100644 --- a/src/cases/parser/parser.service.ts +++ b/src/cases/parser/parser.service.ts @@ -11,10 +11,13 @@ const CaseMetadataSchema = z.object({ office: z.string().describe("The specific department, chamber, or administrative division within the court system."), court: z.string().describe("The court's full official name of the adjudicating body. Do not use relative references; instead, identify the institution from the document header, the formal seal, or the specific treaty/statute that establishes its jurisdiction."), caseNumber: z.string().describe( - "The formal administrative or legal identifier assigned to the matter." + "The formal administrative or legal identifier assigned to the matter. " + + "Look for unique alphanumeric codes (often containing slashes, dashes, or prefixes like 'No.', 'Ref.', or 'Sag') " + + "usually located in the document header, top margin, or immediately following the title." ), summary: z.string().describe( - "A concise brief of the dispute and the final determination." + "A concise brief of the dispute and the final determination. " + + "Focus on 'The Issue' (what was being decided) and 'The Disposition' (the final ruling or outcome)." ), });