added chat history orchestration endpoint

This commit is contained in:
Storme-bit
2026-04-05 22:58:38 -07:00
parent 16354952f9
commit 157a08fa78

View File

@@ -47,10 +47,20 @@ async function getEpisodeById(episodeId) {
return res.json();
}
async function getSessionHistory(sessionId, limit = 20, offset = 0) {
const res = await fetch(
`${BASE_URL}/sessions/${sessionId}/episodes?limit=${limit}&offset=${offset}`
);
if (res.status === 404 ) return null;
if (!res.ok) throw new Error(`Failed to fetch history: ${res.status}`);
return res.json();
}
module.exports = {
getSessionByExternalId,
createSession,
getRecentEpisodes,
createEpisode,
getEpisodeById
getEpisodeById,
getSessionHistory
}