20 lines
850 B
JavaScript
20 lines
850 B
JavaScript
const { test } = require('node:test');
|
|
const assert = require('node:assert/strict');
|
|
const path = require('node:path');
|
|
const { pathToFileURL } = require('node:url');
|
|
|
|
async function imagesModule() {
|
|
return import(pathToFileURL(path.join(__dirname, '..', 'public/js/assistant/images.js')).href);
|
|
}
|
|
|
|
test('assistant image intent does not intercept table retrieval requests', async () => {
|
|
const { isImageRequest } = await imagesModule();
|
|
assert.equal(isImageRequest('can you show me the table?'), false);
|
|
assert.equal(isImageRequest('show me Table 13.1'), false);
|
|
});
|
|
|
|
test('assistant image intent still handles explicit visual requests', async () => {
|
|
const { isImageRequest } = await imagesModule();
|
|
assert.equal(isImageRequest('show me the diagram'), true);
|
|
assert.equal(isImageRequest('create an infographic for asthma'), true);
|
|
});
|