app_settings
Application settings module
Attributes
SETTINGS_ENV_DOTENV
module-attribute
SETTINGS_ENV_DOTENV = (
f"{SETTINGS_ENV_PREFIX}SETTINGS_DOTENV"
)
Classes
APIClient
Bases: IoCFactoryModel
High-level Eleanor framework backend API client factory settings. See: eleanor.client.EleanorAPIClient
Attributes:
-
low_level_client
(LowLevelAPIClient
) –Low-level client factory settings
Attributes
low_level_client
class-attribute
instance-attribute
low_level_client: LowLevelAPIClient = Field(
..., description=__doc__
)
AppSettings
Bases: BaseSettings
, SettingsBaseModel
Eleanor framework configuration settings
Settings will be loaded in the following order
- Parameters passed in on instantiation
- A YAML configuration referenced by the environment variable ‘ELEANOR_SETTINGS_YAML’
- A .env file that is typically passed in on the constructor ex:
settings = Settings(_env_file=’config/settings.env’)
- file_secret_settings, see https://docs.pydantic.dev/latest/concepts/pydantic_settings/#secrets
Note that the first appearance of a setting effectively locks it in.
Attributes:
-
encoding
(str
) –Default character encoding used by the framework
-
timezone
(str
) –System timezone
-
monkeypatch
(List[MonkeyPatchSettingsRecord]
) –Monkeypatch settings
-
db_engine
(DBEngineSettings
) –RDBMS SQLAlchemy Engine settings
-
sessionmaker_kwargs
(KwargsModel
) –Additional Kwargs to pass to the sessionmaker constructor
-
embeddings_model_path
(str
) –Filesystem path to the embeddings model
-
vector_tokenizer
(VectorTokenizer
) –Vector tokenizer settings
-
vector_stores
(Dict[str, VectorStoreSettings]
) –Vector store IoC factory settings
-
vectordb_bulk_op_pool_size
(int
) –Bulk Vectorize Pool Size
-
vectordb_bulk_op_timeout
(int
) –Bulk Vectorize Operation Timeout
-
vectordb_worker_batch_size
(int
) –Bulk Vectorize Worker Batch Size
-
vectordb_worker_default_trim_strategy
(str
) –Bulk Vectorize Default Trim Strategy
-
llms
(Dict[str, LLMSettings]
) –LLM settings
-
backend
(BackendSettings
) –Backend settings
-
quantization
(QuantizationSettings
) –Quantization settings
-
ui
(UISettings
) –UI settings
-
api_client
(APIClient
) –Eleanor framework backend API client factory settings
-
llm_client
(IoCFactoryModel
) –Eleanor LLM client factory
-
chain_registry
(Registry[Tuple[ChainBuilder, RunnableSerializable]]
) –Chain registry
-
chain_invoke
(ChainInvokeSettings
) –Chain invoke settings
-
cognitive
(CognitiveSettings
) –Cognitive settings
-
corpus_reader
(CorpusReaderSettings
) –Corpus reader settings
-
text_evolve_evaluate
(EvaluateSettings
) –Text evolve evaluate settings
Attributes
api_client
class-attribute
instance-attribute
api_client: APIClient = Field(..., description=__doc__)
backend
class-attribute
instance-attribute
backend: BackendSettings = Field(..., description=__doc__)
chain_registry
class-attribute
instance-attribute
chain_registry: SkipJsonSchema[
Registry[Tuple[ChainBuilder, RunnableSerializable]]
] = Field(
default_factory=Registry[
Tuple[ChainBuilder, RunnableSerializable]
],
title="Chain Registry",
description="The Eleanor framework will load LangChain chains into this registry so they can be referenced when invoking them via the service or API layers. This field is considered volatile and is intended to be set each time the application starts.",
frozen=False,
exclude=True,
validate_default=True,
)
cognitive
class-attribute
instance-attribute
cognitive: CognitiveSettings = Field(
..., description=__doc__
)
corpus_reader
class-attribute
instance-attribute
corpus_reader: CorpusReaderSettings = Field(
..., title="Corpus Reader Settings", description=__doc__
)
db_engine
class-attribute
instance-attribute
db_engine: DBEngineSettings = Field(
..., description=__doc__
)
db_engine_connection_logging
class-attribute
instance-attribute
db_engine_connection_logging: bool = Field(
default=True,
title="DB Connection Logging",
description="When true, the framework will log database connection creation events. Usefulwhen debugging database connection issues.",
)
embeddings_model_path
class-attribute
instance-attribute
embeddings_model_path: str = Field(
default="",
description="Filesystem path to the embeddings model",
)
encoding
class-attribute
instance-attribute
encoding: str = Field(
default="UTF-8",
title="Default Encoding",
description="Default character encoding used by the framework",
)
llm_client
class-attribute
instance-attribute
llm_client: IoCFactoryModel = Field(
...,
title="Eleanor LLM Client Factory",
description="Eleanor framework LLM client configuration. This is a LangChain LLM client that can be used to connect to the Eleanor Framework chat API.",
)
llms
class-attribute
instance-attribute
llms: Dict[str, LLMSettings] = Field(
default_factory=dict, frozen=True, description=__doc__
)
model_config
class-attribute
instance-attribute
model_config = SettingsConfigDict(
env_prefix=SETTINGS_ENV_PREFIX,
case_sensitive=False,
env_file_encoding=SETTINGS_ENCODING,
env_nested_delimiter=SETTINGS_FIELD_DELIMITER,
)
monkeypatch
class-attribute
instance-attribute
monkeypatch: List[MonkeyPatchSettingsRecord] = Field(
default_factory=list,
title="Monkeypatch Settings",
description=__doc__,
)
quantization
class-attribute
instance-attribute
quantization: QuantizationSettings = Field(
..., title="", description=__doc__
)
sessionmaker_kwargs
class-attribute
instance-attribute
sessionmaker_kwargs: KwargsModel = Field(
default_factory=KwargsModel,
title="Sessionmaker Kwargs",
description="Additional Kwargs to pass to the sessionmaker constructor, see https://docs.sqlalchemy.org/en/20/orm/session_api.html#sqlalchemy.orm.sessionmaker",
)
text_evolve_evaluate
class-attribute
instance-attribute
text_evolve_evaluate: EvaluateSettings = Field(
..., description=__doc__
)
textproc
class-attribute
instance-attribute
textproc: TextProcSettings = Field(
..., title="TextProc Settings", description=__doc__
)
timezone
class-attribute
instance-attribute
vector_stores
class-attribute
instance-attribute
vector_stores: Dict[str, VectorStoreSettings] = Field(
default_factory=dict, description=__doc__
)
vector_tokenizer
class-attribute
instance-attribute
vector_tokenizer: VectorTokenizer = Field(
..., title="Vector Tokenizer", description=__doc__
)
vectordb_bulk_op_pool_size
class-attribute
instance-attribute
vectordb_bulk_op_pool_size: int = Field(
default=1,
title="Bulk Vectorize Pool Size",
description="When performing bulk memory adds, the vectorization process before it is added to the vector store can be parallelized by collection. This pool limits the number of parallel collections that are added to the vector store. Note that this value is global, meaning if multiple processes are adding memories they will share the same thread pool.",
)
vectordb_bulk_op_timeout
class-attribute
instance-attribute
vectordb_bulk_op_timeout: int = Field(
default=300,
title="Bulk Vectorize Operation Timeout",
description="LangChain VectorStore operation timeout for bulk vectorization operations. This ia a global settings that should be considered closely with the 'bulk_vectorize_pool_size' setting.",
)
vectordb_worker_batch_size
class-attribute
instance-attribute
vectordb_worker_batch_size: int = Field(
default=1000,
title="Bulk Vectorize Worker Batch Size",
description="Each bulk vectorization worker wraps LangChain VectorStore add_texts operation. This setting controls the batch_size parameter used in this process.",
)
vectordb_worker_default_trim_strategy
class-attribute
instance-attribute
vectordb_worker_default_trim_strategy: str = Field(
default="chunk",
title="Bulk Vectorize Default Trim Strategy",
description="During bulk vectorization, the worker needs a way to handle texts that exceed the embeddings maximum size. This value represents the system default strategy and can be either 'truncate' or 'chunk'.",
)
Functions
settings_customise_sources
classmethod
settings_customise_sources(
settings_cls: Type[BaseSettings],
init_settings: PydanticBaseSettingsSource,
env_settings: PydanticBaseSettingsSource,
dotenv_settings: PydanticBaseSettingsSource,
file_secret_settings: PydanticBaseSettingsSource,
) -> Tuple[PydanticBaseSettingsSource, ...]
trigger_initializers
trigger_initializers(condition: InitCondition) -> None
Triggers all initializers that have the specified condition.
Parameters:
-
condition
(InitCondition
) –The condition to check against the available conditions.
Returns:
-
None
–None
ChainBuilder
Bases: BaseModel
Chain builder configuration
Attributes:
-
name
(str
) –Chain name
-
description
(str
) –Chain description
DBEngineSettings
Bases: IoCFactoryModel
RDBMS SQLAlchemy Engine settings
Attributes:
-
url
(SecretStr
) –SQLAlchemy connection string
EmbeddingFunctionSettings
LowLevelAPIClient
Bases: IoCFactoryModel
Generated low-level API client factory settings
Attributes:
-
configuration
(LowLevelAPIClientConfiguration
) –Low-level client configuration
Attributes
configuration
class-attribute
instance-attribute
configuration: LowLevelAPIClientConfiguration = Field(
..., description=__doc__
)
LowLevelAPIClientConfiguration
Bases: IoCFactoryModel
Low-level client configuration Eleanor backend API client configuration settings
Attributes:
-
api_key
(SecretStr
) –Endpoint API key
MonkeyPatchOperation
Bases: BaseModel
Monkeypatch operation record.
Attributes:
-
target
(str
) –Full path to the target method or function
-
patch
(str
) –Full path to the patch method or function
Attributes
patch
class-attribute
instance-attribute
patch: str = Field(
...,
title="Patch Path",
description="Full path to the patch method or function (e.g., 'module.patch_function').",
)
target
class-attribute
instance-attribute
target: str = Field(
...,
title="Target Path",
description="Full path to the target method or function (e.g., 'module.Class.method').",
)
Functions
MonkeyPatchSettingsRecord
Bases: BaseModel
Monkeypatch settings record.
Attributes:
-
name
(str
) –Short name of the monkeypatch
-
description
(str
) –Detailed description of monkeypatch
-
references
(List[str]
) –List of references to external documentation or Github issues relevant to the patch
-
apply
(bool
) –Flag that determines if the monkeypatch is applied when the framework starts
-
operations
(List[MonkeyPatchOperation]
) –List of monkeypatch
Attributes
apply
class-attribute
instance-attribute
apply: bool = Field(
default=True,
title="Apply",
description="Flag that determines if the monkeypatch is applied when the framework starts.",
)
description
class-attribute
instance-attribute
description: str = Field(
default="",
title="Description",
description="Detailed description of monkeypatch, best practice is to include rationale and context that necessitate the patch.",
)
name
class-attribute
instance-attribute
operations
class-attribute
instance-attribute
operations: List[MonkeyPatchOperation] = Field(
...,
title="Operations",
description="List of monkeypatch operations.",
)
VectorStoreSettings
Bases: IoCFactoryModel
Vector store IoC factory settings
Attributes:
-
embedding_function
(EmbeddingFunctionSettings
) –Embedding function settings
Attributes
embedding_function
class-attribute
instance-attribute
embedding_function: EmbeddingFunctionSettings = Field(
..., description=__doc__
)
VectorTokenizer
Bases: BaseModel
Tokenizer used for context string pre-processing prior to sending to a vector store’s embeddings function.
Attributes:
-
max_length
(int
) –Maximum input length of the target embedding
-
factory
(IoCFactoryModel
) –Vector tokenizer IoC factory, an instance is created on model load.
Attributes
factory
class-attribute
instance-attribute
factory: IoCFactoryModel = Field(
...,
title="Tokenizer Factory",
description="Vector tokenizer IoC factory, an instance is created on model load.",
)
max_length
class-attribute
instance-attribute
max_length: int = Field(
...,
title="Max Length",
description="Maximum input length of the target embedding",
)
model_config
class-attribute
instance-attribute
tokenizer
class-attribute
instance-attribute
tokenizer: SkipJsonSchema[BaseTokenizer] = Field(
None,
title="Vector Tokenizer Instance (volatile)",
description="Vector tokenizer instance.",
frozen=False,
exclude=True,
validate_default=False,
)