extraction error logging
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user