config_loader¶
academic_doc_generator.config_loader
¶
Configuration loader for colloquium-protocol-creator.
This module provides functionality to load and validate configuration files for different tasks (colloquium, project, review).
ConfigLoader
¶
Lädt und validiert Konfigurationsdateien für verschiedene Tasks.
Source code in src/academic_doc_generator/config_loader.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | |
__init__(folder_path)
¶
Initialisiert den ConfigLoader.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
folder_path
|
str
|
Pfad zum Ordner, der die JSON-Konfigurationsdatei enthält. Es wird nach config*.json gesucht und die erste gefundene Datei verwendet. |
required |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
Wenn keine Config-Datei gefunden wird. |
JSONDecodeError
|
Wenn die Config-Datei kein valides JSON ist. |
Source code in src/academic_doc_generator/config_loader.py
__repr__()
¶
String-Repräsentation des ConfigLoaders.
Returns:
| Type | Description |
|---|---|
str
|
Beschreibung der geladenen Konfiguration. |
get_colloquium_config()
¶
Gibt die Kolloquiums-Konfiguration zurück.
Returns:
| Type | Description |
|---|---|
Optional[dict[str, Any]]
|
Dictionary mit Kolloquiums-Details oder None wenn nicht vorhanden. |
Source code in src/academic_doc_generator/config_loader.py
get_gemini_emark_config()
¶
Gibt die Gemini-Emarks-Konfiguration zurück.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary mit Gemini-Emarks-Einstellungen: |
dict[str, Any]
|
|
dict[str, Any]
|
|
dict[str, Any]
|
|
Source code in src/academic_doc_generator/config_loader.py
get_llm_config()
¶
Gibt die LLM-Konfiguration zurück.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary mit LLM-Konfiguration (api_choice, model, etc.). |
get_output_config()
¶
Gibt die Output-Konfiguration zurück.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary mit Output-Konfiguration (folder, compile_pdf, etc.). |
get_pdf_path()
¶
Gibt den vollständigen Pfad zur PDF-Datei zurück.
Returns:
| Type | Description |
|---|---|
str
|
Vollständiger Pfad zur PDF-Datei. |
Source code in src/academic_doc_generator/config_loader.py
get_project_config()
¶
Gibt die Projekt-Konfiguration zurück.
Returns:
| Type | Description |
|---|---|
Optional[dict[str, Any]]
|
Dictionary mit Projekt-Details oder None wenn nicht vorhanden. |
get_task()
¶
Gibt den Task-Typ zurück.
Returns:
| Type | Description |
|---|---|
str
|
Task-Typ ("colloquium", "project", oder "review"). |
load_config(folder_path)
¶
Factory-Funktion zum Laden einer Konfiguration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
folder_path
|
str
|
Pfad zum Ordner, der die JSON-Konfigurationsdatei enthält. |
required |
Returns:
| Type | Description |
|---|---|
ConfigLoader
|
ConfigLoader-Instanz mit geladener und validierter Konfiguration. |
Example
config = load_config("config_templates") print(config.get_task()) colloquium print(config.get_pdf_path()) config_templates/Bachelorarbeit_Mustermann.pdf