retrieval fusion
This commit is contained in:
@@ -196,6 +196,16 @@ async function getProjectOverviewSummary(projectId) {
|
||||
return res.json(); // null if none exists yet
|
||||
}
|
||||
|
||||
async function searchEpisodes(query, { limit = 10, sessionIds = null } = {}) {
|
||||
const url = new URL(`${BASE_URL}/episodes/search`);
|
||||
url.searchParams.set('q', query);
|
||||
url.searchParams.set('limit', limit);
|
||||
if (sessionIds?.length) url.searchParams.set('sessionIds', sessionIds.join(','));
|
||||
const res = await fetch(url.toString());
|
||||
if (!res.ok) throw new Error(`FTS search error: ${res.status}`);
|
||||
return res.json();
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getSessionByExternalId,
|
||||
createSession,
|
||||
@@ -220,4 +230,5 @@ module.exports = {
|
||||
getSummariesByProject,
|
||||
generateProjectSummary,
|
||||
getProjectOverviewSummary,
|
||||
searchEpisodes,
|
||||
}
|
||||
Reference in New Issue
Block a user