You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicstaticfinalStringQUERY_TYPE_RULES = "Use only fields present in the provided mapping; never invent names.\n"
@@ -89,7 +90,7 @@ public class QueryPlanningPromptTemplate {
89
90
+ "- Harvest candidates from the question (entities, attributes, constraints).\n"
90
91
+ "- From query_fields (that exist) and the index mapping, choose fields that map to those candidates and the user intent—even if only loosely (use reasonable proxies).\n"
91
92
+ "- Ignore other fields that don’t help answer the question.\n"
92
-
+ "- Micro Self-Check (silent): verify chosen fields exist; if any don’t, swap to the closest mapped proxy and continue. Only if no remotely relevant fields exist at all, use the default match_all query.\n";
93
+
+ "- Micro Self-Check (silent): verify chosen fields exist; if any don’t, swap to the closest mapped proxy and continue. Only if no remotely relevant fields exist at all, use the default query.\n";
+ "You are an OpenSearch DSL expert. Convert a natural-language question into a strict JSON OpenSearch query body.\n\n"
@@ -112,7 +113,7 @@ public class QueryPlanningPromptTemplate {
112
113
+ "- Do NOT wrap in quotes or prose: no single quotes ('), no smart quotes (’ “ ”), no angle brackets (< >), no XML/HTML, no lists, no headers, no ellipses.\n"
113
114
+ "- Use valid JSON only: standard double quotes (\") for all keys/strings; no comments; no trailing commas.\n"
114
115
+ "- If the request truly cannot be fulfilled because no remotely relevant fields exist, return EXACTLY:\n"
115
-
+ DEFAULT_QUERY
116
+
+ FALLBACK_QUERY_PROMPT_PLACEHOLDER
116
117
+ "\n";
117
118
118
119
// ==== EXAMPLES ==== (Field selection lines included only where they clarify proxies vs. distractors)
@@ -179,7 +180,7 @@ public class QueryPlanningPromptTemplate {
179
180
+ "Input: List satellites with periapsis above 400km.\n"
0 commit comments