Added semantic episode searching
This commit is contained in:
@@ -40,9 +40,17 @@ async function createEpisode(sessionId, userMessage, aiResponse, tokenCount) {
|
||||
return res.json();
|
||||
}
|
||||
|
||||
async function getEpisodeById(episodeId) {
|
||||
const res = await (`${BASE_URL}/episodes/${episodeId}`);
|
||||
if (res.status === 404) return null;
|
||||
if (!res.ok) throw new Error(`Failed to fetch episode: ${res.status}`);
|
||||
return res.json();
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getSessionByExternalId,
|
||||
createSession,
|
||||
getRecentEpisodes,
|
||||
createEpisode
|
||||
createEpisode,
|
||||
getEpisodeById
|
||||
}
|
||||
Reference in New Issue
Block a user