adding in entity extraction layer with semantic search enabled
This commit is contained in:
@@ -30,4 +30,21 @@ async function searchEpisodes( vector, {limit = ORCHESTRATION.RECENT_EPISODE_LIM
|
||||
return data.result;
|
||||
}
|
||||
|
||||
module.exports = { searchEpisodes };
|
||||
async function searchEntities(vector, { limit = 5, scoreThreshold = 0.6 } = {}) {
|
||||
const body = { vector, limit, score_threshold: scoreThreshold, with_payload: true };
|
||||
|
||||
const res = await fetch(
|
||||
`${BASE_URL}/collections/${COLLECTIONS.ENTITIES}/points/search`,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(body),
|
||||
}
|
||||
);
|
||||
|
||||
if (!res.ok) throw new Error(`Qdrant error: ${res.status}`);
|
||||
const data = await res.json();
|
||||
return data.result;
|
||||
}
|
||||
|
||||
module.exports = { searchEpisodes, searchEntities };
|
||||
Reference in New Issue
Block a user