Skip to content

backend_settings

Backend settings module

Classes

APISettings

Bases: BaseDataModel

Eleanor Framework API settings

Attributes

fastapi class-attribute instance-attribute
fastapi: KwargsModel = Field(
    ..., description="FastAPI settings"
)
uvicorn class-attribute instance-attribute
uvicorn: KwargsModel = Field(
    ..., description="Uvicorn WSGI server settings"
)

BackendSettings

Bases: BaseDataModel

Backend API configuration settings

Attributes:

Attributes

api class-attribute instance-attribute
api: APISettings = Field(..., description=__doc__)
api_worker_pool class-attribute instance-attribute
api_worker_pool: int = Field(
    10,
    description="Number of worker threads available to handle API requests",
)
chain_invoke class-attribute instance-attribute
chain_invoke: ChainInvokeSettings = Field(
    default_factory=ChainInvokeSettings, description=__doc__
)
chat_completions class-attribute instance-attribute
chat_completions: ChatCompletionSettings = Field(
    default_factory=ChatCompletionSettings,
    description=__doc__,
)
checkmate class-attribute instance-attribute
checkmate: CheckMateSettings = Field(
    ..., title="CheckMate Settings", description=__doc__
)
flexible_resource_matching class-attribute instance-attribute
flexible_resource_matching: bool = Field(
    default=True,
    title="Flexible Resource Matching",
    description="Resource records such as Sessions, Collections, Users, and Agents managed by The EleanorAI Framework in that they all belong to a namespace, support soft deletes, and can be disabled. Moreover, in the RDBMS these records also have a name that is unique per namespace. This means that resources can be retrieved and referenced either by their PKID or by name. When enabled, this will enable flexible resource matching at the DAO-level for retrieving single record operations from the database. When this is set to false, PKIDs must be used",
)
graph_batch_chunk_size class-attribute instance-attribute
graph_batch_chunk_size: int = Field(
    default=1000,
    description="When performing batch/bulk operations on the graph database, this value controls the maximum size of each chunk",
)
graph_driver class-attribute instance-attribute
graph_driver: GraphDriverFactory = Field(
    ...,
    description="Neo4J graph database driver factory settings",
)
graph_enabled class-attribute instance-attribute
graph_enabled: bool = Field(
    default=False,
    title="Graph Driver Enabled",
    description="When true, graph database connection will be used",
)
images_dir class-attribute instance-attribute
images_dir: str = Field(..., description="Images directory")
jobs class-attribute instance-attribute
jobs: List[IoCFactoryModel] = Field(
    default_factory=list,
    title="Job Factories",
    description="A list of job factories that will be instantiated and run by the backend. Jobs are automatically initialized by a Pydantic model validator and must use the normal IoCFactoryModel syntax (ex a dictionary with a class field and other arguments that get passed to the constructor). All instances must inherit from eleanor.backend.jobs.base.BaseJob or validation will fail. This field is volatile will be excluded from serialization.",
    frozen=True,
)
langfuse_callback_kwargs class-attribute instance-attribute
langfuse_callback_kwargs: KwargsModel = Field(
    ...,
    title="Langfuse Callback Handler",
    description="Additional arguments to pass to the Langfuse callback handler",
)
langfuse_include_chain class-attribute instance-attribute
langfuse_include_chain: bool = Field(
    default=True,
    title="Langfuse Include Chain",
    description="When true, the chain JSON will be added to LangFuse metadata, else this is disabled",
)
langfuse_limit_full_memory class-attribute instance-attribute
langfuse_limit_full_memory: int = Field(
    default=40,
    title="Langfuse Limit Full Memory",
    description="Limits the number of full_memory entries returned by get_memories, effectively setting a cap in the number of memories sent to LangFuse",
)
langfuse_project_id class-attribute instance-attribute
langfuse_project_id: str | None = Field(
    default=None,
    title="Langfuse Project Identifier",
    description="The unique LangFuse project identifier of the project used to trace LLM executions. When this value is not None, calls to the chain invoke service will log the URL to the trace to the Eleanor Framework logs.",
)
llm_bg_task_pool class-attribute instance-attribute
llm_bg_task_pool: int = Field(
    10,
    description="Number of workers threads in the LLM background task pool",
)
log_chat_details class-attribute instance-attribute
log_chat_details: bool = Field(
    default=True,
    title="Log Chat Operation Details",
    description="Write chat details to log (may be verbose)",
)
log_chat_requests class-attribute instance-attribute
log_chat_requests: bool = Field(
    default=True,
    title="Log Chat Requests",
    description="Write incoming chat message requests to the logs (may be verbose)",
)
log_chat_responses class-attribute instance-attribute
log_chat_responses: bool = Field(
    default=True,
    title="Log Chat Responses",
    description="Write outgoing chat message responses to the logs (may be verbose)",
)
static_dir class-attribute instance-attribute
static_dir: str = Field(
    ..., description="Static content directory"
)
vector_store class-attribute instance-attribute
vector_store: str = Field(
    ..., description="Vector store connection name"
)

ChainInvokeSettings

Bases: BaseModel

Settings that control the behavior of the LangChain invoke service

Attributes:

Attributes

default_max_tries class-attribute instance-attribute
default_max_tries: int = Field(
    default=1,
    gt=0,
    title="Chain Invoke Max Tries",
    description="When executing chains via the chain invoke service, this value controls the default number of tries langchain will attempt before triggering a failure. Increasing this value > 1 can be an effective strategy to increase overall success when dealing with periodic LLM generation errors. A common use case for multiple tries is when a LLM periodically returns results that cannot be parsed by the chain's output parser.",
)
max_concurrency class-attribute instance-attribute
max_concurrency: int = Field(
    default=10,
    description="Maximum number of parallel calls to make, defaults to 10.",
)
recursion_limit class-attribute instance-attribute
recursion_limit: int = Field(
    default=25,
    description="Maximum number of times a call can recurse. If not provided, defaults to 25.",
)
reduce_batch_size class-attribute instance-attribute
reduce_batch_size: int = Field(
    default=10,
    gt=2,
    title="LLM Reduce Batch Size",
    description="For backend LLM map/reduce operations, this parameter controls the default batch size used for the reduce operation.",
)

ChatCompletionSettings

Bases: BaseDataModel

Chat completion APi settings

Attributes:

Attributes

group_chat_patterns class-attribute instance-attribute
group_chat_patterns: List[str] = Field(
    default_factory=list,
    title="Group Chat Identification Pattern(s)",
    description="",
)
single_user_chat_patterns class-attribute instance-attribute
single_user_chat_patterns: List[str] = Field(
    default_factory=list,
    title="Single User Chat Identification Pattern(s)",
    description="",
)

CheckMateSettings

Bases: BaseModel

CheckMate task execution engine settings

Attributes

auto_cleanup class-attribute instance-attribute
auto_cleanup: bool = Field(
    default=False,
    title="Auto Cleanup",
    description="Auto cleanup for task engine",
)
bind_lock_timeout class-attribute instance-attribute
bind_lock_timeout: float | None = Field(
    default=None,
    title="Bind Lock Timeout",
    description="Bind lock timeout for task engine",
)
io_factory class-attribute instance-attribute
io_factory: IoCFactoryModel = Field(
    ...,
    title="Task I/O",
    description="Factory class for task persistence storage",
)
max_attempts class-attribute instance-attribute
max_attempts: int = Field(
    default=1,
    title="Max Attempts",
    description="Maximum number of attempts for task engine",
)
retry_policy class-attribute instance-attribute
retry_policy: RetryPolicy = Field(
    default=STAGE,
    title="Retry Policy",
    description="Retry policy for task engine",
)

GraphDriverFactory

Bases: BaseDataModel

Neo4j/Memgraph graph database client configuration settings & driver factory

Attributes:

  • password (SecretStr) –

    Graph database password

  • uri (str) –

    Neo4j/Memgraph database URI

  • user (str) –

    Neo4j/Memgraph database user

  • trust (str | None) –

    Path to certificate trust

  • kwargs (KwargsModel) –

    Additional Driver kwargs

Attributes

kwargs class-attribute instance-attribute
kwargs: KwargsModel = Field(
    default_factory=KwargsModel,
    description="Additional Driver kwargs",
)
password class-attribute instance-attribute
password: SecretStr = Field(
    default_factory=lambda: SecretStr(""),
    exclude=True,
    description="Graph database password",
)
trust class-attribute instance-attribute
trust: str | None = Field(
    default=None, description="Path to certificate trust"
)
uri class-attribute instance-attribute
uri: str = Field(
    ..., description="Neo4j/Memgraph database URI"
)
user class-attribute instance-attribute
user: str = Field(
    ..., description="Neo4j/Memgraph database user"
)

Functions

new_driver
new_driver() -> Driver

Neo4j client has a wonky API to connect to the database. This wraps the complexity.

Returns:

  • Driver

    A new instance of the driver.