From 06c6842f11f32154ac0ee7a272dd318770d1323b Mon Sep 17 00:00:00 2001 From: LUIS NOVO Date: Wed, 13 Nov 2024 17:02:18 -0300 Subject: [PATCH] fix insight context to improve citations --- open_notebook/domain/notebook.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/open_notebook/domain/notebook.py b/open_notebook/domain/notebook.py index be0dbc0..5ef3f14 100644 --- a/open_notebook/domain/notebook.py +++ b/open_notebook/domain/notebook.py @@ -141,15 +141,16 @@ class Source(ObjectModel): def get_context( self, context_size: Literal["short", "long"] = "short" ) -> Dict[str, Any]: + insights = [insight.model_dump() for insight in self.insights] if context_size == "long": return dict( id=self.id, title=self.title, - insights=[insight.model_dump() for insight in self.insights], + insights=insights, full_text=self.full_text, ) else: - return dict(id=self.id, title=self.title, insights=self.insights) + return dict(id=self.id, title=self.title, insights=insights) @property def embedded_chunks(self) -> int: