Replies: 2 comments
-
You could use the ContextHook extension:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
See also #718 and #986 although not finalized and (officially) available yet. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey @yajo 👋
I've been wondering what's the official way of normalizing answers values? Currently, I'm using the
when: false
key to sort of post-process prompt value for a given question. Example:This is especially useful during templating. Jinja template is much more readable this way. Also it's easier to write
{{package_name}}
rather than{{ project_name|lower|replace(' ','_')|replace('-','_') }}
in every file/line that needs the variable. Secondly, this gives a mechanism to ensure correct values on the template configuration level.The problem with using
when:false
for this use case is that, the value will not be updated even if the "parent" answer has changed. And I know this is currently expected behavior as the docs say:Is there any other way to normalize answers values, such that it would work with the updates too?
Thanks as always, and have a good one!
Beta Was this translation helpful? Give feedback.
All reactions