@superatomai/sdk-node 0.0.16-mds → 0.0.17-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 +13 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6902,7 +6902,7 @@ function extractEntityDetails(description) {
|
|
|
6902
6902
|
});
|
|
6903
6903
|
seenNames.add(name.toLowerCase());
|
|
6904
6904
|
}
|
|
6905
|
-
const catalogMatch = description.match(/(?:All \d+ tables|Other tables)[^:]*:\n?([\s\S]*?)(?:\n\n|$)/i);
|
|
6905
|
+
const catalogMatch = description.match(/(?:All \d+ tables|Other tables|Remaining \d+ tables)[^:]*:\n?([\s\S]*?)(?:\n\n|$)/i);
|
|
6906
6906
|
if (catalogMatch) {
|
|
6907
6907
|
const catalogText = catalogMatch[1];
|
|
6908
6908
|
const entryPattern = /([\w.]+)\(([\d.]+[KMB]?)\s*rows?\)/gi;
|
|
@@ -7225,13 +7225,21 @@ Analyze the error and try again with a corrected query.`;
|
|
|
7225
7225
|
const sourceType = this.extractSourceType();
|
|
7226
7226
|
const fullSchema = this.tool.fullSchema || this.tool.description || "No schema available";
|
|
7227
7227
|
const hasSchemaSearch = !!this.tool.schemaSearchFn;
|
|
7228
|
-
const
|
|
7229
|
-
|
|
7228
|
+
const schemaTier = this.tool.schemaTier || "";
|
|
7229
|
+
let schemaSearchInstructions = "";
|
|
7230
|
+
if (hasSchemaSearch && schemaTier === "very_large") {
|
|
7231
|
+
schemaSearchInstructions = `## Schema Search
|
|
7232
|
+
This source has a very large schema. The schema above shows only table names \u2014 no column details.
|
|
7230
7233
|
Before writing any query, you MUST use the search_schema tool to find exact table and column names.
|
|
7231
7234
|
1. Search with keywords related to the requested data
|
|
7232
|
-
2. Review the returned column details carefully
|
|
7235
|
+
2. Review the returned column details and sample values carefully
|
|
7233
7236
|
3. Then write your SQL query using the exact names from the search results
|
|
7234
|
-
You may search multiple times with different keywords if the first search doesn't find what you need
|
|
7237
|
+
You may search multiple times with different keywords if the first search doesn't find what you need.`;
|
|
7238
|
+
} else if (hasSchemaSearch) {
|
|
7239
|
+
schemaSearchInstructions = `## Schema Search
|
|
7240
|
+
This source has a large schema. The top tables are shown in detail above, but not all tables are listed with columns.
|
|
7241
|
+
If you need data from a table that is only listed in the catalog (no columns shown), use the search_schema tool to look up its column details before writing a query.`;
|
|
7242
|
+
}
|
|
7235
7243
|
const prompts = await promptLoader.loadPrompts("agent-source-query", {
|
|
7236
7244
|
SOURCE_NAME: sourceName,
|
|
7237
7245
|
SOURCE_TYPE: sourceType,
|