ciberlabreport.settings module
Configuration loading utilities for ciberlabreport entrypoints.
- This module provides a small settings loader that combines:
Optional environment file values.
Base YAML configuration.
Profile-specific YAML configuration.
Environment variable overrides.
The resulting settings object can be passed directly to ReportGenerator
from external scripts.
- class ciberlabreport.settings.AppSettings(openai_api_key: str, vt_api_keys: list[str], input_path_default: str | None, output_path_default: str | None, config_path: str | None, prompts_path: str | None, schemas_path: str | None, tmp_path: str | None, ai_model: str, mode: str, img_threshold: int, max_files: int, max_completion_tokens: int, families_list: list[str])
Bases:
objectRuntime settings resolved from YAML and environment variables.
- openai_api_key
OpenAI API key used by the report generator.
- Type:
str
- vt_api_keys
VirusTotal API keys for enrichment lookups.
- Type:
list[str]
- input_path_default
Default input directory.
- Type:
str | None
- output_path_default
Default output directory.
- Type:
str | None
- config_path
Base directory for JSON configurations.
- Type:
str | None
- prompts_path
Prompt templates directory.
- Type:
str | None
- schemas_path
JSON schema directory.
- Type:
str | None
- tmp_path
Temporary output directory.
- Type:
str | None
- ai_model
LLM model identifier.
- Type:
str
- mode
Runtime mode (for example,
PROorDEV).- Type:
str
- img_threshold
Image threshold used in processing logic.
- Type:
int
- max_files
Maximum number of JSON files processed per run.
- Type:
int
- max_completion_tokens
LLM output token cap.
- Type:
int
- ai_model: str
- config_path: str | None
- families_list: list[str]
- img_threshold: int
- input_path_default: str | None
- max_completion_tokens: int
- max_files: int
- mode: str
- openai_api_key: str
- output_path_default: str | None
- prompts_path: str | None
- schemas_path: str | None
- tmp_path: str | None
- vt_api_keys: list[str]
- ciberlabreport.settings.load_settings() AppSettings
Load and resolve application settings for execution entrypoints.
- Resolution order:
Optional environment file from
CIBERLABREPORT_ENV_FILE.Base YAML file from
CIBERLABREPORT_CONF_FILE(default:config/base.yaml).Profile YAML file under
profiles/<profile>.yamlwhereprofilecomes fromCIBERLABREPORT_PROFILE(default:local).Environment variable overrides for selected fields.
- Returns:
Fully resolved settings object.
- Return type:
- Raises:
ValueError – If
OPENAI_API_KEYis missing.