@axiom-lattice/core 2.1.33 → 2.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +15 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -24
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2941,11 +2941,19 @@ Skip using this tool when:
|
|
|
2941
2941
|
Prerequisites - MUST Complete First
|
|
2942
2942
|
1. Call query_metrics_list to discover available metrics
|
|
2943
2943
|
2. Call query_metric_definition(metricName) to get:
|
|
2944
|
-
- defaultTimeContext.timeDimension (e.g., "DocDate")
|
|
2944
|
+
- defaultTimeContext.timeDimension (e.g., "DocDate","date")
|
|
2945
2945
|
- defaultTimeContext.supportedGrains (e.g., ["day", "week", "month", "year"])
|
|
2946
2946
|
- supportedDimensions[].dim_id (use these for groupBy and filters)
|
|
2947
2947
|
- supportedDimensions[].filter_operators (allowed operators per dimension)
|
|
2948
2948
|
|
|
2949
|
+
**Rules**:
|
|
2950
|
+
- To filter by date: Copy the pattern and replace values
|
|
2951
|
+
\`\`\`json
|
|
2952
|
+
{"dimension": "DocDate", "operator": "BETWEEN", "values": ["2025-01-01", "2025-12-31"]}
|
|
2953
|
+
\`\`\`
|
|
2954
|
+
- To group by time: Use \`"{timeDimension}__{supportedGrain}"\` format (e.g., \`"date__month"\`)
|
|
2955
|
+
|
|
2956
|
+
|
|
2949
2957
|
The Five Query Patterns
|
|
2950
2958
|
|
|
2951
2959
|
Pattern A - Time Trend (most common first query)
|
|
@@ -2953,8 +2961,8 @@ Goal: Show how a metric changes over time within a period
|
|
|
2953
2961
|
{
|
|
2954
2962
|
"metrics": ["order_amt_tax_inc"],
|
|
2955
2963
|
"groupBy": ["DocDate__month"],
|
|
2956
|
-
"filters": [{ "dimension": "
|
|
2957
|
-
"orderBy": [{ "field": "
|
|
2964
|
+
"filters": [{ "dimension": "date", "operator": "BETWEEN", "values": ["2025-01-01", "2025-12-31"] }],
|
|
2965
|
+
"orderBy": [{ "field": "date__month", "direction": "ASC" }]
|
|
2958
2966
|
}
|
|
2959
2967
|
|
|
2960
2968
|
Pattern B - Dimension Breakdown (who/what is top or bottom)
|
|
@@ -3019,25 +3027,7 @@ Common Mistakes to Avoid
|
|
|
3019
3027
|
- Omitting date filter entirely - ALWAYS include at least one DocDate filter
|
|
3020
3028
|
- Querying a metric by an unsupported dimension - only use dim_id from supportedDimensions
|
|
3021
3029
|
- Putting display name in orderBy.field - must match exactly what's in groupBy
|
|
3022
|
-
|
|
3023
|
-
Recommended Analysis Flow
|
|
3024
|
-
User question
|
|
3025
|
-
|
|
|
3026
|
-
\u25BC
|
|
3027
|
-
Step 1: query_metrics_list - find matching metric(s)
|
|
3028
|
-
|
|
|
3029
|
-
\u25BC
|
|
3030
|
-
Step 2: query_metric_definition - read defaultTimeContext + supportedDimensions
|
|
3031
|
-
|
|
|
3032
|
-
\u25BC
|
|
3033
|
-
Step 3a: Pattern A (time trend) - get the big picture
|
|
3034
|
-
|
|
|
3035
|
-
\u251C\u2500 anomaly found? \u2500\u2500\u25BA Step 3c: Pattern C (drill down)
|
|
3036
|
-
\u251C\u2500 user asks "who"? \u2500\u2500\u25BA Step 3b: Pattern B (dimension breakdown)
|
|
3037
|
-
\u2514\u2500 user asks "compare X and Y"? \u2500\u2500\u25BA Step 3d: Pattern D (multi-metric)
|
|
3038
|
-
|
|
3039
|
-
Debug Mode
|
|
3040
|
-
Set "debug": true to receive executedSqls in the response to verify generated SQL.`;
|
|
3030
|
+
`;
|
|
3041
3031
|
function formatSemanticQueryResult(datasourceId, datasourceName, results) {
|
|
3042
3032
|
if (results.length === 0) {
|
|
3043
3033
|
return `No data found for the specified query.
|
|
@@ -10733,11 +10723,12 @@ ${BASE_PROMPT}` : BASE_PROMPT;
|
|
|
10733
10723
|
unsupportedModelBehavior: "ignore"
|
|
10734
10724
|
}),
|
|
10735
10725
|
// Subagent middleware: Patches tool calls for compatibility
|
|
10736
|
-
createPatchToolCallsMiddleware()
|
|
10726
|
+
createPatchToolCallsMiddleware(),
|
|
10727
|
+
...customMiddleware
|
|
10737
10728
|
],
|
|
10738
10729
|
defaultInterruptOn: interruptOn,
|
|
10739
10730
|
subagents,
|
|
10740
|
-
generalPurposeAgent:
|
|
10731
|
+
generalPurposeAgent: true
|
|
10741
10732
|
}),
|
|
10742
10733
|
// Automatically summarizes conversation history when token limits are approached
|
|
10743
10734
|
(0, import_langchain52.summarizationMiddleware)({
|