Added draft implementation of built-in preprocessing for RAG.

This commit is contained in:
ilya-kolchinsky 2025-03-04 15:22:29 +01:00
parent 5014de434e
commit 1a6e71c61f
9 changed files with 299 additions and 4 deletions

View file

@ -26,8 +26,8 @@ class PreprocessingDataType(Enum):
@json_schema_type
class PreprocessingInput(BaseModel):
preprocessor_input_id: str
preprocessor_input_type: Optional[PreprocessingDataType]
path_or_content: str | URL
preprocessor_input_type: Optional[PreprocessingDataType] = None
path_or_content: str | InterleavedContent | URL
PreprocessorOptions = Dict[str, Any]
@ -36,7 +36,7 @@ PreprocessorOptions = Dict[str, Any]
@json_schema_type
class PreprocessingResponse(BaseModel):
status: bool
results: Optional[List[str | InterleavedContent | Chunk]]
results: Optional[List[str | InterleavedContent | Chunk]] = None
class PreprocessorStore(Protocol):