Новый раг
This commit is contained in:
23
app/modules/rag/contracts/retrieval.py
Normal file
23
app/modules/rag/contracts/retrieval.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
class RetrievalQuery:
|
||||
text: str
|
||||
mode: str
|
||||
limit: int = 5
|
||||
layers: list[str] = field(default_factory=list)
|
||||
path_prefixes: list[str] = field(default_factory=list)
|
||||
doc_kind: str | None = None
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
class RetrievalItem:
|
||||
content: str
|
||||
path: str
|
||||
layer: str
|
||||
title: str
|
||||
score: float | None = None
|
||||
metadata: dict | None = None
|
||||
Reference in New Issue
Block a user