← back to Enrich Local Hybrid
test-local.js
15 lines
const fs = require('fs');
// TK-12090 Lane E: was forcing Ollama at 127.0.0.1:11434 (retired). Force the exo ring on
// this Mac for a local test run instead — matches the shared lib's own default, spelled
// out here so the test is explicit about which host it's hitting.
process.env.VISION_URL = process.env.VISION_URL || 'http://127.0.0.1:52415';
const { localAnalyze } = require('./enrich-local');
// fetchBuffer stub: read a local file path as if it were a fetched image
const fetchBuffer = async (p) => fs.readFileSync(p);
(async () => {
const img = process.argv[2] || '/Users/macstudio3/Desktop/ChinaSeas_MFR_clean_samples.png';
const t0 = Date.now();
const aiData = await localAnalyze([img], 'RESIDENTIAL', fetchBuffer);
console.log(`elapsed ${((Date.now()-t0)/1000).toFixed(1)}s\n` + JSON.stringify(aiData, null, 2));
})().catch(e => { console.error('FAILED:', e.message); process.exit(1); });