diff --git a/frontend/scene-generator/llm-client.js b/frontend/scene-generator/llm-client.js index 8bfbc96..2136074 100644 --- a/frontend/scene-generator/llm-client.js +++ b/frontend/scene-generator/llm-client.js @@ -79,7 +79,27 @@ Schema: "columnDefs": [["field", "label"]], "confidence": 0.0, "uncertainties": ["string"] -}`; +} + +MANDATORY FIELDS (never leave empty): +- apiEndpoints[].contentType: detect from source code. + * For $.ajax({}): look for 'contentType' property. Default 'application/json' if absent. + * For $http.sendByAxios(): contentType is 'application/json' (axios default). + * For XMLHttpRequest: look for setRequestHeader('Content-Type', ...). + * For form submissions: 'application/x-www-form-urlencoded'. +- modes[].responsePath: the JSON path from raw API response to the data array. + * Common patterns: 'data.list', 'data.rcvblAcctSumAll.rcvblAcctVOS', 'content', 'data.records' + * If response is the array itself, use empty string "". +- modes[].requestTemplate: the static request body shape from the source code. + * Extract ALL keys that appear in the request body object. + * Mark dynamic values as "\${args.fieldName}" and static values as literals. +- apiEndpoints[].url: the full API URL as seen in the source code. + +RULES: +- If you cannot determine contentType, default to 'application/json'. +- If you cannot determine responsePath, default to '' (empty string). +- If you cannot determine requestTemplate, use {} (empty object). +- NEVER leave these fields as null or undefined.`; const JSON_REPAIR_SYSTEM_PROMPT = `You repair malformed JSON. Rules: