extraction error logging

This commit is contained in:
Storme-bit
2026-04-21 00:35:48 -07:00
parent 781bf8a615
commit c81a1cb20e
2 changed files with 5 additions and 2 deletions

View File

@@ -93,7 +93,10 @@ async function extractAndStoreEntities(userMessage, aiResponse, projectId=null)
const parsed = JSON.parse(raw);
const entities = Array.isArray(parsed.entities) ? parsed.entities : [];
if (entities.length === 0) throw new Error('No entities in response');
if (entities.length === 0) {
console.log('[entities] No entities found in this exchange — skipping');
return; // not an error, just nothing to extract
}
if (!Array.isArray(entities)) throw new Error('Response was not a JSON array');