@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.mjs
CHANGED
|
@@ -6842,7 +6842,7 @@ function extractEntityDetails(description) {
|
|
|
6842
6842
|
});
|
|
6843
6843
|
seenNames.add(name.toLowerCase());
|
|
6844
6844
|
}
|
|
6845
|
-
const catalogMatch = description.match(/(?:All \d+ tables|Other tables)[^:]*:\n?([\s\S]*?)(?:\n\n|$)/i);
|
|
6845
|
+
const catalogMatch = description.match(/(?:All \d+ tables|Other tables|Remaining \d+ tables)[^:]*:\n?([\s\S]*?)(?:\n\n|$)/i);
|
|
6846
6846
|
if (catalogMatch) {
|
|
6847
6847
|
const catalogText = catalogMatch[1];
|
|
6848
6848
|
const entryPattern = /([\w.]+)\(([\d.]+[KMB]?)\s*rows?\)/gi;
|
|
@@ -7165,13 +7165,21 @@ Analyze the error and try again with a corrected query.`;
|
|
|
7165
7165
|
const sourceType = this.extractSourceType();
|
|
7166
7166
|
const fullSchema = this.tool.fullSchema || this.tool.description || "No schema available";
|
|
7167
7167
|
const hasSchemaSearch = !!this.tool.schemaSearchFn;
|
|
7168
|
-
const
|
|
7169
|
-
|
|
7168
|
+
const schemaTier = this.tool.schemaTier || "";
|
|
7169
|
+
let schemaSearchInstructions = "";
|
|
7170
|
+
if (hasSchemaSearch && schemaTier === "very_large") {
|
|
7171
|
+
schemaSearchInstructions = `## Schema Search
|
|
7172
|
+
This source has a very large schema. The schema above shows only table names \u2014 no column details.
|
|
7170
7173
|
Before writing any query, you MUST use the search_schema tool to find exact table and column names.
|
|
7171
7174
|
1. Search with keywords related to the requested data
|
|
7172
|
-
2. Review the returned column details carefully
|
|
7175
|
+
2. Review the returned column details and sample values carefully
|
|
7173
7176
|
3. Then write your SQL query using the exact names from the search results
|
|
7174
|
-
You may search multiple times with different keywords if the first search doesn't find what you need
|
|
7177
|
+
You may search multiple times with different keywords if the first search doesn't find what you need.`;
|
|
7178
|
+
} else if (hasSchemaSearch) {
|
|
7179
|
+
schemaSearchInstructions = `## Schema Search
|
|
7180
|
+
This source has a large schema. The top tables are shown in detail above, but not all tables are listed with columns.
|
|
7181
|
+
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.`;
|
|
7182
|
+
}
|
|
7175
7183
|
const prompts = await promptLoader.loadPrompts("agent-source-query", {
|
|
7176
7184
|
SOURCE_NAME: sourceName,
|
|
7177
7185
|
SOURCE_TYPE: sourceType,
|