core/apps/webapp/app/services/episodeFacts.server.ts
Harshith Mullapudi 1fa7fd93d5
Feat: spaces (#51)
* feat: Episode ingestion update
Benchmarking CORE

* Feat: Spaces in knowledge graph

* fix: remove daily assignment

* Feat: add spaces

* Feat: spaces

---------

Co-authored-by: Manoj K <saimanoj58@gmail.com>
2025-08-21 11:53:45 +05:30

28 lines
702 B
TypeScript

import { getEpisodeStatements } from "~/services/graphModels/episode";
export async function getEpisodeFacts(episodeUuid: string, userId: string) {
try {
const facts = await getEpisodeStatements({
episodeUuid,
userId,
});
return {
success: true,
facts: facts.map(fact => ({
uuid: fact.uuid,
fact: fact.fact,
createdAt: fact.createdAt.toISOString(),
validAt: fact.validAt.toISOString(),
attributes: fact.attributes,
})),
};
} catch (error) {
console.error("Error fetching episode facts:", error);
return {
success: false,
error: "Failed to fetch episode facts",
facts: [],
};
}
}