89 lines
4 KiB
Text
89 lines
4 KiB
Text
|
|
Analyze the following user command and extract the intent, entity, and parameters.
|
|
|
|
User Command: "Welche Projekte in Zürich gibt es?"
|
|
|
|
Available intents:
|
|
- CREATE: User wants to create a new entity
|
|
- READ: User wants to read/query entities
|
|
- UPDATE: User wants to update an existing entity
|
|
- DELETE: User wants to delete an entity
|
|
- QUERY: User wants to execute a database query (SQL statements)
|
|
|
|
Available entities and their fields:
|
|
|
|
**Projekt** (Real estate project):
|
|
- id: string (primary key)
|
|
- mandateId: string (mandate ID)
|
|
- label: string (project designation/name)
|
|
- statusProzess: string enum (Eingang, Analyse, Studie, Planung, Baurechtsverfahren, Umsetzung, Archiv)
|
|
- perimeter: GeoPolylinie (geographic boundary, JSONB)
|
|
- baulinie: GeoPolylinie (building line, JSONB)
|
|
- parzellen: List[Parzelle] (plots belonging to project, JSONB)
|
|
- dokumente: List[Dokument] (documents, JSONB)
|
|
- kontextInformationen: List[Kontext] (context info, JSONB)
|
|
|
|
**Parzelle** (Plot/parcel):
|
|
- id: string (primary key)
|
|
- mandateId: string (mandate ID)
|
|
- label: string (plot designation)
|
|
- strasseNr: string (street and house number)
|
|
- plz: string (postal code)
|
|
- kontextGemeinde: string (municipality ID, Foreign Key to Gemeinde table)
|
|
- bauzone: string (building zone, e.g. W3, WG2)
|
|
- az: float (Ausnützungsziffer)
|
|
- bz: float (Bebauungsziffer)
|
|
- vollgeschossZahl: int (number of allowed full floors)
|
|
- gebaeudehoeheMax: float (maximum building height in meters)
|
|
- laermschutzzone: string (noise protection zone)
|
|
- hochwasserschutzzone: string (flood protection zone)
|
|
- grundwasserschutzzone: string (groundwater protection zone)
|
|
- parzelleBebaut: JaNein enum (is plot built)
|
|
- parzelleErschlossen: JaNein enum (is plot developed)
|
|
- parzelleHanglage: JaNein enum (is plot on slope)
|
|
|
|
**Important relationships:**
|
|
- Projekte contain Parzellen (projects have plots)
|
|
- Parzelle links to Gemeinde (via kontextGemeinde)
|
|
- Gemeinde links to Kanton (via id_kanton)
|
|
- Kanton links to Land (via id_land)
|
|
- Location queries (city, postal code) should use Parzelle.kontextGemeinde (municipality name will be resolved to ID)
|
|
- Projekt does NOT have location fields directly - location is stored in associated Parzellen
|
|
|
|
Return a JSON object with the following structure:
|
|
{
|
|
"intent": "CREATE|READ|UPDATE|DELETE|QUERY",
|
|
"entity": "Projekt|Parzelle|Dokument|Kanton|Gemeinde|null",
|
|
"parameters": {
|
|
// Extracted parameters from user input
|
|
// For CREATE/UPDATE: include all relevant fields using EXACT field names from above
|
|
// For READ: include filter criteria using EXACT field names (id, label, plz, kontextGemeinde, etc.)
|
|
// For DELETE: include entity ID if mentioned
|
|
// For QUERY: include queryText if SQL is detected
|
|
// IMPORTANT: Use only field names that exist in the entity definition above
|
|
},
|
|
"confidence": 0.0-1.0 // Confidence score for the analysis
|
|
}
|
|
|
|
Examples:
|
|
- Input: "Erstelle ein neues Projekt namens 'Hauptstrasse 42'"
|
|
Output: {"intent": "CREATE", "entity": "Projekt", "parameters": {"label": "Hauptstrasse 42"}, "confidence": 0.95}
|
|
|
|
- Input: "Zeige mir alle Projekte"
|
|
Output: {"intent": "READ", "entity": "Projekt", "parameters": {}, "confidence": 0.9}
|
|
|
|
- Input: "Zeige mir Projekte in Zürich"
|
|
Output: {"intent": "READ", "entity": "Parzelle", "parameters": {"kontextGemeinde": "Zürich"}, "confidence": 0.9}
|
|
Note: Location queries should query Parzelle, not Projekt directly
|
|
|
|
- Input: "Zeige mir Parzellen mit PLZ 8000"
|
|
Output: {"intent": "READ", "entity": "Parzelle", "parameters": {"plz": "8000"}, "confidence": 0.95}
|
|
|
|
- Input: "Aktualisiere Projekt XYZ mit Status 'Planung'"
|
|
Output: {"intent": "UPDATE", "entity": "Projekt", "parameters": {"id": "XYZ", "statusProzess": "Planung"}, "confidence": 0.85}
|
|
|
|
- Input: "SELECT * FROM Projekt WHERE label = 'Test'"
|
|
Output: {"intent": "QUERY", "entity": null, "parameters": {"queryText": "SELECT * FROM Projekt WHERE label = 'Test'", "queryType": "sql"}, "confidence": 1.0}
|
|
|
|
- Input: "Lösche Parzelle ABC"
|
|
Output: {"intent": "DELETE", "entity": "Parzelle", "parameters": {"id": "ABC"}, "confidence": 0.9}
|