Saltar al contenido principal

PlainTextExtractor

Extractor
DashAI.back.models.RAG.extractors.PlainTextExtractor

Extractor for plain-text file types.

Reads file content with configurable encoding.

Parameters

encoding : string, default=utf-8
File encoding (e.g. utf-8, latin-1, cp1252)

Methods

extract(self, file_path: str) -> str

Defined on PlainTextExtractor

Extract text from the given file.

get_credential(self, name: str)

Defined on ConfigObject

Resolve a registered credential component by name.

Parameters

name : str
Credential component class name (e.g. "HuggingFaceCredential").

Returns

BaseCredential
An instance of the requested credential component.

get_metadata(cls) -> Dict[str, object]

Defined on BaseExtractor

Return metadata for registry — primarily supported_file_types.

get_schema(cls) -> dict

Defined on ConfigObject

Generates the component related Json Schema.

Returns

dict
Dictionary representing the Json Schema of the component.

validate_and_transform(self, raw_data: dict) -> dict

Defined on ConfigObject

It takes the data given by the user to initialize the model and returns it with all the objects that the model needs to work.

Parameters

raw_data : dict
A dictionary with the data provided by the user to initialize the model.

Returns

dict
A validated dictionary with the necessary objects.