mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-30 21:59:46 +02:00
add fallback document sumary
This commit is contained in:
parent
36d1fba75f
commit
ca870cf660
3 changed files with 27 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ class ConnectorDocument(BaseModel):
|
|||
search_space_id: int = Field(gt=0)
|
||||
should_summarize: bool = True
|
||||
should_use_code_chunker: bool = False
|
||||
fallback_summary: str | None = None
|
||||
metadata: dict = {}
|
||||
connector_id: int = Field(gt=0)
|
||||
created_by_id: str
|
||||
|
|
|
|||
|
|
@ -124,6 +124,8 @@ class IndexingPipelineService:
|
|||
content = await summarize_document(
|
||||
connector_doc.source_markdown, llm, connector_doc.metadata
|
||||
)
|
||||
elif connector_doc.should_summarize and connector_doc.fallback_summary:
|
||||
content = connector_doc.fallback_summary
|
||||
else:
|
||||
content = connector_doc.source_markdown
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue