haive.core.engine.document.loaders.base_new¶
Base classes for document loaders.
This module provides the foundation for all document loaders in the system, including base source classes, pattern matching, and loader strategies. Kept under 300 lines as per code style guidelines.
Classes¶
Abstract base class for all document sources. |
|
Base class for cloud storage sources. |
|
Base class for database sources. |
|
Base class for directory sources. |
|
Loader quality classification. |
|
Loader speed classification. |
|
Information about a specific loader strategy. |
|
Base class for local file sources. |
|
Base class for remote sources with credential support. |
|
Pattern specification for source matching. |
Functions¶
|
Helper to create a simple loader instance. |
Module Contents¶
- class haive.core.engine.document.loaders.base_new.BaseSource(/, **data)[source]¶
Bases:
pydantic.BaseModel,abc.ABCAbstract base class for all document sources.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- abstractmethod create_loader(strategy=None, **kwargs)[source]¶
Create a document loader instance.
- Parameters:
strategy (str | None) – Name of strategy to use
**kwargs – Additional loader arguments
- Returns:
Configured document loader
- Return type:
langchain_core.document_loaders.BaseLoader
- get_best_strategy(preference=LoaderPreference.BALANCED)[source]¶
Get best strategy based on preference.
- Parameters:
preference (haive.core.engine.document.config.LoaderPreference)
- Return type:
LoaderStrategy | None
- class haive.core.engine.document.loaders.base_new.CloudSource(/, **data)[source]¶
Bases:
RemoteSourceBase class for cloud storage sources.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- class haive.core.engine.document.loaders.base_new.DatabaseSource(/, **data)[source]¶
Bases:
BaseSource,haive.core.common.mixins.secure_config.SecureConfigMixinBase class for database sources.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- class haive.core.engine.document.loaders.base_new.DirectorySource(/, **data)[source]¶
Bases:
LocalSourceBase class for directory sources.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- class haive.core.engine.document.loaders.base_new.LoaderQuality[source]¶
-
Loader quality classification.
Initialize self. See help(type(self)) for accurate signature.
- class haive.core.engine.document.loaders.base_new.LoaderSpeed[source]¶
-
Loader speed classification.
Initialize self. See help(type(self)) for accurate signature.
- class haive.core.engine.document.loaders.base_new.LoaderStrategy[source]¶
Information about a specific loader strategy.
- class haive.core.engine.document.loaders.base_new.LocalSource(/, **data)[source]¶
Bases:
BaseSourceBase class for local file sources.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- class haive.core.engine.document.loaders.base_new.RemoteSource(/, **data)[source]¶
Bases:
BaseSource,haive.core.common.mixins.secure_config.SecureConfigMixinBase class for remote sources with credential support.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- class haive.core.engine.document.loaders.base_new.SourcePattern[source]¶
Pattern specification for source matching.
- haive.core.engine.document.loaders.base_new.create_simple_loader(source_class, loader_class_name, module='langchain_community.document_loaders', **loader_kwargs)[source]¶
Helper to create a simple loader instance.
- Parameters:
source_class (type[BaseSource])
loader_class_name (str)
module (str)
- Return type:
langchain_core.document_loaders.BaseLoader