Spaces:
Running
Running
Update src/aibom_generator/generator.py
Browse files
src/aibom_generator/generator.py
CHANGED
@@ -133,6 +133,8 @@ class AIBOMGenerator:
|
|
133 |
return {}
|
134 |
|
135 |
def _create_metadata_section(self, model_id: str, metadata: Dict[str, Any]) -> Dict[str, Any]:
|
|
|
|
|
136 |
timestamp = datetime.datetime.utcnow().isoformat() + "Z"
|
137 |
tools = [{
|
138 |
"vendor": "Aetheris AI",
|
@@ -160,6 +162,8 @@ class AIBOMGenerator:
|
|
160 |
value = json.dumps(value)
|
161 |
properties.append({"name": key, "value": str(value)})
|
162 |
|
|
|
|
|
163 |
metadata_section = {
|
164 |
"timestamp": timestamp,
|
165 |
"tools": tools,
|
|
|
133 |
return {}
|
134 |
|
135 |
def _create_metadata_section(self, model_id: str, metadata: Dict[str, Any]) -> Dict[str, Any]:
|
136 |
+
from utils import calculate_completeness_score # Assumes utils.py is in same module
|
137 |
+
completeness_score = calculate_completeness_score({"metadata": metadata})
|
138 |
timestamp = datetime.datetime.utcnow().isoformat() + "Z"
|
139 |
tools = [{
|
140 |
"vendor": "Aetheris AI",
|
|
|
162 |
value = json.dumps(value)
|
163 |
properties.append({"name": key, "value": str(value)})
|
164 |
|
165 |
+
properties.append({"name": "aibom:quality-score", "value": str(completeness_score)})
|
166 |
+
|
167 |
metadata_section = {
|
168 |
"timestamp": timestamp,
|
169 |
"tools": tools,
|