snow-flow 2.8.2 → 2.8.3
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.
|
@@ -35,7 +35,6 @@ class PerformanceBenchmark {
|
|
|
35
35
|
const tables = ['incident', 'sc_request', 'problem', 'change_request'];
|
|
36
36
|
for (const table of tables) {
|
|
37
37
|
const startTime = Date.now();
|
|
38
|
-
const startMemory = process.memoryUsage().heapUsed;
|
|
39
38
|
// Count-only query
|
|
40
39
|
const response = await this.client.searchRecords(table, 'active=true', 100);
|
|
41
40
|
const count = response.data?.result?.length || 0;
|
|
@@ -1354,6 +1354,17 @@ class ServiceNowMachineLearningMCP {
|
|
|
1354
1354
|
async trainWithStreaming(args) {
|
|
1355
1355
|
const { sample_size, batch_size, epochs, validation_split, query, intelligent_selection, focus_categories, max_vocabulary_size } = args;
|
|
1356
1356
|
this.logger.info(`Starting streaming training with batch size ${batch_size}`);
|
|
1357
|
+
// First, validate we can fetch data
|
|
1358
|
+
try {
|
|
1359
|
+
const testFetch = await this.fetchIncidentData(1, { query, intelligent_selection, focus_categories });
|
|
1360
|
+
if (testFetch.length === 0) {
|
|
1361
|
+
throw new Error('No incidents available for training');
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
catch (error) {
|
|
1365
|
+
this.logger.error('Cannot access incident data:', error);
|
|
1366
|
+
throw new Error(`Training failed - cannot access incident data: ${error.message}`);
|
|
1367
|
+
}
|
|
1357
1368
|
// Create feature hasher for vocabulary management
|
|
1358
1369
|
const featureHasher = this.createFeatureHasher(max_vocabulary_size);
|
|
1359
1370
|
// Initialize model with proper architecture
|
|
@@ -1517,11 +1528,13 @@ class ServiceNowMachineLearningMCP {
|
|
|
1517
1528
|
* Create optimized model for memory efficiency
|
|
1518
1529
|
*/
|
|
1519
1530
|
createOptimizedModel(vocabularySize) {
|
|
1531
|
+
// Ensure vocabulary size is valid
|
|
1532
|
+
const validVocabSize = Math.max(1, vocabularySize || 5000);
|
|
1520
1533
|
return tf.sequential({
|
|
1521
1534
|
layers: [
|
|
1522
1535
|
// Use embedding with smaller dimensions
|
|
1523
1536
|
tf.layers.embedding({
|
|
1524
|
-
inputDim:
|
|
1537
|
+
inputDim: validVocabSize, // Use validated vocabulary size
|
|
1525
1538
|
outputDim: 64, // Reduced from 128
|
|
1526
1539
|
inputLength: 100
|
|
1527
1540
|
}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "snow-flow",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.3",
|
|
4
4
|
"description": "Snow-Flow: ServiceNow Advanced Intelligence Platform - 100+ real MCP tools with AI-powered swarm orchestration and neural networks. Dynamic task categorization using AI. Machine learning for incident classification, change risk prediction, and anomaly detection. Zero Mock Data, 100% Real API Integration.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "commonjs",
|