mirror of
https://github.com/langgenius/dify.git
synced 2026-02-02 00:51:49 +08:00
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Jyong <76649700+JohnJyong@users.noreply.github.com> Co-authored-by: zxhlyh <jasonapring2015@outlook.com> Co-authored-by: Yansong Zhang <916125788@qq.com> Co-authored-by: hj24 <mambahj24@gmail.com> Co-authored-by: CodingOnStar <hanxujiang@dify.ai> Co-authored-by: CodingOnStar <hanxujiang@dify.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
24 lines
583 B
Python
24 lines
583 B
Python
from pydantic import BaseModel
|
|
|
|
from models.dataset import DocumentSegment
|
|
|
|
|
|
class RetrievalChildChunk(BaseModel):
|
|
"""Retrieval segments."""
|
|
|
|
id: str
|
|
content: str
|
|
score: float
|
|
position: int
|
|
|
|
|
|
class RetrievalSegments(BaseModel):
|
|
"""Retrieval segments."""
|
|
|
|
model_config = {"arbitrary_types_allowed": True}
|
|
segment: DocumentSegment
|
|
child_chunks: list[RetrievalChildChunk] | None = None
|
|
score: float | None = None
|
|
files: list[dict[str, str | int]] | None = None
|
|
summary: str | None = None # Summary content if retrieved via summary index
|