Squashed 'ai-context/trustgraph-templates/' content from commit 42a5fd1b

git-subtree-dir: ai-context/trustgraph-templates
git-subtree-split: 42a5fd1b678f32be378062e30451e2052ccb95dd
This commit is contained in:
elpresidank 2026-04-05 21:09:49 -05:00
commit 74cc8a4685
1216 changed files with 116347 additions and 0 deletions

View file

@ -0,0 +1,23 @@
import _gojsonnet as j
import json
import os
import pathlib
import logging
logger = logging.getLogger("generator")
logger.setLevel(logging.INFO)
class Generator:
def __init__(self, fetch):
self.fetch = fetch
def process(self, config):
res = j.evaluate_snippet("config", config, import_callback=self.fetch)
return json.loads(res)
def process_file(self, path):
content = path.read_text()
res = j.evaluate_snippet(str(path), content, import_callback=self.fetch)
return json.loads(res)