Settings¶
aana.configs
¶
DbSettings
¶
Bases: BaseSettings
Database configuration.
ATTRIBUTE | DESCRIPTION |
---|---|
datastore_type |
The type of the datastore. Default is DbType.SQLITE.
TYPE:
|
datastore_config |
The configuration for the datastore. Default is SQLiteConfig(path="/var/lib/aana_data").
TYPE:
|
pool_size |
The number of connections to keep in the pool. Default is 5.
TYPE:
|
max_overflow |
The number of connections that can be created when the pool is exhausted. Default is 10.
TYPE:
|
pool_recycle |
The number of seconds a connection can be idle in the pool before it is invalidated. Default is 3600.
TYPE:
|
get_engine
¶
Gets engine. Each instance of DbSettings will create a max.of 1 engine.
PostgreSQLConfig
¶
Bases: TypedDict
Config values for PostgreSQL.
ATTRIBUTE | DESCRIPTION |
---|---|
host |
The host of the PostgreSQL server.
TYPE:
|
port |
The port of the PostgreSQL server.
TYPE:
|
user |
The user to connect to the PostgreSQL server.
TYPE:
|
password |
The password to connect to the PostgreSQL server.
TYPE:
|
database |
The database name.
TYPE:
|
SQLiteConfig
¶
Bases: TypedDict
Config values for SQLite.
ATTRIBUTE | DESCRIPTION |
---|---|
path |
The path to the SQLite database file.
TYPE:
|
Settings
¶
Bases: BaseSettings
A pydantic model for SDK settings.
ATTRIBUTE | DESCRIPTION |
---|---|
tmp_data_dir |
The temporary data directory.
TYPE:
|
image_dir |
The temporary image directory.
TYPE:
|
video_dir |
The temporary video directory.
TYPE:
|
audio_dir |
The temporary audio directory.
TYPE:
|
model_dir |
The temporary model directory.
TYPE:
|
num_workers |
The number of web workers.
TYPE:
|
openai_endpoint_enabled |
Flag indicating if the OpenAI-compatible endpoint is enabled. Enabled by default.
TYPE:
|
include_stacktrace |
Flag indicating if stacktrace should be included in error messages. Enabled by default.
TYPE:
|
task_queue |
The task queue settings.
TYPE:
|
db_config |
The database configuration.
TYPE:
|
test |
The test settings.
TYPE:
|
setup_resource_directories
¶
Create the resource directories if they do not exist.
Source code in aana/configs/settings.py
TaskQueueSettings
¶
Bases: BaseModel
A pydantic model for task queue settings.
ATTRIBUTE | DESCRIPTION |
---|---|
enabled |
Flag indicating if the task queue is enabled.
TYPE:
|
num_workers |
The number of workers in the task queue.
TYPE:
|
execution_timeout |
The maximum execution time for a task in seconds. After this time, if the task is still running, it will be considered as stuck and will be reassign to another worker.
TYPE:
|
heartbeat_timeout |
The maximum time between heartbeats in seconds.
TYPE:
|
max_retries |
The maximum number of retries for a task.
TYPE:
|
maximum_active_tasks_per_user |
The maximum number of active tasks per user (only applicable in the API service).
TYPE:
|
TestSettings
¶
Bases: BaseModel
A pydantic model for test settings.
ATTRIBUTE | DESCRIPTION |
---|---|
test_mode |
Flag indicating if the SDK is in test mode.
TYPE:
|
save_expected_output |
Flag indicating if the expected output should be saved (to create test cases).
TYPE:
|
DbType
¶
Bases: str
, Enum
Engine types for relational database.
ATTRIBUTE | DESCRIPTION |
---|---|
POSTGRESQL |
PostgreSQL database.
|
SQLITE |
SQLite database.
|