@superatomai/sdk-node 0.0.15-mds → 0.0.16-mds
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 +17 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7986,7 +7986,8 @@ function tryStreamAnswerComponent(text, components, executedTools, collections,
|
|
|
7986
7986
|
logger.warn(`[AgentComponentGen] Answer component query failed: ${result?.error}`);
|
|
7987
7987
|
return;
|
|
7988
7988
|
}
|
|
7989
|
-
|
|
7989
|
+
const cacheKey = toolId ? `${toolId}:${sql}` : sql;
|
|
7990
|
+
queryCache.set(cacheKey, result?.data ?? result);
|
|
7990
7991
|
callback(answerComponent);
|
|
7991
7992
|
} catch (err) {
|
|
7992
7993
|
const msg = err instanceof Error ? err.message : String(err);
|
|
@@ -8091,7 +8092,8 @@ async function validateSingleExternalToolQuery(component, collections, executedT
|
|
|
8091
8092
|
throw new Error(typeof errorMsg === "string" ? errorMsg : JSON.stringify(errorMsg));
|
|
8092
8093
|
}
|
|
8093
8094
|
const rawToolData = result?.data ?? result;
|
|
8094
|
-
|
|
8095
|
+
const cacheKey = toolId ? `${toolId}:${currentSql}` : currentSql;
|
|
8096
|
+
queryCache.set(cacheKey, rawToolData);
|
|
8095
8097
|
logger.info(`[AgentComponentGen] \u2713 ${component.name} validated (attempt ${attempts})`);
|
|
8096
8098
|
return {
|
|
8097
8099
|
...component,
|
|
@@ -10376,7 +10378,9 @@ var get_agent_user_response = async (prompt, components, anthropicApiKey, groqAp
|
|
|
10376
10378
|
const sqlValue = props.externalTool?.parameters?.sql || props.externalTool?.parameters?.query;
|
|
10377
10379
|
if (sqlValue) {
|
|
10378
10380
|
const { sql, query, ...restParams } = props.externalTool.parameters;
|
|
10379
|
-
const
|
|
10381
|
+
const toolId = props.externalTool?.toolId || "";
|
|
10382
|
+
const cacheKey = toolId ? `${toolId}:${sqlValue}` : sqlValue;
|
|
10383
|
+
const cachedData = queryCache.get(cacheKey);
|
|
10380
10384
|
const queryId = queryCache.storeQuery(sqlValue, cachedData);
|
|
10381
10385
|
queryMap[queryId] = sqlValue;
|
|
10382
10386
|
props.externalTool = {
|
|
@@ -14298,7 +14302,8 @@ Using this data, select the appropriate component and respond with ONLY the JSON
|
|
|
14298
14302
|
}
|
|
14299
14303
|
finalComponent.props.externalTool.parameters.sql = extToolSql;
|
|
14300
14304
|
validated = true;
|
|
14301
|
-
|
|
14305
|
+
const cacheKey = extToolId ? `${extToolId}:${extToolSql}` : extToolSql;
|
|
14306
|
+
queryCache.set(cacheKey, result2?.data ?? result2);
|
|
14302
14307
|
logger.info(`[DASH_COMP_REQ] externalTool SQL validated (attempt ${attempts}) - cached for frontend`);
|
|
14303
14308
|
} catch (execError) {
|
|
14304
14309
|
const errorMsg = execError instanceof Error ? execError.message : String(execError);
|
|
@@ -14397,7 +14402,9 @@ Fixed SQL query:`;
|
|
|
14397
14402
|
const sqlValue = props.externalTool?.parameters?.sql || props.externalTool?.parameters?.query;
|
|
14398
14403
|
if (sqlValue) {
|
|
14399
14404
|
const { sql, query, ...restParams } = props.externalTool.parameters;
|
|
14400
|
-
const
|
|
14405
|
+
const toolIdForCache = props.externalTool?.toolId || "";
|
|
14406
|
+
const cacheKeyForGet = toolIdForCache ? `${toolIdForCache}:${sqlValue}` : sqlValue;
|
|
14407
|
+
const cachedData = queryCache.get(cacheKeyForGet);
|
|
14401
14408
|
const queryId = queryCache.storeQuery(sqlValue, cachedData);
|
|
14402
14409
|
props.externalTool = {
|
|
14403
14410
|
...props.externalTool,
|
|
@@ -15111,7 +15118,9 @@ Using this data, generate the complete report with multiple components. Respond
|
|
|
15111
15118
|
const sqlValue = props.externalTool?.parameters?.sql || props.externalTool?.parameters?.query;
|
|
15112
15119
|
if (sqlValue) {
|
|
15113
15120
|
const { sql, query, ...restParams } = props.externalTool.parameters;
|
|
15114
|
-
const
|
|
15121
|
+
const toolId = props.externalTool?.toolId || "";
|
|
15122
|
+
const cacheKey = toolId ? `${toolId}:${sqlValue}` : sqlValue;
|
|
15123
|
+
const cachedData = queryCache.get(cacheKey);
|
|
15115
15124
|
const queryId = queryCache.storeQuery(sqlValue, cachedData);
|
|
15116
15125
|
props.externalTool = {
|
|
15117
15126
|
...props.externalTool,
|
|
@@ -15203,7 +15212,8 @@ async function validateAllExternalToolQueries(components, collections, tools, mo
|
|
|
15203
15212
|
throw new Error(typeof errorMsg === "string" ? errorMsg : JSON.stringify(errorMsg));
|
|
15204
15213
|
}
|
|
15205
15214
|
comp.props.externalTool.parameters.sql = extToolSql;
|
|
15206
|
-
|
|
15215
|
+
const cacheKey = extToolId ? `${extToolId}:${extToolSql}` : extToolSql;
|
|
15216
|
+
queryCache.set(cacheKey, result?.data ?? result);
|
|
15207
15217
|
const resultData = result?.data?.data ?? result?.data ?? [];
|
|
15208
15218
|
const dataArray = Array.isArray(resultData) ? resultData : [resultData];
|
|
15209
15219
|
if (!comp.props.config) {
|