extraction error logging

This commit is contained in:
Storme-bit
2026-04-21 00:22:29 -07:00
parent 9ab63cca19
commit 936b04742e
3 changed files with 11 additions and 4 deletions

View File

@@ -32,12 +32,11 @@ async function searchEpisodes( vector, {limit = ORCHESTRATION.RECENT_EPISODE_LIM
async function searchEntities(vector, { limit = ORCHESTRATION.ENTITIES_LIMIT, scoreThreshold = ORCHESTRATION.ENTITIES_THRESHOLD, projectId = undefined } = {}) {
const body = { vector, limit, score_threshold: scoreThreshold, with_payload: true };
if (projectId !== undefined) {
if (projectId !== null && projectId !== undefined) {
body.filter = {
must: [{ key: 'projectId', match: { value: projectId ?? null } }]
must: [{ key: 'projectId', match: { value: projectId } }]
};
}
const res = await fetch(
`${BASE_URL}/collections/${COLLECTIONS.ENTITIES}/points/search`,
{
@@ -47,7 +46,11 @@ async function searchEntities(vector, { limit = ORCHESTRATION.ENTITIES_LIMIT, sc
}
);
if (!res.ok) throw new Error(`Qdrant error: ${res.status}`);
if (!res.ok) {
const body = await res.text();
throw new Error(`Qdrant error: ${res.status} - ${body}`);
}
const data = await res.json();
return data.result;
}