mirror of
https://github.com/lfnovo/open-notebook.git
synced 2026-04-30 12:30:01 +00:00
fix insight context to improve citations
This commit is contained in:
parent
066c7a06e2
commit
06c6842f11
1 changed files with 3 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue