@superatomai/sdk-node 0.0.69 → 0.0.70
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 +34 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +34 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6189,7 +6189,7 @@ Fixed SQL query:`;
|
|
|
6189
6189
|
{
|
|
6190
6190
|
model: this.getModelForTask("simple"),
|
|
6191
6191
|
maxTokens: 2048,
|
|
6192
|
-
temperature: 0
|
|
6192
|
+
temperature: 0,
|
|
6193
6193
|
apiKey: this.getApiKey(apiKey)
|
|
6194
6194
|
}
|
|
6195
6195
|
);
|
|
@@ -6435,12 +6435,13 @@ ${executedToolsText}`);
|
|
|
6435
6435
|
},
|
|
6436
6436
|
apiKey
|
|
6437
6437
|
);
|
|
6438
|
+
const limitedFixedQuery = ensureQueryLimit(fixedQueryStr, this.defaultLimit, 10);
|
|
6438
6439
|
if (typeof currentQuery === "string") {
|
|
6439
|
-
currentQuery =
|
|
6440
|
+
currentQuery = limitedFixedQuery;
|
|
6440
6441
|
} else {
|
|
6441
|
-
currentQuery = { ...currentQuery, sql:
|
|
6442
|
+
currentQuery = { ...currentQuery, sql: limitedFixedQuery };
|
|
6442
6443
|
}
|
|
6443
|
-
currentQueryStr =
|
|
6444
|
+
currentQueryStr = limitedFixedQuery;
|
|
6444
6445
|
logger.info(`[${this.getProviderName()}] LLM provided fixed query for answer component, retrying...`);
|
|
6445
6446
|
} catch (fixError) {
|
|
6446
6447
|
const fixErrorMsg = fixError instanceof Error ? fixError.message : String(fixError);
|
|
@@ -6476,7 +6477,7 @@ ${executedToolsText}`);
|
|
|
6476
6477
|
{
|
|
6477
6478
|
model: this.getModelForTask("complex"),
|
|
6478
6479
|
maxTokens: 8192,
|
|
6479
|
-
temperature: 0
|
|
6480
|
+
temperature: 0,
|
|
6480
6481
|
apiKey: this.getApiKey(apiKey),
|
|
6481
6482
|
partial: partialCallback
|
|
6482
6483
|
},
|
|
@@ -6619,6 +6620,26 @@ ${executedToolsText}`);
|
|
|
6619
6620
|
}
|
|
6620
6621
|
}
|
|
6621
6622
|
}
|
|
6623
|
+
if (cleanedProps.query) {
|
|
6624
|
+
if (typeof cleanedProps.query === "string") {
|
|
6625
|
+
cleanedProps.query = ensureQueryLimit(
|
|
6626
|
+
cleanedProps.query,
|
|
6627
|
+
this.defaultLimit,
|
|
6628
|
+
10
|
|
6629
|
+
// maxLimit - enforce maximum of 10 rows for component queries
|
|
6630
|
+
);
|
|
6631
|
+
} else if (cleanedProps.query?.sql) {
|
|
6632
|
+
cleanedProps.query = {
|
|
6633
|
+
...cleanedProps.query,
|
|
6634
|
+
sql: ensureQueryLimit(
|
|
6635
|
+
cleanedProps.query.sql,
|
|
6636
|
+
this.defaultLimit,
|
|
6637
|
+
10
|
|
6638
|
+
// maxLimit - enforce maximum of 10 rows for component queries
|
|
6639
|
+
)
|
|
6640
|
+
};
|
|
6641
|
+
}
|
|
6642
|
+
}
|
|
6622
6643
|
if (cleanedProps.query && cleanedProps.externalTool) {
|
|
6623
6644
|
logger.info(`[${this.getProviderName()}] Both query and externalTool exist, keeping both - frontend will decide`);
|
|
6624
6645
|
}
|
|
@@ -6739,11 +6760,12 @@ ${executedToolsText}`);
|
|
|
6739
6760
|
);
|
|
6740
6761
|
if (fixedQueryStr && fixedQueryStr !== currentQueryStr) {
|
|
6741
6762
|
logger.info(`[${this.getProviderName()}] Received fixed query for ${component.name}, retrying...`);
|
|
6742
|
-
|
|
6763
|
+
const limitedFixedQuery = ensureQueryLimit(fixedQueryStr, this.defaultLimit, 10);
|
|
6764
|
+
currentQueryStr = limitedFixedQuery;
|
|
6743
6765
|
if (typeof currentQuery === "string") {
|
|
6744
|
-
currentQuery =
|
|
6766
|
+
currentQuery = limitedFixedQuery;
|
|
6745
6767
|
} else {
|
|
6746
|
-
currentQuery = { ...currentQuery, sql:
|
|
6768
|
+
currentQuery = { ...currentQuery, sql: limitedFixedQuery };
|
|
6747
6769
|
}
|
|
6748
6770
|
} else {
|
|
6749
6771
|
logger.warn(`[${this.getProviderName()}] LLM returned same or empty query, stopping retries`);
|
|
@@ -6871,7 +6893,7 @@ ${executedToolsText}`);
|
|
|
6871
6893
|
{
|
|
6872
6894
|
model: this.getModelForTask("simple"),
|
|
6873
6895
|
maxTokens: 1500,
|
|
6874
|
-
temperature: 0
|
|
6896
|
+
temperature: 0,
|
|
6875
6897
|
apiKey: this.getApiKey(apiKey)
|
|
6876
6898
|
},
|
|
6877
6899
|
true
|
|
@@ -6944,7 +6966,7 @@ ${executedToolsText}`);
|
|
|
6944
6966
|
{
|
|
6945
6967
|
model: this.getModelForTask("complex"),
|
|
6946
6968
|
maxTokens: 8192,
|
|
6947
|
-
temperature: 0
|
|
6969
|
+
temperature: 0,
|
|
6948
6970
|
apiKey: this.getApiKey(apiKey)
|
|
6949
6971
|
},
|
|
6950
6972
|
true
|
|
@@ -7529,7 +7551,7 @@ ${errorMsg}
|
|
|
7529
7551
|
{
|
|
7530
7552
|
model: this.getModelForTask("complex"),
|
|
7531
7553
|
maxTokens: 4e3,
|
|
7532
|
-
temperature: 0
|
|
7554
|
+
temperature: 0,
|
|
7533
7555
|
apiKey: this.getApiKey(apiKey),
|
|
7534
7556
|
partial: wrappedStreamCallback
|
|
7535
7557
|
// Pass the wrapped streaming callback to LLM
|
|
@@ -7939,7 +7961,7 @@ ${errorMsg}
|
|
|
7939
7961
|
{
|
|
7940
7962
|
model: this.getModelForTask("simple"),
|
|
7941
7963
|
maxTokens: 1200,
|
|
7942
|
-
temperature: 0
|
|
7964
|
+
temperature: 0,
|
|
7943
7965
|
apiKey: this.getApiKey(apiKey)
|
|
7944
7966
|
},
|
|
7945
7967
|
true
|