mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 16:36:21 +02:00
* Added single-target command-line config generator. Mainly using for testing ATM. * Slightly tweak the config decode so that components can over-ride the 'with' method which injects parameters. * Deliberately break the prompt-generic template. Could do better, this is temporary. * Add 'prompt-overrides' component, injects new prompts. * Removed prompt generic reference, not used * prompt-generic is no longer supported
31 lines
662 B
Jsonnet
31 lines
662 B
Jsonnet
|
|
local components = import "components.jsonnet";
|
|
|
|
local apply = function(p, components)
|
|
|
|
local base = {
|
|
|
|
with:: function(k, v) self + {
|
|
[k]:: v
|
|
},
|
|
|
|
with_params:: function(pars)
|
|
self + std.foldl(
|
|
function(obj, par) obj.with(par.key, par.value),
|
|
std.objectKeysValues(pars),
|
|
self
|
|
),
|
|
|
|
};
|
|
|
|
local component = base + components[p.name];
|
|
|
|
component.with_params(p.parameters);
|
|
|
|
local decode = function(config)
|
|
local add = function(state, c) state + apply(c, components);
|
|
local patterns = std.foldl(add, config, {});
|
|
patterns;
|
|
|
|
decode
|
|
|