You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

retrieval.py 450B

123456789101112131415161718192021
  1. from pydantic import BaseModel
  2. from models.dataset import DocumentSegment
  3. class RetrievalChildChunk(BaseModel):
  4. """Retrieval segments."""
  5. id: str
  6. content: str
  7. score: float
  8. position: int
  9. class RetrievalSegments(BaseModel):
  10. """Retrieval segments."""
  11. model_config = {"arbitrary_types_allowed": True}
  12. segment: DocumentSegment
  13. child_chunks: list[RetrievalChildChunk] | None = None
  14. score: float | None = None